Open3

GeoJSONまわりのメモ

yondayonda

geometryの2点間は180度線をまたがない。

https://tools.ietf.org/html/rfc7946#section-3.1.1

   A line between two positions is a straight Cartesian line, the
   shortest line between those two points in the coordinate reference
   system (see Section 4).

   In other words, every point on a line that does not cross the
   antimeridian between a point (lon0, lat0) and (lon1, lat1) can be
   calculated as

   F(lon, lat) = (lon0 + (lon1 - lon0) * t, lat0 + (lat1 - lat0) * t)
yondayonda

bboxは[west, south, east, north]で定義する。

https://tools.ietf.org/html/rfc7946#section-5.2

   Consider a set of point Features within the Fiji archipelago,
   straddling the antimeridian between 16 degrees S and 20 degrees S.
   The southwest corner of the box containing these Features is at 20
   degrees S and 177 degrees E, and the northwest corner is at 16
   degrees S and 178 degrees W.  The antimeridian-spanning GeoJSON
   bounding box for this FeatureCollection is

   "bbox": [177.0, -20.0, -178.0, -16.0]

   and covers 5 degrees of longitude.

[minlon, minlat, maxlon, maxlat]では上記を満たせない。

しかし[west, south, east, north]では
https://tools.ietf.org/html/rfc7946#section-5.1
(lon, lat) = (west + (east - west) * t, north)
を常に満たすことができない。
この式はあくまでstraddling the antimeridianしていない時に限るということか。

yondayonda

Polygonは

  • 最初の点と最後の点は同じ値で閉じている必要がある
  • 反時計回り(外側は)であるべきだが、古い規約では向きのルールがなかった。

https://tools.ietf.org/html/rfc7946#section-3.1.6

   o  The first and last positions are equivalent, and they MUST contain
      identical values; their representation SHOULD also be identical.

   o  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.

   Note: the [GJ2008] specification did not discuss linear ring winding
   order.  For backwards compatibility, parsers SHOULD NOT reject
   Polygons that do not follow the right-hand rule.