node-mapnik-sample-code
node-mapnik-sample-code copied to clipboard
In-memory data source for non-point geometries
Is there an example of an in-memory data source with non-point geometries? I couldn't find any. Is this even possible? I noticed from the code that there are plans to support WKT format, but it's not yet implemented.
On the other side, since standard Datasource objects always read data from file, is there a work-around for injecting non-point geometries into Mapnik programmatically?
Yes, see https://github.com/mapnik/node-mapnik/issues/779 and also https://github.com/mapnik/node-mapnik/issues/779
Is there an example for using this inline geojson string?
Yes, sorry one of the links above was meant to be to https://github.com/mapnik/python-mapnik/issues/126#issuecomment-326819222. There you can see a link other code which offers an example.
Thanks a lot! I'll have a look
Inlining GeoJSON works perfectly, and in my experiment runs >10x faster than via the OGR plugin. Thanks a lot for the insight!
Any similar solution for rasters? Is it possible in general to create a Mapnik.Datasource
with an arbitrary type
and suitable inline
fields?