Skip to main content
edited title
Link
whuber
  • 70.2k
  • 16
  • 187
  • 282

Cloropeth Choropleth raster to polygons with values

Added more information about the code and input
Source Link

I'm trying to turn a PNG that looks like this to a shapefile with polygons that keep the categories marked by the colors on the map.

enter image description here

I have several maps to process, so manually tracing the polygons is not a valid option.

I tried to do this with arcpy.RasterToPolygon, butfrom here :

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.RasterToPolygon_conversion("zone", "c:/output/zones.shp", "NO_SIMPLIFY",
                                  "VALUE")

In this case "zone" is the input PNG, this layer is already georeferenced to its actual location. zones.shp is the filename where I want to store the new features.

I get the following error:

Runtime error  Traceback (most recent call last):   
File "<string>", line 5, in <module>   
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\conversion.py", line 337, in RasterToPolygon     
raise e ExecuteError: ERROR 010151: No features found in c:\gis\output\control_test.shp. 
Possible empty feature class. Failed to execute (RasterToPolygon).

Is it possible to fix this error or to use another function to get to my goal?

I have the original PNG as an SVG with vector drawn polygons if that helps.

I'm trying to turn a PNG that looks like this to a shapefile with polygons that keep the categories marked by the colors on the map.

enter image description here

I have several maps to process, so manually tracing the polygons is not a valid option.

I tried to do this with arcpy.RasterToPolygon, but I get the following error:

Runtime error  Traceback (most recent call last):   
File "<string>", line 5, in <module>   
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\conversion.py", line 337, in RasterToPolygon     
raise e ExecuteError: ERROR 010151: No features found in c:\gis\output\control_test.shp. 
Possible empty feature class. Failed to execute (RasterToPolygon).

Is it possible to fix this error or to use another function to get to my goal?

I have the original PNG as an SVG with vector drawn polygons if that helps.

I'm trying to turn a PNG that looks like this to a shapefile with polygons that keep the categories marked by the colors on the map.

enter image description here

I have several maps to process, so manually tracing the polygons is not a valid option.

I tried to do this with arcpy.RasterToPolygon, from here :

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.RasterToPolygon_conversion("zone", "c:/output/zones.shp", "NO_SIMPLIFY",
                                  "VALUE")

In this case "zone" is the input PNG, this layer is already georeferenced to its actual location. zones.shp is the filename where I want to store the new features.

I get the following error:

Runtime error  Traceback (most recent call last):   
File "<string>", line 5, in <module>   
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\conversion.py", line 337, in RasterToPolygon     
raise e ExecuteError: ERROR 010151: No features found in c:\gis\output\control_test.shp. 
Possible empty feature class. Failed to execute (RasterToPolygon).

Is it possible to fix this error or to use another function to get to my goal?

I have the original PNG as an SVG with vector drawn polygons if that helps.

clarified which arcpy function they were using, added arcpy tag because that is technology they are using
Source Link
Paul
  • 11.6k
  • 1
  • 30
  • 47

I'm trying to turn a PNG that looks like this to a shapefile with polygons that keep the categories marked by the colors on the map.

enter image description here

I have several maps to process, so manually tracing the polygons is not a valid option.

I tried to do this with arcpy.RasterToPolygon, but I get the following error:

Runtime error  Traceback (most recent call last):    
File "<string>", line 5, in <module>    
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\conversion.py", line 337, in RasterToPolygon      
raise e ExecuteError: ERROR 010151: No features found in c:\gis\output\control_test.shp.  
Possible empty feature class. Failed to execute (RasterToPolygon).

Is it possible to fix this error or to use another function to get to my goal?

I have the original PNG as an SVG with vector drawn polygons if that helps.

I'm trying to turn a PNG that looks like this to a shapefile with polygons that keep the categories marked by the colors on the map.

enter image description here

I have several maps to process, so manually tracing the polygons is not a valid option.

I tried to do this with arcpy.RasterToPolygon, but I get the following error:

Runtime error  Traceback (most recent call last):   File "<string>", line 5, in <module>   File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\conversion.py", line 337, in RasterToPolygon     raise e ExecuteError: ERROR 010151: No features found in c:\gis\output\control_test.shp. Possible empty feature class. Failed to execute (RasterToPolygon).

Is it possible to fix this error or to use another function to get to my goal?

I have the original PNG as an SVG with vector drawn polygons if that helps.

I'm trying to turn a PNG that looks like this to a shapefile with polygons that keep the categories marked by the colors on the map.

enter image description here

I have several maps to process, so manually tracing the polygons is not a valid option.

I tried to do this with arcpy.RasterToPolygon, but I get the following error:

Runtime error  Traceback (most recent call last):    
File "<string>", line 5, in <module>    
File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\conversion.py", line 337, in RasterToPolygon      
raise e ExecuteError: ERROR 010151: No features found in c:\gis\output\control_test.shp.  
Possible empty feature class. Failed to execute (RasterToPolygon).

Is it possible to fix this error or to use another function to get to my goal?

I have the original PNG as an SVG with vector drawn polygons if that helps.

clarified which arcpy function they were using, added arcpy tag because that is technology they are using
Source Link
Loading
Source Link
Loading