4

I am translating an input that describes zones by mixing segments and arcs. Arcs are given by a center, 2 points (beginning/end of arc) and a direction (CW or CCW). In a first prototypes using GDAL, I inspected once how the points were sorted after the call to .buffer() and made the assumption that they will always be in the same direction. Then I moved my code to shapely, and it looks like the direction used is not the same, so I'm back to inspecting and hardcoding the internal direction.

But my guess is that this is not the correct way of dealing with circle direction. Should I check after every calls to .buffer() the direction in which the points are ordered ? If so, is there a well known method to compute the direction ?

  • Are you really just asking for a quick test to determine the ordering of vertices in a polygonal approximation to a circular arc? (If so, there's a simple one...) – whuber Jan 13 '12 at 14:16
1

Sounds like a question for the GIS-Python list: http://lists.gispython.org/mailman/listinfo/community. (Note: in Feb 2011, I was thinking "why the hell do I have to field Shapely questions on some other forum?", but in Jan 2012 I am thinking "why the hell not?")

Update: In Shapely 1.2.10 there is a boolean .is_ccw property and an .orient() function for making particularly oriented copies of polygons .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.