Questions tagged [multi-polygon]

A MultiPolygon is a geometry whose elements are polygons.

Filter by
Sorted by
Tagged with
9 votes
3 answers
6k views

R/sf: Some edges are crossing in a MULTIPOLYGON. How to make it valid when using S2 geometry?

Goal: I would like to know the NUTS region (2016 version) of points in Europe. Method: (1) Download the official geodata from Eurostat, (2) Use st_join from sf with R. Problem: I've updated sf, now ...
Antonin's user avatar
  • 825
9 votes
1 answer
128 views

Deleting parts of MultiPolygon based on area using PyQGIS

I have a layer with MultiPolygons. Some of them have parts less than five m2 which I want to delete. The QgsGeometry class has methods: parts() and deletePart(self, partNum: int). On parts() I can ...
ThiPa's user avatar
  • 585
8 votes
1 answer
6k views

Converting from MultiPolygon to Polygon in PostGIS

I have a table in PostGIS, where the data is currently stored as a MultiPolygon. Each Multipolygon has only a single Polygon in it. How do I query and get the containing Polygon, and not MultiPolygon? ...
Devdatta Tengshe's user avatar
7 votes
1 answer
4k views

Creating centroid inside of polygon [closed]

I want to get the centroids of my multipolygons using Python and GeoPandas. But when viewing the polygons and the centroids points on QGIS, the centroids are not inside the polygons. Here is the code ...
mee's user avatar
  • 245
6 votes
4 answers
1k views

Taking only the largest polygon from MultiPolygon layer in QGIS

I have MultiPolygon geometries in my file, and I want to take only the largest polygon within the MultiPolygon geometry to further work with it. I tried using the "Multipart to singleparts" ...
Anabella's user avatar
6 votes
3 answers
1k views

Multipolygon supposed to be contained by another but returned False with Shapely

There are two multi-polygons a and A where a is supposed to be contained inside A. Using shapely, the following difference operator b = a.difference(A) print(b) gives POLYGON EMPTY However testing A....
Pateheo's user avatar
  • 265
6 votes
2 answers
699 views

Filling gaps within a multipolygon using Python

I would like to know how can I fill the gaps within a multipolygon. The convex hull isn't the proper solution, since they change the geometry completely. I have attached a sample figure of such a ...
rmj's user avatar
  • 367
6 votes
2 answers
220 views

Displaying symbology only for largest part of polygon in QGIS

In QGIS 3.22.0 (Bialowieza) I have a polygon layer of municipalities in Germany. Some municipalities consist of more than one polygon. I have duplicated the layer in order to make a categorization of ...
rtaani's user avatar
  • 575
5 votes
2 answers
136 views

Getting "QgsPolygon: CurvePolygon EMPTY" when extracting the largest part of MultiPolygon using PyQGIS

There is a shapefile with MultiPolygons, see the image below With this code, I am trying to get the largest part (by area) of each MultiPolygon feature. It utilizes the constGet() method. layer = ...
Taras's user avatar
  • 28.8k
5 votes
3 answers
935 views

Using Union tool over MultiLineString in polygons layer in QGIS

I created a polygons layer in QGIS 3.22.2 by creating circular buffers around points. I need to Union them by intersecting the overlapping parts. After running for several hours, the Union tool gives ...
edge's user avatar
  • 219
5 votes
1 answer
200 views

Creating polygons with "Create shapefile layer" always produce multipolygons instead of polygons when saving in QGIS

