0

A raster(.tif) of 6.70GB needs to be converted into polygons. The raster is binary (0 & 1), currently I am using Polygonize (raster to vector) and its taking a considerable amount of time and the process is stuck again on 90%.

Extent  -74244.9795000000012806,3891970.0844999998807907 : 1167923.9135000000242144,4874856.8579000001773238
Width   47702
Height  37745
Data type   Float32 - Thirty two bit floating point
GDAL Driver Description GTiff
GDAL Driver Metadata    GeoTIFF
Dataset Description G:/Joost/selection/used in analysis/output_run2.tif
Compression 
Band 1  
STATISTICS_APPROXIMATE=YES
STATISTICS_MAXIMUM=1
STATISTICS_MEAN=0.2984387140037
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=0.45757299744142
STATISTICS_VALID_PERCENT=40.02
More information    
AREA_OR_POINT=Area
Dimensions  X: 47702 Y: 37745 Bands: 1
Origin  -74245,4.87486e+06
Pixel Size  26.04018475116347275,-26.04018475029806012
5
  • how did you prepare your raster? compression, tiliing etc?
    – Ian Turton
    Commented May 19, 2022 at 14:29
  • I used r.reclass to create a binary map
    – N_LLC
    Commented May 19, 2022 at 14:30
  • You need to edit your question to give us more details - size in pixels for example, gdalinfo output etc
    – Ian Turton
    Commented May 19, 2022 at 14:48
  • Have you tried converting to contour lines, putting in some manual work to close open lines at the border and then converting the lines to polygons?
    – Erik
    Commented May 19, 2022 at 14:56
  • 1
    If the underlying raster data is binary, I recommend you reclassify as an integer data type instead of 32 bit float before attempting to polygonize.
    – Lance
    Commented May 19, 2022 at 18:09

1 Answer 1

2

I would point out the a 47000 x 37000 pixel raster contains 1.7 billion pixels. If your binary raster is mostly "salt and pepper" (1's and 0's not clustered into contiguous areas) then you are trying to create a vector of over a billion tiny polygons. That will be very slow.

i.e. imagine a checker-board pattern of 47700 columns and 37700 rows. Converting that raster pattern to a polygon vector would require 1.7 billion polygons - a very challenging procedure.

Can you explain what you are trying to do? (not how you are trying to do it). Why do you say "raster(.tif) of 6.70GB needs to be converted into polygons."?? Why? Maybe there is some other method?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.