M value (Geometry)

11-21-2019 11:22 PM
New Contributor III

I have an attribute table for point shapefile. I want to assign column with name "Fix CoDe" to my M values. Now it shows "NaN". For Z value I could calculate it with "interpolate shape" tool, but for M values I could not find.

Is there the way to do it with tool,python or somehow? (amount of data is big)

The solutions can be with ArcMap 10.x or ArcGIS Pro, (python 3.6-spyder)

Thank you for your valuable time.

0 Kudos
2 Replies
MVP Esteemed Contributor

Point—ArcPy classes | ArcGIS Desktop 

Shows that the M attribute must be a number type (Double).

Do you have data of the appropriate type you want to assign to M?

0 Kudos
New Contributor III

Do you have data of the appropriate type you want to assign to M?

I have in my column of "FIX CODE" the numbers that start from 1000. These points come from navigation track line shots.  for example line A the first shot of GPS fix number 1000, second number 1001, line B first shot 1000,second shot 1001 and so. I have more than 1k lines and for each line more 10k points.

Should I use below-mentioned stand alone script? if yes, can you help with this if my shape name "A" and column name "W", the column contains the only number?

Thank you Dan.

import arcpy

# Create cursor to retrieve Hawaii shape feature_class = "c:/data/Hawaii.shp"

cursor = arcpy.da.SearchCursor(feature_class, ["SHAPE@"])

for row in cursor:

# Get the geometry object from the shape field

print("Number of Hawaiian islands: {0}".format(row[0].partCount))

# GetPart returns an array of point objects for each part.

for island in row[0].getPart():

print("Vertices in island: {0}".format(island.count))

for point in island: print("X: {0}, Y: {1})".format(point.X, point.Y))

0 Kudos