thomersch / grandine

Processing geo data is no fun. Grandine changes this.
Apache License 2.0
53 stars 3 forks source link

GeoJSON output should follow RFC7946 winding order #3

Closed grischard closed 4 years ago

grischard commented 4 years ago

The GeoJSON specification is picky about winding order.

Grandine should only produce GeoJSON that winds according to rfc7946. There is code that is already supposed to do that, but output from grandine still has rings that aren't rewound correctly.

To reproduce, run the geojsonhint command line tool or geojsonlint.com on a tile produced by grandine.

> geojsonhint 43.geojson
    20:1  warning  Polygons and MultiPolygons should follow the right-hand rule
    60:1  warning  Polygons and MultiPolygons should follow the right-hand rule
   512:1  warning  Polygons and MultiPolygons should follow the right-hand rule
   552:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1004:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1044:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1494:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1536:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1583:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1626:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1673:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1716:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1763:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1806:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1853:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1916:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  1979:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  2061:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  2131:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  2203:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  2493:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  2782:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  3071:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  3599:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  3877:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  4175:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  4285:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  4392:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  4443:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  4508:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  4559:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  4609:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  4653:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  5585:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  6515:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  6562:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  6613:1  warning  Polygons and MultiPolygons should follow the right-hand rule
  6662:1  warning  Polygons and MultiPolygons should follow the right-hand rule

⚠ 38 warnings
thomersch commented 4 years ago

As far as I remember, I rewind while reading, but not before writing. So if the clipping algorithm returns junk, I need to reorder again.

thomersch commented 4 years ago

Fixed in 912985f0e2e749f41b6f959b99c806bdc4acceac