-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for GeoJSON GeometryCollections #32747
Comments
I just ran into this now, geojson.io displays the Polygons within the GeometryCollection, but not QGIS. PS. I try to maintain https://github.com/beyondtracks/nsw-rfs-majorincidents-geojson which aims to clean up RFS's feed based on my personal preferences. It also tries to remove unnecessary GeometryCollections, eg. a GeometryCollection containing just a single Point gets simplified to a Point, but where you have a Point for the icon/centroid and a Polygon for the fire extent, GeometryCollection is the only way to handle this. Update: I've updated the repo above to accept an |
@andrewharvey and @tastrax - this is because of the fact that QGIS only supports one geometry type per layer. What QGIS could do is offer to extract either points, linestrings or polygons from the Geojson, meaning that only parts of the geometries of a geometry collection would be displayed. Or it could offer to paste it as several layers. |
I would be happy pasted as several layers but I would assume that it would no longer be a “live” layer that I could refresh over time? @andreasneumann |
Yep I'd expect it to split into separate layers, it already does this for mixed geometry features within a feature collection, just not mixed geometry within a GeometryCollection for a single feature. This does mean that you'll end up with duplicate features and loose the association between the items in the GeometryCollection, but I think that's fine. |
I still hope that one day QGIS will support mixed geometry types per layer natively. We can already mix types by using geometry generators ... but this is just for display. Of course there are lots of problems ahead, because many parts in the code base assume there is only one geometry type per layer. Perhaps with QGIS 4.x we could start introducing these mixed geometry layers ... |
I wonder if this could be solved with a new layer preference, in which we could specify the mapping between the original GeoJSON geometry and the geometry we want to show. If a have a geometry collection with a point and a polygon, I would define something like this in one layer In addition to solving the To draw vectors and a bounding boxes for the above example now, I have to create multiple GeoJSON files and repeat feature attributes, which takes up disk space. If QGIS supported GeoJSON geometry transformation like described above, I could stick with just one |
@tastrax Can you change this issue title to mention GeometryCollection? |
No further development has occurred on GEOJSON Geometry Collections as far as I am aware
From: Mike Cusi ***@***.***>
Sent: Monday, September 11, 2023 10:38 AM
To: qgis/QGIS ***@***.***>
Cc: Phil Wyatt ***@***.***>; Mention ***@***.***>
Subject: Re: [qgis/QGIS] Add support for GeoJSON GeometryCollections (#32747)
Hi @tastrax <https://github.com/tastrax> has there been any development that will allow loading the live NSW RFS feed which includes the geomtery collection and not just the points?
—
Reply to this email directly, view it on GitHub <#32747 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACC6NY64DORTND3YMZIGVSLXZZMQHANCNFSM4JLD3PEQ> .
You are receiving this because you were mentioned. <https://github.com/notifications/beacon/ACC6NY36KCPVWASMDSPQBVTXZZMQHA5CNFSM4JLD3PE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOMYNDMTQ.gif> Message ID: ***@***.*** ***@***.***> >
|
The same issue for flatgeobuf geometries wrapped in GeometryCollection.
Example data: You may ask, why not just remove the GeometryCollection wrapper from each geom, before converting to flatgeobuf. The issue is that importing flatgeobuf files containing mixed geometry types does not work in PostGIS. The geoms must first be homogenised by wrapping in a GeometryCollection for each geom using |
I have run into this issue recently, as well. I have GeoJSON files (per a spec) with four different types of features. Some have simple geometries (eg., Polygon or MultiPolygon) and some have GeometryCollections containinig both Points and Multipolygons (i.e, center-points and detections). Each type also has a completely different set of properties. 3 of the feature types basically encode metadata about the overall file contents and sources (eg. images that were used), with the bulk of the features of the last type constituting what we would consider a traditional "attribute table". Currently, I am using python code to replace the items with GeometryCollections with just the polygon item and writing it to a 2nd file. It fixes my immediate display problem in QGIS, but not the manipulation problem. I think @andreasneumann is on the right track, as QGIS 4.0 takes shape, we need a better way to handle these not-so-tabular data formats like GeoJSON, without losing connection to the original data. The Layer should represent the entire dataset, but then consist of several "sublayers" of the parts of the dataset that are similar - i.e., have similar geometry types and similar properties. Regarding mixed geometries and collections, is there a good reason why they could not be represented/displayed as single object, where the user can decide (e.g., via symbology) which to display (either or both or many). Maybe points and polygons and lines could be addressed via different sublayers or sub-sublayers. Thoughts anyone... |
Feature description.
Allow the use of geojson collections
Additional context
Many geojsons now have mixed geometries and unfortunately QGIS does not display them in the map interface. In the example below points work but not the collections
Sample URL - http://www.rfs.nsw.gov.au/feeds/majorIncidents.json
should match - https://www.rfs.nsw.gov.au/fire-information/fires-near-me
The text was updated successfully, but these errors were encountered: