[OSM-dev] Customizing map for wikivoyage.org

Florian Lohoff flo at rfc822.org
Sat Jul 4 14:09:50 BST 2009


On Sat, Jul 04, 2009 at 02:57:35PM +0200, Lennard wrote:
> Florian Lohoff wrote:
>
>> The problem with the different projection will be that you'll need
>> to modify the sql queries made in the mapnik xml to reproject
>> to a different projection. IIRC the default osm2pgsql imports
>> with is ESRI:900913 aka google/mercator.
>
> You don't need to update the queries themselves, but the SRS of the  
> <Map> and all relevant <Layer> objects in the XML.

Will mapnik automatically detect that the geoms in the database
are of a different SRS and do a ST_Translate itself?

My trys did not work and i finally modified the select statements or
better produced translating views i let mapnik access.

osm=> \d completeborders
       Table "public.completeborders"
   Column   |       Type        | Modifiers 
------------+-------------------+-----------
 id         | bigint            | 
 name       | character varying | 
 complete   | integer           | 
 adminlevel | integer           | 
 border     | geometry          | 
 path       | character varying | 
Check constraints:
    "enforce_dims_border" CHECK (ndims(border) = 2)
    "enforce_srid_border" CHECK (srid(border) = 4326)


osm=> \d completebordersm
       View "public.completebordersm"
   Column    |       Type        | Modifiers 
-------------+-------------------+-----------
 id          | bigint            | 
 name        | character varying | 
 complete    | integer           | 
 admin_level | character varying | 
 geom        | geometry          | 
View definition:
 SELECT completeborders.id, completeborders.name, completeborders.complete,
completeborders.adminlevel::character varying AS admin_level,
st_transform(completeborders.border, 900913) AS geom FROM completeborders;

I had ways in 4326 in the database but wanted a 900913 image.

Flo
-- 
Florian Lohoff                  flo at rfc822.org             +49-171-2280134
	Those who would give up a little freedom to get a little 
          security shall soon have neither - Benjamin Franklin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20090704/76656466/attachment.pgp>


More information about the dev mailing list