[OSM-dev] Automatically triggering export as PDF from openstreetmap.org -> share?

Yves yvecai at gmail.com
Fri Dec 22 09:19:19 UTC 2017


Have a look at the print function at Opensnowmap.org, it's just a bit of Javascript and Leaflet or Openlayers to achieve a pdf printing from a browser. 
Yves 

Le 22 décembre 2017 10:06:00 GMT+01:00, Bjoern Hassler <bjohas+mw at gmail.com> a écrit :
>Dear Frederik, dear Paul,
>
>Thank you for your message! I suppose I made the mistake of asking for
>a
>technical fix, rather than fully explaining the problem...
>
>I have 40 small, discontinues areas in Ghana (the 40 public colleges of
>education), like this
>http://www.openstreetmap.org/way/450562441#map=16/7.4129/0.4631
>and I want to produce print. The files itself will be downloaded
>locally
>(or emailed), and then printed locally. So the file needs to be small,
>and
>print resolution (say for A2 or A3).
>
>We're actively editing this at the moment (and have been over the last
>year), so we'd like to print from up-to-date data.
>
>Print + small files, means PDF, as its vector, and can be printed at
>any
>size. I assume PNG at 300dpi, A3, would be massive.
>
>There aren't loads of areas, and manual export would be ok. However,
>because the areas are discontinuous, I am looking for a solution where
>I
>can work from lat/lon, rather than having to manually select areas.
>Once
>this would be ok, but we'd like to be able to repeat the export later.
>Most
>tools don't allow you to go back to maps that you've already produced,
>to
>reprint simply with data a year on.
>
>
>
>> https://operations.osmfoundation.org/policies/tiles/
>> ...
>
>so using a script to produce these PDFs would violate the policy except
>> in rare circumstances where running the script is triggered by a user
>> request.
>>
>
>I'd be quite happy to click manually. At the moment, I enter the values
>for
>scale manually, resize the browser window so it gives me the right
>nominal
>dimensions (for PDF), then export. However, it would be helpful to have
>a
>preconfigured link, that gives me my settings (scale, dimensions).
>
>>
>> * download and stitch tiles, convert to PDF; search for "OSM bigmap"
>for
>> different implementations.
>
>* use the "staticmap" script on openstreetmap.de like this:
>>
>http://staticmap.openstreetmap.de/staticmap.php?center=40,-50&zoom=2&size=
>> 500x350
>>
>> Both will only give you standard resolution raster images.
>
>
>As above, vector would be preferable.
>
>
>> You could
>> also try
>>
>> * https://maposmatic.osm-baustelle.de/ (a working fork of the
>> discontinued MapOsMatic project, does PDFs)
>>
>
>I'll see whether it's possible to generate maps of predefined areas or
>re-print maps (with the same boundaries). At least from the web UI, it
>doesn't look like it.
>
>
>> * http://printmaps-osm.de:8080/ (Europe only, quarterly data updates,
>> does PDFs in theory but currently only PNG works)
>>
>
>I'm outside Europe, and need up-to-date data.
>
>
>> or if you're on Windows or willing to use Mono, Maperitive can also
>> generate PDFs for any region using data from Overpass, and it's
>> scriptable (even headless).
>>
>
>OK, I'll have a look. However, it looks like it produces only SVG,
>which
>I'd then have to process.
>
>
>>
>> Of course, the canonical solution is "install your own
>> postgres/mapnik/nik4.py and run it locally" ;)
>>
>>
>Paul, why is the recommendation to produce PNG first?
>
>Thanks both for you input - much appreciated!!
>Bjoern
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20171222/458ed7f7/attachment-0001.html>


More information about the dev mailing list