Questions tagged [geometrycollection]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

Access to geometry inside QgsGeometryCollection PyQGIS

I want to transform geometry in QGIS to QgsGeometry (for rubber band etc.). point = QgsPoint(1, 2) line = QgsLineString(QgsPoint(3, 4), QgsPoint(5, 6)) poly = QgsPolygon(QgsLineString([...
Dezmonder's user avatar
5 votes
2 answers
133 views

How to write a GeometryCollection to a GPKG file and open it in QGIS?

I am trying to write a GeoDataFrame's GeometryCollection geometry to a GPKG file and open the result in QGIS. This is the way I create the GPKG file: import shapely import geopandas as gpd gpd....
zabop's user avatar
  • 2,072
0 votes
1 answer
61 views

Eliminate Selected Polygons in QGIS creates an incompatible GeometryCollection

I have a multipart shape file created from a GeoJSON. The original geoJSON is from the Vermont Open Geodata Portal, so a lot of the polygons have errors and overlaps. To fix the overlaps, after I ...
jake g's user avatar
  • 1
2 votes
1 answer
387 views

Opening GML file with collection of geometries in QGIS

I can't visualize in QGIS the .gml file that can be downloaded here (second row). I think QGIS doesn't support files with 'collection of geometries', therefore I don't know how to use it. A professor ...
Fabio Castelli's user avatar
2 votes
1 answer
388 views

Import CSV data containing WKT with GEOMETRYCOLLECTION() to QGIS

I have a CSV file containing geodata in WKT in one column. The geometry type is GEOMETRYCOLLECTION. How do I import this to QGIS with one layer per geometry type (POINT and LINESTRING in this case)? ...
winnewoerp's user avatar
  • 1,504
1 vote
0 answers
19 views

Geometry Collection Support for DB2

At first glance it looked like DB2 supported Geometry Collections but this doesn't appear to be the case. I've tried adding a WKT like: GEOMETRYCOLLECTION (POINT (40 10), LINESTRING (10 10, 20 20, 10 ...
mxcolin's user avatar
  • 61
10 votes
3 answers
3k views

Accessing individual elements of GeometryCollection with shapely >= 2.0.0

From the code available here: https://shapely.readthedocs.io/en/latest/reference/shapely.GeometryCollection.html: from shapely import LineString, Point p = Point(51, -1) l = LineString([(52, -1), (49,...
swiss_knight's user avatar
  • 10.3k
1 vote
2 answers
925 views

Building a GeoDataFrame out of a shapely GeometryCollection with shapely 2.0.0 -> ValueError: DataFrame constructor not properly called!

I successfully used to build a GeoDataFrame out of a shapely GeometryCollection (hereafter gc) as gdf = gpd.GeoDataFrame(gc) but I'm now facing this error with shapely 2.0.0: gdf = gpd.GeoDataFrame(gc)...
swiss_knight's user avatar
  • 10.3k
2 votes
0 answers
319 views

How do I cast an empty GeometryCollection to an empty typed geometry in PostGIS

As a workaround to an obscure issue, I need to do exactly the opposite as describe here in order to harmonize my data set: How to convert a "Polygon" to a "GeometryCollection" type ...
swiss_knight's user avatar
  • 10.3k
1 vote
2 answers
582 views

Combining multiple PostGIS geometry collections into one

I'm having an issue with combining multiple geometry collections. My sample data consists of 2 records in a trips table, each with a track. There could be many more records, tho. Here's the first ...
shabushabu's user avatar
1 vote
1 answer
900 views

How do you make a GEOMETRYCOLLECTION valid in SSMS?

The following query is used in an app to make shapes valid, however it does not work when using GEOMETRYCOLLECTIONs. I get the following error: A .NET Framework error occurred during execution of user-...
NickyLarson's user avatar
1 vote
0 answers
562 views

ogr2ogr geometryCollection export: Attempt to write non-linestring (GEOMETRYCOLLECTION) geometry to ARC type shapefile

I'm trying to export a single table row to geometryCollection. I don't understand why I am getting the following error message or how to fix it. The row contains the following shape GEOMETRYCOLLECTION ...
NickyLarson's user avatar
2 votes
2 answers
486 views

Split lines by a polygon - Why are "internal" lines split in parts using sf/st_split

The context: I have a border and routes followed by vehicles. I want to decompose the routes, cutting them everytime they cross a border, and for each part, know what are the distances performed. ...
Antonin's user avatar
  • 865
0 votes
1 answer
1k views

How to convert Multipolygon to GeometryCollection?

I get this error (Script Error, File too large: larger than 512kb) in Google Earth Engine and my layer is a Multypolygon, just with 86 polygons. I have another layer with 300 polygons without any ...
Manuela Alvarez Ruiz's user avatar
4 votes
1 answer
2k views

Is it possible to remove select geometries from GeometryCollection elements within Google Earth Engine?

I am relatively new to Earth Engine and am trying to understand GeometryCollection elements. I have seen this post, but otherwise haven't found much additional information. Coming from desktop GIS ...
user6135514's user avatar
2 votes
2 answers
929 views

PostGIS returns an empty GeometryCollection out of an intersection between a MultiPolygon and a Point

Context I've narrowed down an issue I faced involving many buffers and so on, to this in PostGIS (version 2.4): SELECT St_geometrytype( St_geomfromtext( 'MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0), ...
swiss_knight's user avatar
  • 10.3k
1 vote
1 answer
906 views

FeatureCollection 'union' in Google Earth Engine doesn't consider all Features

Ultimately, what I am trying to do is calculate overlap between (1) polygons of a species' range and (2) polygons of Protected Areas. There can be multiple overlapping polygons for the range (e.g. ...
rasenior's user avatar
  • 109
4 votes
1 answer
1k views

Extracting/casting mixed geometry types to single type using ogr2ogr?

I have a GeoJSON file with mixed geometry types, something like this: { "type": "FeatureCollection", "features": [{ "type": "Feature", "geometry": { "type": "GeometryCollection", "...
dericke's user avatar
  • 992
1 vote
3 answers
554 views

SLD - styling geometry collections in geoserver

I’m trying to style a geometry collection column (PostGIS) that stores both polygons and points in each record. I already read the geoserver manual on how to style mixed geometry types and I don’t ...
Gil's user avatar
  • 41
1 vote
0 answers
78 views

Is there a standard way to apply different field values to linestring vertices?

In QGIS I have several 3D points that I am creating a linestring from and each point could have a different value in one of the fields like "type". I want to somehow create the linestring and be able ...
Cary H's user avatar
  • 964
1 vote
1 answer
257 views

PostGIS Connection In QGIS. Vector Query Results of GeometryCollection Load Layer as Raster

https://postgis.net/docs/ST_VoronoiPolygons.html I am trying to load this query result using PostGIS 2.5 connection in QGIS 3.4, QGIS 2.18. SELECT ST_VoronoiPolygons(geom) As geom FROM (...
Muhammad Imran Siddique's user avatar
0 votes
1 answer
2k views

ST_Multi returning GeometryCollection in PostGIS?

I am working in Postgres 9.6. I have a table called builtup_areas: Table "public.builtup_areas" Column | Type | Collation | ...
Richard's user avatar
  • 3,289
-1 votes
1 answer
615 views

Splitting points from GeometryCollection?

I am using PostGIS ST_ClusterWithin function for clustering: SELECT row_number() over () AS id, ST_NumGeometries(gc) as total, ST_AsGeoJson(gc) as geo_collection, ...
EviSvil's user avatar
  • 147
6 votes
1 answer
1k views

Export multipolygons into a GeoPackage

In FME, I use the Aggregator to merge polygons based on one attribute (desnat in my example file). When the output is Shapefile, multipolygons are created and all works fine. When the output is OGC ...
romainbh's user avatar
  • 1,045
5 votes
2 answers
1k views

Create a view based on table with GeometryCollection column for use in QGIS

I have a table with a geometry collection (polygon and point). QGIS can not read the geometry collection, so I want to create a view for the polygon type and the point type. My SQL function for the ...
oliver.f's user avatar
5 votes
0 answers
2k views

Working with GeometryCollection in Leaflet layer [closed]

I have a web app based on this template https://github.com/bmcbride/bootleaf The app works fine with point geometry but I would like each feature to have a point and a polygon. The geojson is: { ...
user92698's user avatar
2 votes
3 answers
2k views

Displaying GeometryCollection with one geometry in QGIS fails

I have a problem with displaying simple geometrycollection with one multipolygon as a vector layer in qgis. When I import the geometry in qgis I cannot zoom to layer nor see labels and style. Here is ...
Moki's user avatar
  • 41
3 votes
2 answers
2k views

Extracting GeometryCollections From SQL

I am trying to convert SQL Shapes to ESRI Shapefiles using the instructions in this blog post from a few years back and OSGeo4W. https://alastaira.wordpress.com/2011/09/29/exporting-spatial-data-from-...
HenryClay's user avatar
2 votes
1 answer
461 views

In PostGIS how can I do an ST_Intersection() search with a GEOMETRYCOLLECTION Geography field?

I have a Postgres table "files" with a lat/lon location field of type geography(GeometryCollection,4326). Right now the field only contains lat/lon polygons. I have succeeded in creating a gist index ...
Jim Fluke's user avatar
1 vote
1 answer
2k views

PostGIS do not want GeometryCollection in output

I am intersecting two layers. 1. truckmun which has multipolygon and polygon geometries in it 2. streamsw which is just multistring. The SRID is 3424 for both layers. Here is my intersecting query ...
ziggy's user avatar
  • 4,515
3 votes
0 answers
6k views

from geometrycollection to polygon geometry with python

I have a geojson file containing a feature with geometrycollection type (polygon and linestring). I need to produce two ESRI Shapefile from the geojson geometrycollection: one with Polygon only and a ...
lorenzo's user avatar
  • 61
0 votes
2 answers
623 views

Building efficient multi geometry type database with PostGIS?

I'm trying to build a PostGIS database which must be able to store (multi)points, (multi)linestrings and (multi)polygons. The goal is to efficiently querying the data with ST_Intersects and other ...
Sharky's user avatar
  • 235
2 votes
2 answers
12k views

How to access members of GeometryCollection - Python

I am using 'intersection' function from Shapely to find junctions of a road network. As i found, intersection returns GeometryCollection. In my case it could be Point, LineString or perhaps ...
Jio's user avatar
  • 632
3 votes
1 answer
1k views

Force ST_collect to return only a GeometryCollection

In the postgis documentation it is mentioned that ST_collect returns a MULTI* or a GEOMETRYCOLLECTION. But how can I force the function to only return a GeometryCollection not depending on it's input ...
Manuel's user avatar
  • 297
8 votes
0 answers
2k views

Can I use GeoJSON GeometryCollection in QGIS?

I want to create a GeoJSON that contains multiple geometries to be used in QGis later on. Now I red through the specs here: http://geojson.org/geojson-spec.html#geometrycollection When I simply copy ...
Yojimbo's user avatar
  • 393
0 votes
1 answer
2k views

GeometryCollection styling in Geoserver

I am trying to style an GeometryCollection geometry data type from PotGIS table in Geoserver. I have not found any examples on the Internet how to do it nor is it supported in Geoserver or not. When I ...
Mario Miler's user avatar
  • 3,365