[gdal-dev] Time for a new GeoJSON driver?

Jukka Rahkonen jukka.rahkonen at maanmittauslaitos.fi
Mon Jul 25 18:36:44 PDT 2016


Sean Gillies <sean <at> mapbox.com> writes:

> 
> 
> On Mon, Jul 25, 2016 at 5:24 PM, Jukka Rahkonen <jukka.rahkonen <at>
maanmittauslaitos.fi> wrote:
> Even Rouault <even.rouault <at> spatialys.com> writes:
> > - right hand rule of polygonsWhich means actually left hand rule if I
have understood the right hand/left
> hand rules correctly. If you walk along the polygon rings the name of the
> rule is telling where the interior of the polygon is. If you follow the
> outer ring that is winding counterclockwise the interior in on your left
> hand side.
> I may be wrong. And the rule does not explicitly say anything about people
> walking backwards.
> 
> This is the reference for the right-hand rule:
>   https://en.wikipedia.org/wiki/Right-hand_rule
> 
> 
> A polygon patch with a positive area has a normal vector pointing "up",
away from the center of the earth. Point your thumb of your right hand in
the same direction and the curl of your fingers indicates the winding order
of the polygon vertices.
> OGC 06-142r1 "GML 3.1.1 PIDF-LO Shape Application Schema for use by the
Internet Engineering Task Force (IETF)" uses the same right-hand rule as
GeoJSON.
> -- Sean Gillies

All right, there is one right hand rule for mathematics and physics, and
another right hand rule for GIS, as it appears in the shapefile
specification and for example PostGIS documentation
http://postgis.net/docs/ST_ForceRHR.html. Very typical, I should not be
surprised.

You throw away the CRS because it made confusion, I suggest to send the
right hand rule to the same address. Clockwise and counterclockwise are more
explicit even I know that hairdressers do have counterclockwise running
clocks for customers who can see them only from the mirrors.

I went through about hundred hits about the right hand rule and
statistically your party wins clearly. Mainly ESRI and this guy resist:

> On Sat, Mar 11, 2006 at 09:49:04PM -0800, Paul Ramsey wrote:
>> "Right hand rule" means "if I walk along the boundary of the polygon
>> with my right hand extended, it is always inside the polygon".  So
>> the external rings go clockwise, and the internal rings go anti-
>> clockwise.

Keep your right hand ready for a beer if we ever meet.

-Jukka Rahkonen-



More information about the gdal-dev mailing list