Question

I am trying to use the Mapnik C++ API to visualize KML data in my application. I can't see how to get the style information out of the OGR datasource into the map. In any case, I am a bit surprised that it does not Just Happen. So, two qeustions: 1. Am I trying to do something that is inherently not what Mapnik is supposed to do? 2. If it is possible, how?

Était-ce utile?

La solution

Yes, generally KML is a (overly?) complex format that is not well supported outside of Google products. OGR does have pretty remarkable support for handling some of the styling, but this is very edge case and not something Mapnik is going to know anything about. Mapnik treats data and styles as completely separate and uses stylesheets (see Mapnik XML, Cascadenik, and CartoCSS) to stitch together these ideas.

I've done a bit of work on converting KML into Mapnik stylesheets - you can find that work at https://github.com/springmeyer/kml-escape.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top