navibyte / geospatial

Geospatial data structures, tools and utilities for Dart and Flutter.
Other
51 stars 5 forks source link

Handle the special case of bbox or geometries containing or touching north (latitude 90 deg) or south (latitude -90 deg) poles #209

Closed navispatial closed 8 months ago

navispatial commented 9 months ago

See also #185 about anti-meridian (longitude 180 deg).

navispatial commented 9 months ago

RFC 7946 about GeoJSON talks about this issue in chapter 5 about bounding boxes:

   A bounding box that contains the North Pole extends from a southwest
   corner of "minlat" degrees N, 180 degrees W to a northeast corner of
   90 degrees N, 180 degrees E.  Viewed on a globe, this bounding box
   approximates a spherical cap bounded by the "minlat" circle of
   latitude.

   "bbox": [-180.0, minlat, 180.0, 90.0]

   A bounding box that contains the South Pole extends from a southwest
   corner of 90 degrees S, 180 degrees W to a northeast corner of
   "maxlat" degrees S, 180 degrees E.

   "bbox": [-180.0, -90.0, 180.0, maxlat]

   A bounding box that just touches the North Pole and forms a slice of
   an approximate spherical cap when viewed on a globe extends from a
   southwest corner of "minlat" degrees N and "westlon" degrees E to a
   northeast corner of 90 degrees N and "eastlon" degrees E.

   "bbox": [westlon, minlat, eastlon, 90.0]

   Similarly, a bounding box that just touches the South Pole and forms
   a slice of an approximate spherical cap when viewed on a globe has
   the following representation in GeoJSON.

   "bbox": [westlon, -90.0, eastlon, maxlat]

   Implementers MUST NOT use latitude values greater than 90 or less
   than -90 to imply an extent that is not a spherical cap.
navispatial commented 8 months ago

Implemented in geobase 1.0.0.