I would like to create a world map with interaction on continents created directly from a postgis database.
For the moment, I have a POSTgis database with the data. I created a background with TileMill. I get data from Postgis in SVG and put them on the map using Raphael.
All seem well except that I have a small difference between both map :s I use default projection of TileMill (and I think we can't change it :)). And here is the POSTGIS command I'm executing to get the SVG:
SELECT st_asSVG(
st_scale(
st_translate(
St_Intersection(
ST_Transform(ST_SetSRID(ST_GeomFromText('POLYGON((-151.875 80.6470,175.7812 80.6470,175.7812 -63.2336,-151.875 -63.2336,-151.875 80.6470))'), 4326), 3857),
(SELECT st_union(geom) FROM geo.continentboundaries))
, 20037508.72, -20037508.72)
, 0.0000199043047125,0.0000199043047125)
, 0, 0)
Here is the result: http://i.stack.imgur.com/7lS0F.png
Do you know where I have a mistake?
Edit: some precisions: I'm using the same data for Tilemill and the svg. I added in the tilemill project the example of tilemill there is no problem of projection. In the layer in tilemill I'm using 900913. st_srid give me 3857 in Postgis which seems ok? I'm a beginner in SIG
No comments:
Post a Comment