0

I tried to create two contour lines with a relatively small difference (0.5meter) on a DEM dataset. For example, I created an 8-meter contour(the red one) and then created an 8.5-meter(the blue one) contour. Their shapefiles overlapped with each other at the place which should be the position of 8-meter contour. What's weirder is that I cannot select the 8.5-meter shapefile while I can select an invisible line of 8.5-meter beside its shapefile (highlighted blue line).

the 8-meter contour 8.5-meter contour

Here's the code I used to create these contours, I set the interval as 200 so it will only draw one line:

import arcpy

from arcpy import env

env.workspace = "D:\Arc GIS\"

arcpy.Contour_3d("Dem.tif","D:\Arc GIS\Dem,-8.shp", 200, -8)

arcpy.Contour_3d("Dem.tif","D:\Arc GIS\Dem,-8.5.shp",200, -8.5)
1

Your code should be like this (you defined contour_interval as 200):

according to ArcGIS:

Contour_3d (in_raster, out_polyline_features, contour_interval, {base_contour}, {z_factor})

import arcpy

from arcpy import env

env.workspace = "D:\Arc GIS\"

arcpy.Contour_3d("Dem.tif","D:\Arc GIS\Dem,-8.shp", -8, 0)

arcpy.Contour_3d("Dem.tif","D:\Arc GIS\Dem,-8.5.shp",-8.5, 0)
  • Thanks! I set interval as 200 intentionally because I just want to draw the contour at the elevation at 8. With such a big interval, no other contour will be drawn because it exceeds the band of my dem dataset. – Burson Apr 21 '18 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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