The general rule is that if you're walking the border in the order that it's 
given, then your left hand is inside the area, and your right hand is outside. 
That allows you to define holes, multipolys, etc in the same format without 
needing extra flags.

Remember that "polygon" is a very loosely used term here. So it's perfectly 
legit to enter a "poly" as a single line/border in a clockwise direction. That 
just means that your "poly" is infinite in the plane and has a single hole in 
it.

So if a mirroring function is just inverting the sign of all the X or Y 
coordinates and not re-ordering the verticies in each sub-border, then it's a 
bug. And if it's treating a shape as equivalent to "everything except that 
shape" then it's also a bug.


(Unrelated note: I know the module is "geo <space> poly" as two words, but I 
can't help but always pronounce it in a way that rhymes with monopoly. Would 
anyone be up for a game of Mono Poly?)



-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Graham Hardman
Sent: Saturday, November 17, 2018 8:37 PM
To: sqlite-users@mailinglists.sqlite.org
Subject: [sqlite] geopoly - rules re data entry

Hi, 

The documentation for the geopoly module states that the vertices must
be defined in a counter-clockwise order so that the interior of the
polygon is on the left of the element as it is drawn. 

However, I have discovered that a polygon transformed with geopoly_xform
can result in a polygon having vertices reading clockwise. For instance,
a polygon mirrored about either the x or y axis will produce this
effect. The geopoly module allows these transformed polygons to be added
to the table. If I then create an exact same polygon shape having
counterclockwise order for the vertices and use the geopoly_overlap
function to test it against the one with clockwise order I find the
result = 4, meaning the polygons are regarded as identical. 

My question then is, is it really necessary to ensure a counterclockwise
order when a polygon shape is entered for the first time in the table. 

regards, 

Graham
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to