<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ArcPy + DEM file(s) -&amp;gt; Image Service -&amp;gt; ElevationLayer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-dem-file-s-gt-image-service-gt/m-p/1412572#M70404</link>
    <description>&lt;P&gt;I am using ArcPy 10.8, a standalone ArcGIS Server 10.8.1, and ArcGIS JS (with map and scene view ...).&lt;/P&gt;&lt;P&gt;In JS, I am trying to add an ElevationLayer to map using an Image Service like this:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;By creating an .sd file from my ArcPy script that reads in DEM files and add them to a mosaic dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently the .sd file is successfully created and Image Service is published to my ArcGIS Server. However it shows nothing when I go to the server manager and click on this service and try to look at it in&amp;nbsp;ArcGIS Online Map Viewer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created this service from a single DEM .tif file (TDF_N49E120_01_DEM.tif). To test this service again I added both to Ground in Elevation Surfaces in ArcGIS Pro (shown in the 2 screenshots). By enabling the tif file and disabling the service, the elevation is shown correctly as a rectangular block. But enabling the service and disabling the tif file makes the ground in that region turn into a rectangular hole.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From some research, I think this problem is with my ArcPy script and that it only specified the horizontal coordinate system (WGS84) but not the vertical one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Create a mosaic dataset from a folder of images
try:
    print('Creating gdb\n')
    arcpy.CreateFileGDB_management(workspacePath, GDBName)

    print('Creating a new empty mosic dataset in geodatabase')
    arcpy.CreateMosaicDataset_management(GDBPath, Name, SrsLookup['WGS84'], 1, "32_BIT_FLOAT")

    print('Adding images to mosaic dataset')
    arcpy.AddRastersToMosaicDataset_management(MosaicDatasetPath, "Raster Dataset", inputFolderPath)
    
    print('Messages after attempting to create the mosaic dataset:')
    print(arcpy.GetMessages() + "\n")
except:
	sys.exit("Failed in authoring a mosaic dataset\n")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Apr 2024 22:59:09 GMT</pubDate>
    <dc:creator>oookokkookookk</dc:creator>
    <dc:date>2024-04-21T22:59:09Z</dc:date>
    <item>
      <title>ArcPy + DEM file(s) -&gt; Image Service -&gt; ElevationLayer</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-dem-file-s-gt-image-service-gt/m-p/1412572#M70404</link>
      <description>&lt;P&gt;I am using ArcPy 10.8, a standalone ArcGIS Server 10.8.1, and ArcGIS JS (with map and scene view ...).&lt;/P&gt;&lt;P&gt;In JS, I am trying to add an ElevationLayer to map using an Image Service like this:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ElevationLayer.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;By creating an .sd file from my ArcPy script that reads in DEM files and add them to a mosaic dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently the .sd file is successfully created and Image Service is published to my ArcGIS Server. However it shows nothing when I go to the server manager and click on this service and try to look at it in&amp;nbsp;ArcGIS Online Map Viewer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created this service from a single DEM .tif file (TDF_N49E120_01_DEM.tif). To test this service again I added both to Ground in Elevation Surfaces in ArcGIS Pro (shown in the 2 screenshots). By enabling the tif file and disabling the service, the elevation is shown correctly as a rectangular block. But enabling the service and disabling the tif file makes the ground in that region turn into a rectangular hole.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From some research, I think this problem is with my ArcPy script and that it only specified the horizontal coordinate system (WGS84) but not the vertical one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Create a mosaic dataset from a folder of images
try:
    print('Creating gdb\n')
    arcpy.CreateFileGDB_management(workspacePath, GDBName)

    print('Creating a new empty mosic dataset in geodatabase')
    arcpy.CreateMosaicDataset_management(GDBPath, Name, SrsLookup['WGS84'], 1, "32_BIT_FLOAT")

    print('Adding images to mosaic dataset')
    arcpy.AddRastersToMosaicDataset_management(MosaicDatasetPath, "Raster Dataset", inputFolderPath)
    
    print('Messages after attempting to create the mosaic dataset:')
    print(arcpy.GetMessages() + "\n")
except:
	sys.exit("Failed in authoring a mosaic dataset\n")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Apr 2024 22:59:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-dem-file-s-gt-image-service-gt/m-p/1412572#M70404</guid>
      <dc:creator>oookokkookookk</dc:creator>
      <dc:date>2024-04-21T22:59:09Z</dc:date>
    </item>
  </channel>
</rss>

