[Gdal-dev] SDE Driver Change

Christian Ratliff Christian.Ratliff at delorme.com
Fri Oct 27 08:47:13 EDT 2006


  Perhaps you can help me figure out this puzzle. In a multi-polygon,
from what I can find, the OGRLinearRing::isClockwise() function is the
way to determine if a ring is a contour (clockwise) or a hole
(counter-clockwise). When reading GML, MIF, TAB and SHP if isClockwise()
is true then the ring is a contour, otherwise it is a hole.  However,
when reading from ARC/SDE the behavior was opposite.

  I would rather avoid encoding knowledge of the data source in to the
OGR geometry processor code, up in my application.  Except for that
option, how is one to determine the implication of isClockwise() or
perhaps I totally flubbed and missed a 'isHole()' method somewhere?

Thanks!
christian

-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Thursday, October 26, 2006 2:15 PM
To: Christian Ratliff
Cc: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] SDE Driver Change

Christian Ratliff wrote:
>  
>   During the QA process for our product, we noticed polygons were 
> being read from ARC/SDE with a reversed (left hand) winding.  This 
> results in
> isClockwise() returning the wrong value for all such polygons.  I 
> updated the SDE driver with the change indicated below and then 
> re-tested SDE and non-SDE data sources.  Everything looks good now:
>  
> src/ogr/ogrsf_formats/sde/ogrsdelayer.cpp
> 719c723
> <     nSDEErr = SE_shape_get_all_points( hShape, SE_DEFAULT_ROTATION,
> ---
>>     nSDEErr = SE_shape_get_all_points( hShape, 
>> SE_RIGHT_HAND_ROTATION,

Christian,

There is no harm in doing this, but I would note that OGRPolygon rings
are not guaranteed to have any particular handedness.  So it is unwise
to build application on this assumption.

Best regards,
-- 
---------------------------------------+--------------------------------
---------------------------------------+------
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo,
http://osgeo.org






More information about the Gdal-dev mailing list