Skip to content
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

Clarify use of "GEOMETRY" for unknown or multiple geometry types #525

Closed
jyutzler opened this issue May 14, 2020 · 6 comments · Fixed by #528
Closed

Clarify use of "GEOMETRY" for unknown or multiple geometry types #525

jyutzler opened this issue May 14, 2020 · 6 comments · Fixed by #528
Milestone

Comments

@jyutzler
Copy link
Contributor

We are occasionally seeing GeoPackages that have, for example, both polygon and multipolygon geometries in a table registered in gpkg_geometry_columns as POLYGON. According to Requirement 31 this is not allowed and GEOMETRY must be used, but we can be more clear about this.

@jerstlouis
Copy link
Member

Yet, in the context of vector tiles in particular (whether encoded as GeoJSON or MVT), where lines or polygons can be clipped out or split in two, it would be highly desirable to have a type allowing for both the single and multiple flavors of the same basic geometry type (a way to allow e.g. only MultiLineString and LineString).

@jyutzler
Copy link
Contributor Author

While it would be useful, I don't see how we can get there without breaking things. Just use GEOMETRY for these.

@jerstlouis
Copy link
Member

@jyutzler Well I do encourage clarifying the text as you suggest above. Just meant to highlight why people might be doing this, and still hoping something can be done in the context of the vector tiles extension :)

@cnreediii
Copy link
Contributor

Jerome -

Just wondering. If a large meandering polygon is clipped in a tiled data store such that multiple pieces of that big polygon now exist in the tile I still do not see the need for using "multipolygon" as a geometry type. Reassembling the pieces from one or more tiles into the original polygon is an implementation issue and I do not see how using multipolygon helps. Are you thinking that the constituent pieces of the large polygon that is clipped into smaller pieces should be organized in the GeoPackage so that they are all "next" to each other storage-wise and hence should be labeled as multipolygon? Thanks

@jerstlouis
Copy link
Member

@cnreediii The tiled data store use case (at least as implemented in the Vector Tiles Extensions) is different from the main geometry table case discussed in this issue.

If considering a single tile, e.g. encoded as GeoJSON, if multiple polygons are part of the same feature, with the same id and properties, they should be in the same MultiPolygon.
The natural way to encode the feature inside a tile which has a single polygon in GeoJSON would be with a Polygon, while a feature with multiple polygons would be a MultiPolygon.
Same with Mapbox vector tiles, which doesn't really have a Polygon/MultiPolygon distinction.

In the core untiled GeoPackage vector table, a feature only has a single geometry piece.
Potentially some features might require the use of MultiPolygon, while others could be described with Polygon. Requirement 31 however says that if they are mixed the proper type should be GEOMETRY, rather than POLYGON.

The earlier suggestion I made in the context of the vector tile extension was to introduce the concept of single+multi LINESTRING allowing both LineString and MultiLineString (for the vector tile extension only, where that would not break existing implementations, and because it is in the vector tiles nature to have a mix of single/multi geometry).

@jyutzler
Copy link
Contributor Author

See 888094c.

@jyutzler jyutzler added this to the 1.3.0 milestone May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants