Heyho! I want to render a map.png in UTM-Projection. But I didn't find anything useful on the internet.. :( Can anyone tell me, what I have to do to simply render in UTM-Projection?? I only want to render small maps so the different zones should not be a problem, I think. I imported my schleswig-holstein.osm via osm2pgsql to my PostgreSQL/PostGIS database and now I want to render using Python/Mapnik. I'm very thankful for any little hint or idea! Please help me! Greetz Matze asked 09 May '12, 09:14 MHein |
Just to make this a little bit clearer and to give you an "answer":
and that should give you an image in UTM. You may verify this by printing some metadata
HTH Frank answered 21 May '12, 08:53 frabron Heyho! I tried rendering in UTM but when I had eliminated all errors and saw the map, I recognized that the map was still rendered in standard (google?)-projection (where Greenland is as big as Africa). I changed the -- Map background-color="#fff" srs="+init=epsg:3857" -- into -- Map background-color="#b5d0d0" srs="&srs_UTM;" -- and defined srs_UTM in entities.xml.inc this way:
In my generate_imgage.py I used:
I don't know what I did wrong or maybe what I forgot to change.. e.g. I found
and I don't know If I should change it or anything else.. this is my entities.xcl.inc: http://dpaste.org/cuJW3/ this is my osm.xml: http://dpaste.org/xLqJA/ this is my generate_image.py: http://dpaste.org/0WEQw/ I hope that anyone can help me.. please!!! Greetings Matze
(14 May '12, 07:48)
MHein
1
Well, apparently you are transforming your desired UTM to Mercator in your Python script. Just skip the transformation steps and you should be fine
(21 May '12, 08:43)
frabron
Unfortunately it doesn't work.. I will describe the problems in another answer.
(23 May '12, 11:39)
MHein
First of all, thank you, Frank! I deleted all the transformation-things etc. und put the things as you wrote it. The rendering doesn't produce any errors but the maps I get are not like I want them. This happens, when I try to render my hometown Kiel in Schleswig-Holstein, Germany: http://imgur.com/CIPJ5 This looks as if just the coastlines are used to create this image. Why is the osm-content of my schleswig-holstein.osm.pbf not displayed? I imported it like this: When I try to render the whole world, the image looks like this: http://imgur.com/f2gNa ( This looks as if the coastlines have not been used.. Is it because of the fact that the coastlines are not in the right projection? I'll post my Maybe you, Frank or anybody else can can give me some useful advice, info or hint! That would make me really glad! Thank you in advance! Greetings, Matze
(23 May '12, 12:08)
MHein
1
I know Kiel, there's definetely more to see there ;-)
(23 May '12, 15:11)
frabron
Yes, much more! As a test, I imported (by osm2pgsql) my schleswig-holstein.osm.pbf with standard projection and rendered with the standard generate_image.py and it all worked out fine.. and I was using the same "inc"-files. Anyway, it's surprising that Kiel has the coastline and for the whole world they seem to be missing.. any other idea?
(24 May '12, 08:45)
MHein
showing 5 of 6
show 1 more comments
|
Well you should have an XML style file that gives the desired map projection at the top, like this:
If you change that to the EPSG code for the UTM projection you want to use (or even, instead of using one of the existing definitions, just write your own projection definition there in proj4 style) then the map is generated in that projection. Be careful when specifying the render extent; you'll have to give that in UTM coordinates then as well. If you use nik2img.py (recommended), you can even specify the projection on the command line. In the answered 09 May '12, 09:25 Frederik Ramm ♦ |
the map's srs is the dest srs, while your datasource's srs are the source srs. since you use osm data, so the datasource's is under wgs84(i.e.lat/long). To project to utm, you should set your map's srs to the desired utm zone. answered 24 May '12, 13:26 feverzsj No, this is not correct, since he used
(24 May '12, 13:42)
frabron
then no projection is needed for mapnik, just set all to same srs
(24 May '12, 13:50)
feverzsj
as far as I know, I set all the srs.. In which files do I have to set the srs?
(30 May '12, 10:02)
MHein
2
The possibly quickest way would be to add a new projection definition to inc/entities.xml.inc
just below the other two (srs900913 and srs4326) and in inc/settings.xml.inc set
to
There's probably no need to adjust the dwithin parameters, I'd give it a try like I described it. HTH Frank
(31 May '12, 13:27)
frabron
Thank you! I had added the projection in entities yet. But the change in settings was not made yet. now it looks this way:
I will try the next few days if it works ;)
(31 May '12, 15:40)
MHein
showing 5 of 6
show 1 more comments
|