Planarize polylines

1289
5
02-13-2019 01:48 AM
VEERAMALLAYYA
New Contributor

We have achieved splitting of multiple ploylines(from.shape file) at intersections using planarize tool in ArcGIS pro desktop environment. Currently we are developing a WPF application using ArcGIS Runtime sdk for .Net (version 100.4.0). Is there any way to achieve the same(Planarize) using Runtime SDK or suggest any other way to split the multiple ploylines at intersections. Please assist.

Thanks.

5 Replies
dotMorten_esri
Esri Notable Contributor

There's no "Planarize" functionality out of the box, but the GeometryEngine provides lots of operations for you to tie together and build a tool that could do something like that.

These operations might be handy for this:

GeometryEngine.Cut Method 

GeometryEngine.Reshape Method 

GeometryEngine.Extend Method 

VEERAMALLAYYA
New Contributor

Thank you very much, have been working with your suggestions. Could you please also let us know how to generate points along a ployline with equal distance of 2 kilometers each? Thanks in advance.

0 Kudos
ThadTilton
Esri Contributor

Hey Veera -

To create points at a specified interval along a polyline:

 - Start with `GeometryEngine.Densify(inputLine, distance)` to create segments at the desired distance.

 - Read the output polyline segments (`Parts`) and get the points that define them.

Something like this:

// Use GeometryEngine.Densify to get a new Polyline split at the interval provided.
// Note: the distance is assumed to be the same units as the input Polyline!
Polyline splitPolyline = (Polyline)GeometryEngine.Densify(originalPolyline, 2000);

// Create a Multipoint object from the points that make up the segments.
Multipoint splitMultipoint = new Multipoint(splitPolyline.Parts.SelectMany(m => m.Points));

// If you need to access individual points, you can get a collection from the Multipoint.
ReadOnlyPointCollection splitPoints = splitMultipoint.Points;

 

There's a sample that illustrates using `Densify` here: Densify and generalize—ArcGIS Runtime SDK for .NET Samples | ArcGIS for Developers

Hope that helps! 

Naresh_KumarK
New Contributor II

Thanks for the quick response Thad Tilton,

I tried Densify  => new points are created along the poly line after densify, but it returns the output was not as expected. I have one poly line with distance of over 26 kms with 17 points. after densify it with 100 m distance nothing happens still it's having 17 points. I'm attaching the screenshot here.

how to get the points only which were located for every 2 kms on a poly line? Thanks in advance.

0 Kudos
ThadTilton
Esri Contributor

Linking to my reply in another thread to show another way to achieve this: https://community.esri.com/message/832713-re-create-points-at-equal-distance-along-a-polyline?commen...  

0 Kudos