# CreatePointAlong is not working

919
7
02-18-2019 10:59 PM
New Contributor II

Hi Team,

My requirement is to add points at specific distance on a polyline. In Order to achieve this I have a poly line of 26 Kms length, So i used CreatePointAlong method to add points on poly line for each 2 Kms distance, but it's adding the point always at the starting point. Here i'm attaching the screen shots. Is there any way to achieve my requirement? please suggest.

1 Solution

Accepted Solutions
Esri Contributor

I think this will do the trick.

7 Replies
by
Regular Contributor II
arcpy.GeneratePointsAlongLines_management(in_features, out_fc_1, 'DISTANCE',
Distance='500 meters',Include_End_Points='NO_END_POINTS' )

Should be the Default....however,

Output_Feature_Class, Point_Placement, {Distance}, {Percentage}, {Include_End_Points})
 Parameter Explanation Data Type Input_Features The line or polygon features to be converted into points. Feature Layer Output_Feature_Class The point feature class that will be created from the input features. Feature Class Point_Placement The method to use to create points.PERCENTAGE —The tool will use the Percentage parameter to place points along the features by percentage.DISTANCE —The tool will use the Distance parameter to place points at fixed distances along the features. This is the default. String Distance(Optional) The interval from the beginning of the feature at which points will be placed. Linear Unit Percentage(Optional) The percentage from the beginning of the feature at which points will be placed. For example, if a percentage of 40 is used, points will be placed at 40 percent and 80 percent of the feature's distance. Double Include_End_Points(Optional) Specifies whether additional points are placed at the start point and end point of the feature.END_POINTS —Additional points will be added at the start point and end point of the feature.NO_END_POINTS —No additional points will be added at the start point and end point of the feature. This is the default.
New Contributor II

Thanks for the response Ted Kowal,

My application environment is .net using C# programming.Can we achieve the same above  in c# programming?

For your information I'm extracting the poly lines from a shape file by creating a feature layer. is there any problem with my code? please help

by
Regular Contributor II

I do not program using  ArcgisRuntime but use ArcObjects (VB.Net Programmer).  Given my lack of familiarity with Arcgisruntime and C#  looking at you code snippet... it appears to be fundamentally correct in setting up the symbology.  However you are only simply displaying the shapefile line work?  I am assuming that arcgis runtime has access to the the generatepointsalonglines toolbox.

New Contributor II

Thank you for the response Ted Kowal, Yes I'm just displaying the poly lines as they are from Shape file to the map and then i'm trying to process them.

I didn't find any method named with generatepointsalonglines in ArcGIS Runtime SDK for .NET - Toolkit.

Regards,

Naresh Kumar K.

by
Regular Contributor II

Again, I do not know if runtime supports the running of this toolbox tool ....

I did find this example which may assist in generating points along a line ... Densify and generalize—ArcGIS Runtime SDK for .NET Samples | ArcGIS for Developers

Additionally you can use Create Point along Line and loop through the distances you desire.  GeometryEngine.CreatePointAlong Method

Esri Frequent Contributor

Hi,

GeneratePointsAlongLines is a geoprocessing tool not currently supported by the ArcGIS Runtime Local Server component. For the list of supported tools see Local Server geoprocessing tools support—ArcGIS Runtime SDK for .NET | ArcGIS for Developers.

In the context of geoprocessing and Local Server, consider using Densify (Densify—Help | ArcGIS Desktop).

Within the ArcGIS Runtime API, you could also look at GeometryEngine.Densify (GeometryEngine.Densify Method).

Cheers

Mike

Esri Contributor