As of 2.0.x, specifying marker-placement:line for point input would still place markers over points. With 2.1 the marker is not placed anymore.
Here's an example XML file to see the problem:
<Map srs="+init=epsg:3857" maximum-extent="-20037508.34,-20037508.34,20037508.34,20037508.34">
<Style name="carto_tests" filter-mode="first" >
<!-- this works both in 2.0 and 2.1 -->
<!-- MarkersSymbolizer placement="point" / -->
<!-- this only works in 2.0 -->
<MarkersSymbolizer placement="line" />
<Layer name="carto_tests" srs="+init=epsg:3857">
<Parameter name="table"><![CDATA[(SELECT 'POINT(0 0)'::geometry as the_geom) as cdbq]]></Parameter>
thanks for the report. I'll take a look. I think I recall some hacky custom handling for this in older mapnik. It may be that with that removed the markers placement algorithms simply return early on points, since using line placement on points is not a common case.
where can I find that algorithm?
I presume that right here no points are being returned which means that this is returning without placing - which is not at all a surprise because this code is designed for placing multiple markers along a linear geometry and is not designed to handle point geometries.
I guess we should make it so that "placement" is a POINT placement, rather than pretending a POINT is a line and handling it as such, right ?
I'm not sure about the right solution - I'd need more time than I have this week to dig into it. What I do know is that in Mapnik we are moving towards enabling more types of geometry transformations and therefore in fewer cases can the code actually ask for the geometry type (and if it could, it would only be the original geometry type). So, while it may not be the specific issue here, I can see geometries that are originally lines perhaps ending up as points (with transformations). Whether these should be thrown out, or algorithms like the markers_placement should be made to handle points, needs a closer look.
Another thing I found is that in 2.0 you would get an ellipse rather than an arrow when the input is a point, even if you specify marker-type:arrow
I would like to try basing the conditional on the original geometry type.
Will try it against a small testsuite we setup (~200 style runs comparing 2.0 and 2.1) and let you know.
oh, one question: how do I test if the problem also persists with cairo renderer ?
Here's a quick & dirty patch for AGG only, using original type and badly copying the marker_placement object for the sake of changing within the AGG code. It looks promising against the tests we have (but is dirty):
I run the testsuite but got no failure:
Ran 475 tests in 5.494s
It means there are no tests for this case. Kind of good as there's less work of adapting the expectances, no ? :)
close #1548 with explict handling of point geometries and amend 629d768…
… for cairo/grid renderers to ensure proper placement on lines (refs #1604,#1350,#1607)
Any chance to see this backported to 2.1.x ?
Fix line placement of markers on points (#1548)