Hi, I’m preparing some maps using Maperitive for projects in print, e.g. my personal travel photobook and a travel guide to be published. I got the conversion OSM-SVG-PDF working, but I need my (PDF) maps in defined sizes, e.g.
That means, my output size is fixed, I can also set the scale, and I have either a pair of coordinates that must be included, or I have one coordinate to be the center point. I don’t really care about the used projection (I wouldn’t know which one to choose anyway) and would use the default one of Maperitive. But I need an algorithm to calculate the coordinates to use in Maperitive’s "set-print-bounds-geo" from output size, scale and a center point OR from output size and an included pair of coordinates. I’ll implement that in a Python script (and possibly in a spreadsheet). If some guesswork is involved, I'll just try a loop for approximation. Please don’t just send me to Geoinformatics 101 ;) EDIT: Trying to reword my question: As far as I understand, OSM data is in WGS84. Now, if I need a map of e.g. 5x5km around a coordinate, how much are these 2.5km plus/minus in easting/northing? Does it depend on the actual place? asked 16 Aug '15, 04:31 Hraban |
Not sure about Maperitive's setup but I did something similar a while back using Mapnik. In that you specify the scale per pixel as it is generally setup for output to displays. But once you decide the number of dots per inch (or cm) you are going to be printing at and the map scale you want the printed page to be you can multiply the numbers out to get the scale per pixel you need. In my case I have some scripts where I specify the center point for the map, the printed scale I want (usually 1:24000) and the size of the paper I am printing too. Here is a bit of out of context python code where I do my calculations. (Associate array v contains a definition of the map I want to print (paper size, map center in UTM grid coordinates, etc.) while things like the print dots per inch are specified as arguments on the command line). I specify my text in terms of printer points (72dpi) so I calculate what the DPI on those should be too:
I have another hacked up script that puts my output raster image file into a PDF so I can easily force printing at the desired DPI by just telling the print dialog box to print at 100% but that is probably outside of the scope of your question. answered 16 Aug '15, 12:33 n76 Thanks for trying, but you misunderstood - I'm not interested in pixels at all, since I deal with vector data. What I need is your "wgs84utm" function. Seems like it comes from http://gis.stackexchange.com/questions/78915/off-by-about-85-meters-when-converting-nad27-utm-to-wgs84-lat-lon, i.e. from EDIT: The pyproj (i.e. proj.4) docs are too much for me. :(
(16 Aug '15, 14:11)
Hraban
|
Another try at rewording: How do I add some length on the map to a longitude or latitude? (The length on the surface is not the same as the length in a projection, is it?) I found the formulae of Mercator projection in Wikipedia, but I don’t understand how to employ them – if they’re a solution for my problem at all.