Zverik / Nik4

Mapnik to image export
Do What The F*ck You Want To Public License
123 stars 23 forks source link

add-layers feature not working #27

Closed Klaus-Tockloth closed 6 years ago

Klaus-Tockloth commented 7 years ago

It seems that the --add-layers option isn't working in Nik4 1.6.

In the xml file I have this:

<Layer name="printmaps_point" status="off" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
    <StyleName>printmaps_point</StyleName>
    <Datasource>
       <Parameter name="type">ogr</Parameter>
       <Parameter name="file">${point_file:no_default}</Parameter>
       <Parameter name="layer">${point_layer:no_default}</Parameter>
    </Datasource>
</Layer>

But the layer isn't activated with this program call:

nik4.py --add-layers printmaps_point --zoom 15 ...

scale=4.70980476192
scale_factor=1.01433296582
size=2173,2173
bbox=Box2d(833675.160253,6787056.39383,843909.566001,6797290.79957)
bbox_wgs84=Box2d(7.48903138446,51.9276621344,7.58096861553,51.9843199662)
layers=coast-poly,waterarea,buildings,highways

PS: Everything works fine if I activate (status="on") the layer direct in the xml file.

Regards Klaus

Edit / additional info: I'm using Mapnik 3.0.9.

dooley commented 6 years ago

@Klaus-Tockloth, did you find any solution? Same problem here.

dooley commented 6 years ago

Seems that functionality does not work, because the maintainers of mapnik decide not to use libxml2 anymore.

Our workaround: Removing all status=off from the xml and use --layers a,b,c instead --add-layers. Working this way, you have to define ANY layer you would like to see. Layers not defined in that list are not processed.

Klaus-Tockloth commented 6 years ago

My solution was to add layers by a (programmatic) preprocessing step.

Zverik commented 6 years ago

Looks like the explanation is in #28. I'll see what I can do.