I have a polygon (pond) and I need to ensure it is at one elevation. I have converted all vertices of the polygon to points, used summary statistics to determine the range in elevations and if the range is greater than 0, it indicates there is a discrepancy in elevation values. I do not have spatial analyst or 3D analyst. Is there an easier way or code to do this in ArcGIS? I received this layer from a fellow employee that extracted the data from a LiDAR point cloud using MicroStation. Therefore, I do not have the original elevation (raster) layer, just a shapefile that has elevation values attached to the vertices. I am looking for a way to identify a polygon whose vertices have different elevation values. Each polygon should have one elevation value associated with each vertice. For example, Polygon A should have a 120m elevation value for each vertice in the polygon. I am looking for something to check if the vertices are different.
This works without SA or 3D
import arcpy, traceback, sys ##, numpy from arcpy import env env.overwriteOutput = True pntFile=arcpy.GetParameterAsText(0) rasters=arcpy.GetParameterAsText(1) rasters=rasters.split(';') theFields=arcpy.ListFields(pntFile) theFields=[x.name.lower() for x in theFields] result=arcpy.GetCount_management(pntFile) nF=int(result.getOutput(0)) p=arcpy.Point() try: def showPyMessage(): arcpy.AddMessage(str(time.ctime()) + " - " + message) arcpy.AddMessage('\n') for raster in rasters: desc=arcpy.Describe(raster) theFLD=raster.lower() arcpy.AddMessage("Sampling "+theFLD) if not(theFLD in theFields): arcpy.AddField_management(pntFile, theFLD, "FLOAT") arcpy.SetProgressor("step", "", 0, nF) with arcpy.da.UpdateCursor(pntFile,("SHAPE@XY",theFLD)) as rows: for row in rows: XY=row p.X,p.Y=XY myArray = arcpy.RasterToNumPyArray(raster,p,1,1,-9999) row=myArray[0,0] rows.updateRow(row) arcpy.SetProgressorPosition() del row,rows arcpy.AddMessage('\n') except NameError, theMessage: arcpy.AddMessage (theMessage) except: message = "\n*** PYTHON ERRORS *** "; showPyMessage() message = "Python Traceback Info: " + traceback.format_tb(sys.exc_info()); showPyMessage() message = "Python Error Info: " + str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"; showPyMessage()
Script works from mxd. Parameters are point layer (shapefile) and list of rasters: