[OSM-dev] Rendering shapefiles under Mercator

Artem Pavlenko artem at mapnik.org
Sat Mar 17 11:47:29 GMT 2007


Hi Nick,

>
> (cc to dev in case anyone else can shed light on this...)
>
> I'm having a bit of trouble rendering shapefiles under Mercator  
> projection. If
> my XML file begins with:
>
> <Map bgcolor="#f2efe9" srs="+proj=merc +datum=WGS84 +k=1.0 +units=m  
> +over
> +no_defs">
>
> then I can render the PostGIS database fine, but I am unable to render
> shapefiles containing SRTM height data. The height data *is* in  
> Mercator
> projection (I checked by doing 'shpdump' on the file and get the  
> correct
> coordinates)
>
> On the other hand, if my XML file begins with simply:
>
> <Map bgcolor="#f2efe9">
>
> the Mercator-projected height data actually renders fine - even  
> though I
> haven't specified Mercator. However, the PostGIS won't render.
>
> Is this a known issue or am I doing anything wrong?
>

You need to specify projection for you Layers e.g
<Layer .... srs="+proj=merc +ellps=GRS80">


> The other thing is that rendering the shapefiles is rather slow  
> compared to
> the PostGIS - indeed, prohibitively slow if the shapefile covers a  
> wider area
> than 100km x 100km - would I be better off putting the height data  
> in a
> PostGIS database or using GeoTIFF perhaps? Note that my server only  
> has 160mb
> of ram.
>

Are you using *.index file created with shapeindex ?

Cheers,
Artem





More information about the dev mailing list