Not sure if is a bug or I'm missing something. Every time i'm creating a new shapefile with "Create shapefile layer" i got a multipolygon instead of a polygon (at least is what I'm expecting)...
Alexis's user avatar
  • 233
4 votes
1 answer
379 views

Inspecting individual Polygons of MultiPolygon in QGIS

Using QGIS's Identify results, I can highlight and inspect an individual 'feature', in this case a country geometry. In reality, the geometry is a MultiPolygon and I would like to inspect individual ...
ChaimKut's user avatar
  • 155
4 votes
1 answer
192 views

PostGIS generate center POINTS from multilinestrings and multipolygons (for each line and polygon) in the memory

Let's assume, I have a mixed geometry type table in PostgreSQL The multipart geometries don't intersect themselves. I would like to generate a center point collection from every geometry. I know how ...
David Gregor's user avatar
4 votes
1 answer
43 views

Dividing point layer according to boundary layer in QGIS

I have two layers: All the post offices in the city (point layer) Division of the city into boundaries according to their neighbourhood council (MultiPolygon layer) How do I split the first layer ...
Galv01's user avatar
  • 53
4 votes
1 answer
2k views

Splitting MultiPolygon shapefile into separate Polygons in R

I have a polygon shapefile with 2 features. I want to split the MultiPolygon shp into separate shapefiles based on a column of the attribute table. What I've tried so far is this code based on that ...
Nikos's user avatar
  • 752
3 votes
2 answers
308 views

Getting area of part of MultiPolygon in QGIS

Is it possible, with QGIS, to get the area of a single part of a multi polygon? Or do I have to split them into single polygons?
MartinMap's user avatar
  • 8,137
3 votes
2 answers
293 views

Constructing grid over given position from polygons in QGIS

I have the following situation: I have a MultiPolygon Layer that shows some squares with the size of 100mx100m. The data looks like a raster: I want to construct a grid with the size of 100mx100m (...
divko's user avatar
  • 65
3 votes
1 answer
351 views

Why are my area calculations in Python so small with .area()?

I'm trying to calculate the area of a flood with Python, but the results seem way too small: iceye_breaks = iceye_breaks.to_crs("+proj=cea +lon_0=0 +x_0=0 +y_0=0 +lat_ts=45 +ellps=WGS84 +datum=...
UniStudent's user avatar
3 votes
1 answer
378 views

Turning overlapping MultiPolygons into not overlapping areas

I have a layer containing MultiPolygons. These MultiPolygons do overlap each other and do have a not unique attribute time containing integers. The number of polygons per layer vary as well as the ...
MrXsquared's user avatar
  • 31.2k
3 votes
1 answer
621 views

ogr2ogr Conversion Clockwise to Counterclockwise?

Looking for the right combination of ogr2ogr parameters to get a .shp bundle to GeoJSON and reverse the Coordinate pairs. I recognize that ESRI defines Polygons as clockwise (http://www.esri.com/...
Snowy's user avatar
  • 151
3 votes
1 answer
271 views

Choosing label placement in MultiPolygon with CartoCSS

I am rendering an interactive world map with TileMill and I have the problem that the country name for Denmark is placed onto Greenland. This is because Denmark is represented as a MultiPolygon with ...
kurt-hectic's user avatar
3 votes
2 answers
278 views

Buffering around all borders of EEZ regions in QGIS

I have a layer containing points (in yellow) and a layer containing the Exclusive economic zones of all countries (as polygons, its geometry is MultiPolygon). See the image below: I would like to ...
Max Muller's user avatar
3 votes
1 answer
643 views

Error when calculating final polygon after subtracting all intersecting polygons using shapely

This question is a follow-on question from Calculating final polygon after subtracting all intersecting polygons using shapely which was answered. I have a list of centroids that I buffer to 5000 ...
Feyzi Bagirov's user avatar
3 votes
1 answer
396 views

Splitting features of multi-part polygons according to condition(s) in QGIS

I have a multi-part polygon with a large number of irregularly-shaped features (>600 features). I would like to split them into smaller sub-features/segments and assign a unique id to these smaller ...
Jacqueline's user avatar
3 votes
0 answers
77 views

Error using PostGIS query in MultipolygonZ type data [duplicate]

I am using this query in MultipolygonZ type data in my PostgreSQL database, but I got error for so many times the data is not rendered properly in PostgreSQL with PostGIS extension. PostGIS query:- ...
Ayush's user avatar
  • 41
2 votes
1 answer
105 views

Euclidean distance from vector features for radiotracking data in R

I have a radiotracking dataset (ca 5000 rows) like this Animal Date Time Latitude Longitude Pepe 21/12/2020 23:00:28 52.25938 15.50511 Pepe 21/12/2020 19:00:15 52.26251 15.52726 Pepe 21/12/...
Franza's user avatar
  • 173
2 votes
1 answer
384 views

Getting the bigger polygon of Multipolygon

I have a Multipolygon that has 5 separate polygons and I want to get only the geometry of the biggest polygon. How can I get the largest polygon from the multipolygon?
Mahmoud Adel's user avatar
2 votes
1 answer
134 views

Extracting points by multipolygon and having separate point(s) output using ArcGIS Pro

I have a point shapefile that has 1.5 million data points and I want to extract the points that are within in each polygon of a multipolygon.shp file and have separate outputs. Let's say there are 32 ...
Arthur_Morgan's user avatar
2 votes
2 answers
763 views

Turn a MultiPolygon with Nested Shells into a Polygon with Holes

I am reading GeoJSON into shapely objects and need help, I have a massive MultiPolygon with several nested Polygons in it. I believe this is why it is not considered a valid shape? as_shape.is_valid -&...
Vincent Buscarello's user avatar
2 votes
2 answers
2k views

Create MultiPolygon from Dataframe column

I have a dataframe with a column called geo_shape, for each row in this column data is in the format str with the following structure: {"type":"MultiPolygon","coordinates"...
Daniel's user avatar
  • 335
2 votes
2 answers
451 views

PostGIS: create new polygons in between existing?

PostgreSQL: I have a PostGIS multipolygon table containing millions of features. It covers 95% of the country, however there are gaps between individual polygons. How can I fill these gaps with new ...
Theo F's user avatar
  • 1,687
2 votes
2 answers
1k views

Convert a polygon geopackage into a multi-polygon geopackage in QGIS

I have a series of polygons in a geopackage file of QGIS polygons. Is it possible to transfer the contents of this file to another geopackage that has multipolygons as vector data type? I need to fix ...
ddomizia's user avatar
  • 638
2 votes
4 answers
973 views

QGIS clip tool error non-point (MULTIPOINT) geometry to point shapefile

I'm using QGIS 3.22.4 then tried 3.22.7. I am using the clip tool. The input layer is a point(point) shapefile (verified in layer properties under information-geometry section). I have tried this ...
TRC's user avatar
  • 21
2 votes
1 answer
344 views

PostGIS: Split polygons into intersecting and non-intersecting and grouping on overlap

I have a big query that I am looking to optimize. I am matching millions (expanding daily) of rows with Points against a mostly read-only table of (tens of thousands of) areas with (Multi)Polygons. ...
Goddesen's user avatar
2 votes
1 answer
167 views

Cleaning up holes in MultiPolygon using QGIS

This is a screencap of my map in QGIS: Those orange bits in the middle of each section are actually holes in the GeoJSON file and I can't make them go away. I've tried using the "Vertex tool&...
Jay's user avatar
  • 31
2 votes
0 answers
37 views

Unwanted different line thickness in multipolygon's shared borders

I have a multipolygon in a Leaflet map in a R Shiny app. There is always one subpolygon selected to be displayed while the other subpolygons are hidden (i.e. it's fill is transparent and the others ...
bathyscapher's user avatar
2 votes
0 answers
63 views

Selecting polygons within other polygons in the same layer in QGIS

I am trying to filter out certain infrastructure from OSM data and convert everything to simple point layers using QGIS. I have an OSM shapefile containing polygons of schools. In many instances, ...
Juli's user avatar
  • 29
2 votes
0 answers
73 views

Separate multipolygons into equal parts

I am trying to separate a multipolygon into equal parts. I am aware of the divide polygon plugin and that worked well for me in previous examples where a single polygon is involved. Unfortunately I ...
Lili's user avatar
  • 21
2 votes
0 answers
399 views

Simplifying parts of polygons in QGIS

Is it possible to simplify just the selected parts of a polygon? I am trying to make a simplified version of the Australian Local Government Areas (LGAs) shapefile. I am using the v.generalise ...
naught101's user avatar
  • 496
2 votes
2 answers
346 views

Export/convert Points to Polygon

I have to convert a .shp into a .csv file and upload it to the SQL Server, for a program that only supports Polygon format and can not render Points. Is there a way to convert Points to Polygon or is ...
Adephx's user avatar
  • 53
1 vote
1 answer
427 views

Rendering overlapping polygons without holes in multipolygon in Leaflet

Is there a way to render overlapping polygons without holes in multipolygon in Leaflet? I found Leaflet has an open issue. codesandbox.io I am asking because I have a bound polygon that contains inner ...
Matt's user avatar
  • 73
1 vote
2 answers
863 views

PostGIS: Syntax for ST_Collect into a multipolygon keeping internal boundries

I have a PostGIS table with many polygons representing islands these all form a common group How do I create a new MultiPolygon (keeping internal boundaries) and give it a new name? CREATE TABLE ...
Tony Sansom's user avatar
1 vote
1 answer
170 views

Extracting categorial data from neighboring polygons from st_intersects [closed]

For each polygon in an sf object, I need to extract data on a single variable from all of the neighboring polygons. I have made a reprex below. So far I have managed to get a list of the neighboring ...
NorthNW's user avatar
  • 13
1 vote
1 answer
505 views

QGIS Difference Algorithm: multilinestring won't work with multipolygon layer

I am working with two vector layers in QGIS (location: Indonesia). I want to 'subtract' the area of layer 1 ('Forest_buffer') of layer 2 (Scenario_1). I am using the Difference algorithm. Layer 2 is ...
Femke Pragt's user avatar
1 vote
1 answer
55 views

Using multipolygon shape layers in profile tool

I am working with QGIS for some time. The profile tool is indeed very useful to visualize the 3D problems. My problem now is associated with this tool. I have a multi polygon shape layer which I ...
CanJash's user avatar
  • 11
1 vote
0 answers
27 views

Capture isolated parts of a polygon after difference operation in single polygons

In QGIS, I have two layers, each consisting of only one feature. After subtracting the grey layer from the orange layer, the resulting layer has also only one feature. I want to access all the ...
Jan Kl's user avatar
  • 11
1 vote
0 answers
68 views

ST_MakeValid for MultiSurface type in PostGIS

I am trying to take a lot of overlapping (bullseye type shape) polygons and curve polygons and create a valid shape with the correct cutouts. I was previously using a query that converted the ...
Mikaela's user avatar
  • 19
1 vote
1 answer
362 views

shapely | Binary mask of Polygons' intersection

Goal: Create a binary 2d-array, that represents Points of intersection of a square Polygon with a MultiPolygon. from typing import List, Tuple import numpy.typing as npt from shapely.geometry import ...
StressedBoi_69420's user avatar
1 vote
0 answers
90 views

Areal Interpolation polygon to polygon using ArcGIS Pro

I am using ArcGIS Pro 3.0.0. I have two multipolygons and I would like to interpolate the values of one polygon to the other. I found the Areal Interpolation tool which does exactly that. One of ...
Arthur_Morgan's user avatar
1 vote
0 answers
23 views

Fix Separated MultiPolygon Layer

I was given a parcel shp, and I found there's a lot of segmented of a single parcel. The geometry type of the layer is MultiPolygon, like the following picture. It seems to me, the original data was ...
Cookie's user avatar
  • 169