Select to view content in your preferred language

Raster to Polygon, enable none Integer transfers

720
4
03-13-2024 04:50 AM
Status: Open
Labels (1)
WalkerKB
Occasional Contributor

TLDR: Enable Raster to Polygon Tool to use non-Integer-based rasters.

Currently to make a polygon from a raster, the raster needs to be an integer.  This means that I have to multiple the raster by 1000 (or a million) with an INT output, convert to polygon, then divide by 1000 (or a million) to get back to what I want.  I propose that the Raster to Polygon tool be reworked to enable converting all rasters directly to Polygon.  If the developers want to make it even more applicable, they could add in a "Rounding" option where the user could round to the nearest X prior to conversion.

4 Comments
DuncanHornby

Your idea is unlikely to get traction. A float raster is typically some sort of surface where every pixel has a different value. Yes you might get areas where there are clusters of pixels with the same value but I would imagine that is an exception rather than a rule. So taking an elevation raster I have at hand it has 6558 cols by 12150 rows. That could very easily end up outputting a polygon dataset with 79,679,700 polygons!  Start messing around with lidar derived data and you could end up with billions of polygons.

 

WalkerKB

Hi Duncan, thank you for your comment. I hear you that it can make for quite a number of polygons. I’m just not sure that the tool should prevent people from doing that. The same logic applies to changing the resolution of a raster from say 90 m to 30 cm. That would result in a supremely gigantic raster and yet there is nothing built into the tool to prevent people from doing that. I for one need to do it because I have flood depth rasters that I need to interact with road segments for use in network analyst. Given that I don’t want my computer to process forever, I extract the flood rasters only where they cross the road network. But then I need to go through the process I outlined to my original post. I understand this can create large numbers of polygons, but that should be a choice of the end user, no?

DuncanHornby

Whilst ESRI ruminate on this idea, are you aware of whitebox tools?

They have a tool that does exactly what you want RasterToVectorPolygons that will take a float raster.

Its free and has been exposed as a geoprocessing toolbox which you can download here.

You will be forced to accept it's limitations, for example it takes a tif as input and outputs shapefile, which are known to have size limitations.  I tested on a small section of a DEM which is float32

DuncanHornby_0-1710410596052.png

 

The result is:

DuncanHornby_1-1710410657627.png

I tried it on a larger section of DEM and it seemed to lock up but that was probably me being impatient. You might find if you have to process large rasters your existing work flow whilst irritating may be the fastest approach?

 

jackysins

This suggestion would greatly streamline the process of converting rasters to polygons. Implementing a rounding find lost children option would enhance its flexibility. Hopefully, the developers consider integrating these features into the Raster to Polygon tool.