Hi,
Please could an example of using GeometryMath.Clip be shared.
Specifically, I’d like to clip a linestring, to within a Buffer() from point, then find the Centroid() of that clipped geometry. I’d be happy for just Clip to be discussed here to keep it simple.
Thank You
// Previous query node for finding intersecting items to the buffer
{
"name": "IntersectingItemsGeoms",
"value": {
"inputParent": 1,
"itemValue": {
"attributeCode": "attributes_itemsGeometry",
"discriminator": "WorkflowSyntaxArgumentItemValueAttributeWebModel"
},
"discriminator": "WorkflowSyntaxNodeInputWebModel"
}
},
// .... Buffer ...
{
"name": "buffered_geometry_WGS84",
"value": {
"script": "var buffered_geometry_WGS84 = GeometryMath.ProjectToAlloyCrs(buffered_geometry_BNG,\"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs\"); return buffered_geometry_WGS84;",
"discriminator": "WorkflowSyntaxNodeScriptWebModel"
}
},
// My attempt at clipping and centroids
{
"name": "clipped_geometrys",
"value": {
"script": "return GeometryMath.Clip(Variables.buffered_geometry_WGS84.SingleValue , Variables.IntersectingItemsGeom.AllValues.Values.Select(x => x.SingleValue).ToArray());",
"discriminator": "WorkflowSyntaxNodeScriptWebModel"
}
},
{
"name": "centroids",
"value": {
"script": "var geom = (clipped_geometrys); return GeometryMath.Centroid(geom);",
"discriminator": "WorkflowSyntaxNodeScriptWebModel"
}
}