Ah ! So for Eric's Coordinate array he can use the static
CGAlgorithms.isCCW(Coordinate[]) function.
These queries are great for exploring the back passages of geotools :)
Just had a look at the code for that function - those jts folk are so clever !
Michael
On Fri, Jun 6, 2008 at 7:10 AM, Jody Garnett <[EMAIL PROTECTED]> wrote:
> I found the following code in the SDO utility class; it is not really the
> best location for this sort of thing...
>
> /** Used to test for Counter Clockwise or Clockwise Linear Rings */
> private static RobustCGAlgorithms clock = new RobustCGAlgorithms();
>
> public static CoordinateSequence counterClockWise(
> CoordinateSequenceFactory factory, CoordinateSequence ring) {
> if (clock.isCCW(ring.toCoordinateArray())) {
> return ring;
> }
> return Coordinates.reverse(factory, ring);
> }
>
> Michael Bedward wrote:
>>
>> Hi Eric
>>
>> There may be an easier way, but the JTS class CoordinateArrays has a
>> method ensureOrientation which might help you.
>>
>> Michael
>>
>> On Thu, Jun 5, 2008 at 1:43 PM, Angel, Eric <[EMAIL PROTECTED]> wrote:
>>
>>>
>>> Does anyone know of a way to determine if a Coordinate[] is CW or CCW?
>>> My assumption of CW ordering creates really bad polygons from the US Census
>>> shapefiles (Current Place).
>>>
>>>
>>> Thanks,
>>>
>>> Eric
>>>
>
>
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users