Is it possible to convert a raster hosted on arcgis rest to a polygon feature dataset?

190
4
04-12-2019 09:01 AM
VincentLantaca1
New Contributor III

I have a raster layer hosted on some arcgis rest service, let's say it's https://domain.com/arcgis/rest/services/rasters/Heatmap/MapServer/0

Is there a way to convert this to a polygon feature layer using arcpy?

I have tried the following:

import arcpy

inRaster = r"https://domain.com/arcgis/rest/services/rasters/Heatmap/MapServer"
inField = 'Value'
outType = 'POLYGON'
simplify = 'SIMPLIFY'
outPolygons = r"C:\test\output.shp"
arcpy.ConvertRasterToFeature_ra(inRaster, inField, outType, simplify, outPolygons)

and

import arcpy
from arcpy import env
from arcpy.sa import *

url = r"https://domain.com/arcgis/rest/services/rasters/Heatmap/MapServer/0"
inRaster = Raster(url)
outPolygons = r"C:\test\output.shp"
field = "VALUE"
arcpy.RasterToPolygon_conversion(inRaster, outPolygons, "NO_SIMPLIFY", field)

I always get errors:

RuntimeError: ERROR 000732: Input Raster: Dataset https://domain.com/arcgis/rest/services/rasters/Heatmap/MapServer/0 does not exist or is not supported

I know it does exist, because it shows up fine when I try to view the map service in ArcMap

0 Kudos
4 Replies
SteveLynch
Esri Regular Contributor

is the raster floating point or integer?

0 Kudos
VincentLantaca1
New Contributor III

The raster is floating point

0 Kudos
SteveLynch
Esri Regular Contributor

have a look at the first usage tip in RasterToPolygon's help

0 Kudos
VincentLantaca1
New Contributor III

Is there no way to do conversions in arcpy for floating point raster layers?

0 Kudos