Select to view content in your preferred language

How to create contours from a DEM image service

171
5
3 weeks ago
Labels (2)
berniejconnors
Frequent Contributor

Hello, We are publishing a bare earth DEM with a 1 metre pixel as an image service.  Currently running ArcGIS Server 10.7.1.  I want to automate the process to assist my users in creating contours from the DEM  image service.  The process would begin with the user selecting a polygon from our parcel map service and end with the user downloading a vector data set of contour lines with an extent that matches the parcel's bounding box.

We have already done something similar to allow our users to grab a small patch of the DEM raster that matches the bounding box of a parcel.  We did that with a bit of Arcade to build a URL for the image service that exported a small patch of the DEM raster.  The Arcade script lives in a pop-up window in an AGOL web map.

Any suggestions?  You can find our DEM image service here - https://geonb.snb.ca/image/rest/services/Elevation/DEM_Raw_MNE_Brut/ImageServer

Thanks,

Bernie.

0 Kudos
5 Replies
ThomasHoman
Frequent Contributor

Hello,

Since you already have the ability to extract a small piece of the DEM, you could push that into a piece of Python that generates the contours via 3DAnalyst Contour tool - https://pro.arcgis.com/en/pro-app/latest/tool-reference/3d-analyst/contour.htm and returns the data to the user as a gdb. This, of course, is predicated on have the 3DAnalyst tools licensed on the machine doing the work.

An alternative to the 3DAnalyst extension licensure can be accomplished with the python GDAL library. https://hatarilabs.com/ih-en/how-to-convert-a-raster-to-contours-with-python-and-gdal-tutorial 

A third option would be to preprocess the DEM to a few expected contour intervals and then allow the user to extract the data much like you already have with DEM AOI tool. This would avoid the resource overhead of the DEM to contour processing.

Regards,

Tom

berniejconnors
Frequent Contributor

@ThomasHoman Thanks for the tips.  But I was also wondering about a raster function that could be executed by the image server to create contours as a raster image.  Any advice on this topic.  Our Image Server is running version 10.7.1.  Is there a raster function built-in for generating contours at version 10.7.1 or does it need to be configured?

Bernie.

0 Kudos
ThomasHoman
Frequent Contributor

There is no a raster function to create contours. The 3DAnalyst tool takes the DEM surface then starts mathematically building the contour linework by following the desired elevation line that is a nonraster data type.

0 Kudos
berniejconnors
Frequent Contributor

@ThomasHoman According to this blog there was a raster function for contours at 10.2.1

https://www.esri.com/arcgis-blog/products/arcgis-desktop/mapping/generate-contours-dynamically-with-...

Do you think Esri removed it so we would have to use an extension?

Bernie.

0 Kudos
ThomasHoman
Frequent Contributor

That would be a fair assumption. More likely, as they developed the tool with advanced math it made sense to move into an extension.

0 Kudos