Skip to content

Commit

Permalink
Replaced instances of 3D Analyst with equivalent Spatial Analyst func…
Browse files Browse the repository at this point in the history
…tions (#96)

Co-authored-by: ajflink001 <[email protected]>

Great! Thank you for looking into this. Let's try it.
  • Loading branch information
vlatane-va-energy authored Jan 11, 2024
1 parent 74e2da6 commit c282dc7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Scripts/GeMS_ProjectCrossSectionData.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def locateEventTable(

if not desc.hasZ:
addMsgAndPrint(" adding Z values")
arcpy.AddSurfaceInformation_3d(pts, dem, zType, "LINEAR")
arcpy.da.AddSurfaceInformation(pts, dem, zType, "LINEAR")

## working around bug in LocateFeaturesAlongRoutes
# add special field for duplicate detection
Expand Down Expand Up @@ -303,9 +303,9 @@ def locateEventTable(
arcpy.env.overwriteOutput = True

try:
arcpy.CheckOutExtension("3D")
arcpy.CheckOutExtension("Spatial")
except:
addMsgAndPrint("\nCannot check out 3D-analyst extension.")
addMsgAndPrint("\nCannot check out Spatial Analyst extension.")
sys.exit()

## Checking section line
Expand Down Expand Up @@ -367,7 +367,7 @@ def locateEventTable(
# Add Z values
addMsgAndPrint(" getting elevation values for " + shortName(tempXsLine))
Zline = arcpy.CreateScratchName("xx", outFdsTag + "_Z", "FeatureClass", scratch)
arcpy.InterpolateShape_3d(dem, tempXsLine, Zline)
arcpy.da.InterpolateShape(dem, tempXsLine, Zline)
# Add M values
addMsgAndPrint(" measuring " + shortName(Zline))
ZMline = arcpy.CreateScratchName("xx", outFdsTag + "_ZM", "FeatureClass", scratch)
Expand Down Expand Up @@ -679,7 +679,7 @@ def locateEventTable(
testAndDelete(f)
del inRows, outRows

arcpy.CheckInExtension("3D")
arcpy.CheckInExtension("Spatial")
if not saveIntermediate:
addMsgAndPrint("\n Deleting intermediate data sets")
for fc in tempXsLine, ZMline, Zline, tempBuffer:
Expand Down

0 comments on commit c282dc7

Please sign in to comment.