3

Do you know if there is a small library (preferably in python or java) around that allows the creation of static maps? Something where you can specific the URL of your TMS server, width and height in pixel, and a simple geometry (point or linestring) to be drawn on top?

I found staticmaplite in the OSM wiki which is acutally a very good starting point, but we do not support php in our stack.

Do you know any other projects in python / java that are available. Otherwise I will consider creating a clone of staticmaplite in python. But it would be better to build on something already available.

2
  • Are Leaflet or OpenLayers (both JavaScript) an option?
    – scai
    Aug 11, 2015 at 18:24
  • That would be a natural choice, but since I plan to use it also for Facebook previews I need a real image.
    – linqu
    Aug 11, 2015 at 21:08

2 Answers 2

4

If your interested in using a microservice that you can run yourself, instead of a library check out https://github.com/trailbehind/StaticMapService/. You can install background layers into it, then post GeoJSON and get back map images. You mentioned facebook preview images, and that's exactly what I wrote it for. The image url points at a public web server, which requests the map images from the map renderer running on a private network, and caches the images.

1
  • 2
    Great service @jesse-crocker ! If your answer would have reached me earlier I would not have started building a small library by my own: github.com/komoot/staticmap
    – linqu
    Aug 24, 2015 at 17:07
2

In the meantime I created a small python-based library that can create simple static images. You can find it on github: https://github.com/komoot/staticmap

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.