[MapServer-users] Mapscript access to ShapeObj of GeomTransform operation

Seth G sethg at geographika.co.uk
Mon May 20 02:48:26 PDT 2024


Hi Nicol,

The setGeomTransform method simply sets the string expression for the layer - no changes to the geometries occur until rendering (with the draw function), and temporary shapes are created and rendered. 

If you need to access transformed geometries you'd need to loop through the shapes and use methods on the shapeObj, e.g. https://mapserver.org/mapscript/mapscript-api/stub/mapscript.shapeObj.html#mapscript.shapeObj.simplify

The relatively new centerline transformation however is not part of the MapScript API. It could be added (and would be a nice addition).

Seth

--
web:https://geographika.net & https://mapserverstudio.net
twitter: @geographika

On Sun, May 19, 2024, at 7:05 PM, Nicol Hermann via MapServer-users wrote:
> Hallo all,
>
> I'am using Python MapScript to perform a GeomTransform centerline
> operation.
> The corresponding line looks like this:
> layerObj.setGeomTransform( "simplify((centerline([shape])), 100)" )
>
> How do I get access to the calculated shapeObj of the centerline?
> The feature count of
> layerObj.numitems
> is 0 even if the underlaying data layer has two features.
>
> Interestingly with map.draw() everything look like expected
>
> Thanks for any pointers
> Nicol
>
> _______________________________________________
> MapServer-users mailing list
> MapServer-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list