Skip to main content

All Questions

Tagged with
1 vote
1 answer
119 views

Fastest way to clip millions of small polygons and storing results as JSON [closed]

I have a dataset with couple million farm polygons (around 2.5 million and only expected to grow in the future), and I need to calculate the NDVI for these farm polygons, with some basic stats (...
Hasan Mustafa's user avatar
4 votes
1 answer
634 views

Vectorizing all pixels as separate polygons using rasterio

I use rasterio.features.shapes and use the geometry of pixels in raster data to create polygons for each pixel. Pixels with the same value merge these pixels if they are adjacent. What I want is for ...
geomaticpoly's user avatar
2 votes
1 answer
2k views

Extracting raster outline to a vector geometry

I have a raster data set with an irregular outline (every value outside is NaN) in Python (loaded from rasterio v.1.3a3 ): I'd like to extract its outline to a vector shape, such as a Shapely ...
swiss_knight's user avatar
  • 10.5k
8 votes
1 answer
614 views

Creating a seamless vector dataset from raster with gdal, R or Python

I'm trying to create a seamless vector dataset from an integer raster. "Seamless" as in: not gaps between features and no overlapping features. The tools gdal_polygonize, pkpolygonize, terra:...
Ratnanil's user avatar
  • 1,003
0 votes
2 answers
601 views

How to polygonize NDVI raster using GDAL?

I have raster with NDVI values. I would like to polygonize the raster to get vector where each polygon is a pixel. I have tried gdal.Polygonize as described in the documentation and that runs without ...
ReutKeller's user avatar
  • 2,169
1 vote
0 answers
430 views

Draw polygon (vectorize) raster based on same colored pixels -- getting bad polygons

So, I have a TIF georeferenced map and a rather messy shape that I need to digitize. It is green but has a lot of holes in it that are light green color. So, I want to capture all green pixels and ...
Matija Kordic's user avatar
1 vote
0 answers
52 views

Conceptual question on comparing rasterized data with vectorized (polygons) data

I've got this doubt on how to best proceed with the following situation: I would like to compare two datasets, one (model_data) is a raster (NetCDF format), with lat, lon and time as coordinates, ...
Henrique's user avatar
  • 123
3 votes
1 answer
4k views

Converting raster to line vector layer

I would like to convert all values having the value 1 in a binary raster to a line vector layer. The following image shows the binary raster (1=white and 0=black): The optimal output would look like ...
Sophie Crommelinck's user avatar
0 votes
1 answer
4k views

How to polygonise a binary raster with python?

I already asked this in StackOverflow, but maybe it's better here. I have a ndvi raster that I binarized (I put my threshold at 0.35) with a script python and I wanted to polygonize this raster, in ...
hort_98663's user avatar
6 votes
1 answer
2k views

Extracting the pixelwise proportion of classes of a finer raster in a coarser one

I have two rasters, one has a 1 km resolution. The other has a spatial resolution of 30 m. This latter pixelwise is a classification. I want to overlay the 1 km raster on the classification raster and ...
JEquihua's user avatar
  • 1,087
11 votes
3 answers
16k views

How to convert float raster to vector with python GDAL

I have float raster and now I want to convert it to vector. How is it possible with the Python GDAL library? I have tried with gdal_polygonize.py of GDAL utilities on the command line and it worked ...
Monir's user avatar
  • 399
6 votes
2 answers
6k views

Converting points to lines with Python GDAL

I have a dictionary with points. The points are derived from a raster (see image below). The points are not sorted and are not in order. The dictionary looks for example like this: pointDict = {0: (...
ustroetz's user avatar
  • 8,024
9 votes
2 answers
2k views

Scriptable alternative to ArcScan (particularly vectorising lines within tolerances)?

Sadly the answer to Can you access ArcScan from a python script? suggests that it is not possible to script ArcScan from within a python script. Therefore, does anyone know of any alternatives to ...
robintw's user avatar
  • 4,006