-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
Per updated GeoJSON spec: https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6
Polygon specification now indicates:
A linear ring MUST follow the right-hand rule with respect to the
area it bounds, i.e., exterior rings are counterclockwise, and
holes are clockwise.
Problem:
mercantile utilizes clockwise pattern which is the inverse of specified counter-clockwise pattern for polygon feature creation.
Impacted LoC:
mercantile/mercantile/__init__.py
Line 835 in fe3762d
| [[west, south], [west, north], [east, north], [east, south], [west, south]] |
Short term workaround for my use case:
def as_geom(qk: str):
t = mercantile.quadkey_to_tile(qk)
west, south, east, north = mercantile.bounds(t)
return {
"type": "Polygon",
"coordinates": [[
[east, north],
[west, north],
[west, south],
[east, south],
[east, north],
]],
}
Metadata
Metadata
Assignees
Labels
No labels