Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [polygonize]

The process of producing a polygon feature layer from a raster or from lines.

0
votes
0answers
24 views

Convert a raster to a polygon with gdal in command line

I want to convert a raster (agric.tif) to a polygon layer (agric.shp). I want to use gdal in command line since the QGIS (raster to polygon) seems to takes for ever (still running over an hour). I am ...
1
vote
1answer
37 views

Invalid geometry error after polygonizing a GeoTIFF file

I wanted to clip an OSM vector layer with the boundaries of a raster image--a GeoTIFF file. I was able to polygonize the raster and obtain its boundary in a vector format. But I am getting a error ...
1
vote
0answers
46 views

GDAL - Polygonize multiband raster and save pixel values of each band to corresponding attribute fields

I'm trying to polygonize 2 band raster(which was previously reclassified) and put values of each band into seperate attribute table column. Both bands overlap each other perfectly. This piece of code ...
0
votes
0answers
32 views

ST_Polygonize/Shapely cannot polygonize when overlapping with shared node/point

I'm trying to use both polygonize_full (Shapely, python) and ST_Polygonize (postgis) to get all polygons from a set of line strings. There is one case where it fails: when there is an "overlapping ...
0
votes
1answer
69 views

Create polygons (representing boundaries) from lines

I received a file of municipality boundaries, where the boundaries are represented as lines. I would like to convert this to a set of polygons, each representing a municipality. In other words, from ...
2
votes
0answers
62 views

Unable to truly polygonize raster in QGIS [duplicate]

I've used QGIS's Polygonize to convert the following raster into outlines. The polygonize tool does produce a vector output, but it isn't in plain polygon form but some thousands of single pixel ...
1
vote
1answer
59 views

QGIS: Dissolve after raster-to-polygon not working correctly, only dissolving a portion of the vector layer

I am working with QGIS and am trying to convert a raster layer into a vector layer. I have converted it to a polygon from raster (image below), and then wish to dissolve this polygon into a single ...
0
votes
1answer
128 views

Constructing polygons from GDAL Polygonize?

I have a geotiff file, which, for each cell ( pixel), it contains a discrete value ( you can think of this value as the "fitness" value of the cell). For the neighboring cells, they can consist of the ...
1
vote
1answer
274 views

Defining convex-hull of (clouds of) points using R? [closed]

I have multiple (clouds of) points, and would like to take the outer envelope of these points. This will allow me to polygonize my points. Using the convex-hull would help me, but in some cases, my ...
3
votes
3answers
148 views

Smoothing raster with binary cell values

Main question towards the end. Details follow now: I have a slope raster Region: Bern, Switzerland CRS: EPSG:2056 - CH1903+ / LV95 - Projected Extent: 2587757,...
0
votes
1answer
144 views

Translating gdal.polygonize from qgis 2 to 3

I was using this simple code to polygonize rasters using qgis 2.18: general.runalg('gdalogr:polygonize', inRaster, 'DN', outShape) I've tried converting it to use in qgis 3.2 like so: general.run('...
1
vote
0answers
172 views

Polygonizing raster cells in rasterio regardless of value?

I would like to polygonize every single cell of a raster dataset using rasterio. I have been experimenting with the following function based on this question: def polygonize_raster(dataset): # ...
1
vote
0answers
35 views

Enable additional providers?

I try to apply the apply the function of raster to vector from "Raster -> Conversion -> Polygonize", but it appears like follows: An error has occurred while executing Python code: UnicodeDecodeError:...
0
votes
1answer
125 views

Vectorize raster

I'd like to vectorise the Natural Earth II raster in order to be able to change its colours and display it with as a vector map. Using gdal_polygonize.py won't help as it will create 1 polygon per ...
2
votes
0answers
29 views

Processing tool to fill all voids within a lines layer

I'm trying to convert a lines layer from Ordnance Survey which is made up of field boundaries, river banks, woodland boundaries and houses etc into a polygon layer, but only 'polygonise' the fields. ...
2
votes
2answers
268 views

How to polygonise a large and detailed raster into a single valid polygon with QGIS?

I am doing research on the protected areas of the Amazon rainforest and I need to create a single polygon layer that has all the forested non-protected areas in one attribute row. I have tried using ...
1
vote
0answers
47 views

Polygonize lines and retain attribute

I need to apply Polygonize tool to several hundred shapefiles with Graphic Modeler tool. However, the Polygonize tool empties the attribute table - and I need to retain at least one of the attributes. ...
0
votes
0answers
48 views

Store Huge Polygonized Raster Files

I have the following requirement, currently I have 100 Raster files with precipitation data for each week represented in 52 layers. I have to load these Raster files in a system that can only work ...
2
votes
1answer
188 views

Gdal Polygonize, empty attribute table

I am trying to polygonize one of my rasters with PyGIS. I do this with the below script. sourceRaster = gdal.Open('RASTER.tiff') sr_proj=sourceRaster.GetProjection() raster_proj = osr....
2
votes
2answers
135 views

Polygonize a multi-band raster

I have a polygon and I want to estimate areas of different types of land cover tha falls within the polygon. The problem is that the only freely available land cover data I found is https://catalogue....
0
votes
0answers
142 views

Invalid Shapefile of Shapely polygons written with Fiona

The following code defines a regular grid, creates polygons within the grid intersections, applies a translation, rotation and inner buffer on the polygons using Shapely. It then writes the polygons ...
2
votes
1answer
553 views

QGIS 3.0.3 python error “/bin/sh: gdal_polygonize.py: command not found”

I have recently downloaded QGIS on my Mac to preform an analysis for my dissertation. I am trying to convert my raster data to polygon data using the gdal_polygonize.py tool provided by QGIS. ...
1
vote
1answer
349 views

“LineStrings must have at least 2 coordinate tuples” error in QGIS polygonize [closed]

I am using QGIS version 2.18.9. I wanted to convert DXF into polygon. First, I used the tool called "v.in.dxf" under the processing tool. Using that tool, line shapefile was created. Then I ran the "v....
1
vote
0answers
109 views

Polygonizing distinct values using QGIS?

I am using QGIS 3.0.3 and I am trying to create simulated data through two sets random points distributed along two gradients of values (photo below). Using the raster calculator I created two ...
1
vote
1answer
227 views

Polygonize tool not giving output in QGIS?

I am very new to QGIS (long time ESRI user that is making the transition). I am using QGIS 3.0.3 and I am trying to make polygons from a raster layer by value. Unfortunately every time that I ...
2
votes
1answer
342 views

Batch Polygonize rasters into shp file using gdal_polygonize.py but no result?

I'm trying to use and recreate this code from Using GDAL polygonize from Python? import subprocess, glob script = "/usr/bin/gdal_polygonize.py" for raster in glob.glob("/data/brent/GAUP/Jul21_17-...
1
vote
1answer
309 views

QGIS 2.18 Polygonize (raster to vector)

I'm a bit confused about how to use polygonize (raster to vector). Particularly what to put in the field name box. The documentation states that it "Defines the field name in which the attributes of ...
1
vote
1answer
495 views

How to create polygon from my coastline in qgis? [duplicate]

I've downloaded the data from Natural Earth (coastline at a scale 50 million), I've cut the coastline into my study area, I wanted to clip other vector datasets as well, for this I wanted to convert ...
2
votes
1answer
282 views

Polygonize tool error

