Giter VIP home page Giter VIP logo

Comments (3)

hholzgra avatar hholzgra commented on August 10, 2024 1

Actually every solution that uses the Mapnik library to render OSM data can generate any of the output formats supported by Mapnik easily for any map style. There is nothing output format specific in the map stylesheets themselves (although those that provide SVG point/marker symbols create better vector format quality results).

Mapnik again basically supports everything that either of the two underlying graphics libraries support. For the AGG render library that is just high quality PNG, for the Cairo Graphics render library backend that's various bitmap and vector formats.

PNG output from the Cairo Graphics backend is only slightly less good than the AGG output, usually the difference is barely noticeable, but it comes at the advantage that you can combine Mapnik output with your own graphics, e.g. when using the Mapnik Python bindings together with PyCairo. This is the approach that MapOSMatic uses to add things like the page title, the side index, the copyright annotations, and even some of the overlay styles that would not easily be possible with Mapnik, like the "Surveilance under Surveilance" overlay with its camera coverage arcs.

The orignal MapOSMatic developers chose to render PNG, PDF and SVGz. PostScript would also be possible, but it's rather obsolete these days. I chose to offer additional bitmap formats, but instead of having Mapnik render them I just let it render high quality 32bit PNG, and then use other external tools to convert that output into 8bit PNG and JPG formats.

One disadvantage of the Cairo Graphics based SVG output is that Cairo does not support grouping objects into InkScape-compatible layers. So the resulting SVG output is fine for actual on-screen or on-paper rendering, but it is not really suitable for using InkScape or other vector oriented graphics programs to post-edit the automatic render results.

There was a project to add direct/native SVG output as a third render backend to Mapnik, but this unfortunately never got finished. So taking the Cairo Graphics route is still the least worse approach to generating SVG from OSM data as of now ...

from maposmatic.

hholzgra avatar hholzgra commented on August 10, 2024

All three formats are rendered at the same time for the single page formats, only for the multi page layout there is only PDF output, as the other formats do not support multiple pages.

Check the result page after a render request has finished, e.g.:

https://print.get-map.org/maps/157696

and you'll see PNG, SVG (gzip-compressed) and PDF output, along with 8bit PNG and JPG created from the original PNG output, offered for download.

The background behind this is that rendering multiple times for different output format does not take that much extra time. So instead of adding an extra format selection step to the render form, we're just rendering all possible formats at once.

from maposmatic.

matkoniecz avatar matkoniecz commented on August 10, 2024

oh. I was confused how SVG maps are supposed to be generated from PNG, but I guess that it applies map style to a different process.

Added to https://wiki.openstreetmap.org/wiki/SVG#Ways_to_create_an_SVG_map_from_OpenStreetMap (so my program will be at beast first to generate SVG from OSM locally in web browser. Maybe with distinction of making relatively easy to setup own map styles. Congratulations on being first to offer SVG rendering from within browser!)

(technically one can download an SVG file directly from openstreetmap.org - but it is barely usable for most purposes)

from maposmatic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.