2

I have a problem with creating a new shapefile ( for Points) with a midpoints from Line shapefile.

I cannot use FeatureVerticesTo Points_management because I only have access to Basic and Standard level licenses of ArcGIS Desktop 10.5.1.

Is there another way to do this using ArcGIS Desktop tools or ArcPy functions?

6
  • You could write it in python, have a read of working with geometry objects.resources.arcgis.com/en/help/main/10.2/index.html#//… Commented Sep 11, 2019 at 5:28
  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Please check out our short tour to learn about our focussed Q&A format.
    – PolyGeo
    Commented Sep 11, 2019 at 5:35
  • 1
    Add xy fields, right click on a header, pick calculate geometry, mid point X etc.
    – FelixIP
    Commented Sep 11, 2019 at 6:03
  • And you are restricted to ArcGIS? Did you consider other approaches, like QGIS? Commented Sep 11, 2019 at 6:48
  • Unfortunately, in that case I am limited to the Arcmap and arcpy environment. Maybe if it could work as independent python script in Qgis (I don't know too much Qgis environment with python). But I prefer stay with Arcmap.
    – Agnes
    Commented Sep 11, 2019 at 8:41

2 Answers 2

3

Esri provides an How To: Create a start, midpoint, and/or endpoint feature class of a line with an ArcGIS for Desktop Basic or Standard license which describes:

how to create a start, midpoint, and/or endpoint feature class from the vertices of an existing line feature class. This can be useful when working with an ArcGIS for Desktop Basic (ArcView) or Standard (ArcEditor) license and the Feature Vertices to Points tool is unavailable.


ArcGIS Pro (I tested version 3.1.1) provides an easy way to do this by using the Generate Points Along Lines (Data Management) tool which:

Creates point features along lines or polygons at fixed intervals or by percentage of a feature's length.

Using a percentage of 50 and not including end points will create one point per line feature at its midpoint.

1
  • Absence of vertex is highly likely at mid point. Perhaps "..feature class from the vertices" is not completely correct.
    – FelixIP
    Commented Sep 11, 2019 at 6:08
1

In arcpy, use the positionAlongLine() function with a distance of 50 and use_percentage=True. See the documentation at:

http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/polyline.htm

You would need to use an arcpy.da.SearchCursor() for the line feature class, then for each line feature's geometry, run:

pointGeom = lineGeom.positionAlongLine(50, True)

Then convert the point geometry to a point feature and use an arcpy.da.InsertCursor()` to add it to your point feature class.

NB: The point you get returned will NOT be one of the vertices. It will genuinely be the half-way point along the line in terms of distance between the start and end points.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.