I'm using Qgis 3.0.1 and trying to polygonize a raster layer. I'm getting the following error: Processing algorithm… AlgorithmDialog Input parameters: { 'INPUT' : 'crs=EPSG:4326&dpiMode=7&...
1
vote
1answer
391 views

Output field name when using gdal.Polygonize() in python

I am trying to Polygonize one raster image that previously I convert to 1s and 0s. If I do it from QGIS, there is the option to select the output field name, which stores as attributes the value of ...
1
vote
0answers
118 views

Estimating processing time for rasterize or polygonize tools in QGIS?

I often rasterize or polygonize large layers (flood modelling results). Is there a way I can estimate how long the tool will take? Sometimes, I'm not sure whether it will take 10 minutes or 10 ...
1
vote
0answers
228 views

Summarizing GPS coordinates inside polygon in Google My Maps? [closed]

I need to set up the most effective routes to visit different locations. I have several teams to visit the locations depending on where they are. I am given Latitude and Longitude of all the locations....
5
votes
1answer
203 views

Make ST_Polygonize in Postgis return dangles, cuts and invalid rings

Postgis allows using ST_Polygonize() from GEOS to make polygons out of lines. I have seen the same function available in Shapely library for Python, but in Shapely, the other method named ...
0
votes
1answer
166 views

gdal polygonize can't create .gkpg file [closed]

I'm currently trying to take a .tif file and polygonize it, I can do this if the output file format is a .shp but when I try to make a .gkpg file I get this error: Traceback (most recent call last): ...
2
votes
1answer
467 views

How to avoid self-intersections in geometry created by GDAL Polygonize in Python

I am creating geometry from a raster using GDAL Polygonize in Python. My issue is that doing this creates a lot of self intersection errors. This seems to occur due to the nature of the pixel grid. I ...
1
vote
0answers
320 views

Getting Error 1: Failed to create directory for shapefile datastore?

On page 315 in QGIS training manual (using QGIS 2.18) I am attempting to use the Polygonize from raster to vector tool to vectorize my raster (of forest strands) to polygons for Exercise 14.3.2, I am ...
2
votes
2answers
57 views

Converting 1-D line features to 2-D polygons W/O editing manually

I have a line file of airport runways across my state. I'm looking to symbolize them as part of a thematic town parcel layer, so I'd like them all to be in 2-D. My problem is, some bigger airports (...
1
vote
0answers
169 views

Create a polygon from multiline offset

I've a multiline in Postgis. The multiline represents a wall, and I need to transform it to a polygon given the thickness of the wall itself, so I need to create offset lines, join them and create ...
1
vote
1answer
136 views

Getting zones from raster?

I'm wondering if it is possible to get zones based on a raster file as you can see in my attached image (hand-made). Is there a tool or an idea to get a result like that?
2
votes
1answer
103 views

Polygonize Specific DN

I am using QGIS 2.18.5. I have a very large raster with DN values of interest (3) and others which I have no interest in at all (0,1,2). To prevent polygonising the entire raster which would take a ...
1
vote
0answers
421 views

Unable to get gdal_polygonize function to work in R

I know there have been previous questions with respect to the same. I have been trying to polygonize a raster using modified code from John Baumgartner. Link : https://gist.github.com/johnbaums/...
2
votes
0answers
226 views

Lines To Polygons and Polygonize attribute table problem [closed]

On my systems, QGIS 2.18 64-bit, Windows 10, attribute tables produced by the Lines To Polygons tool and Polygonize tool differ from the table of the source layer. The source table has two fields: ...
1
vote
1answer
789 views

sf lines to polygons with holes

With sp package I generate automatically boundaries for different sets of spatial points. I'm trying to perform the same workflow with sf package but i had problems for detecting holes in the way sp ...
0
votes
1answer
107 views

Georeferencing map images

I have to regularly create KML polygons of map area outlines (white outline, QGis width 1.754, Google Earth width 5). I tend to have map image source files. I know how to georeference a source image ...
2
votes
1answer
147 views

Heat mapping forestry height trends using ArcGIS?

I am using ArcGIS and have access to Spatial and 3D Analyst extensions. I've attached a link to a picture of a 1m raster “canopy height model” which was derived from LiDAR and displays tree heights (...
5
votes
1answer
850 views

Polygonizing a raster yields lots of little squares?

I have a pdf with the area of a county that I want to separate into multiple shapefiles (polygons) based on color. As shown in the first picture there are 4 colors so I would need to separate based ...
3
votes
1answer
834 views

Convert multiple polylines to polygons in QGIS

I have a vector layer with several polyline segments that represent borders of different areas. Each segment is connected to at least two other segments (at its start and its end). Some segments are ...
1
vote
1answer
329 views

Extracting polygons from closed lines in QGIS

I have a line layer having lakes and rivers. I would like to extract only the lakes (which are closed curves) from the layer.
1
vote
0answers
91 views

GDAL reclassify and polygonize Esri ASCII grid files

I realized that reclassification is the tool to go to reduce the polygon count Creating simplified (binned) polygons from raster file? and implemented it in Java using geotools. Unfortunately this is ...
1
vote
1answer
156 views

Creating simplified (binned) polygons from raster file?

I have esri ascii grid raster files like ncols 4 nrows 3 xllcorner 0 yllcorner 0 cellsize 1 nodata_value -999 1 2 3 4 4 21 3 3 3 2 31 1 How can I convert this into vectorized (WKT) format when ...