[Gvsig_english] clean polygon? Issue with layers imported fromOracle Spatial

Francisco José Peñarrubia fpenarru at gmail.com
Wed Feb 17 16:23:45 CET 2010


Hi Wolfgang.

As Jukka said, polygon orientation is different from Oracle and 
Shapefiles. And some other formats, may come with different orientation 
even inside the same file (DXF, for example). So, gvSIG uses a rule from 
Java:

<H3>WIND_NON_ZERO</H3><PRE>static final int <B>WIND_NON_ZERO</B></PRE> 
<DL> <DD>The winding rule constant for specifying a non-zero rule for 
determining the interior of a path. The non-zero rule specifies that a 
point lies inside the path if a ray drawn in any direction from that 
point to infinity is crossed by path segments a different number of 
times in the counter-clockwise direction than the clockwise direction. 
</DD></DL>

Is very common (at least, it was some years ago) that even shape files 
come with some polygons in one order and others the reverse.

That said, I agree about shape file writer in gvSIG. We should test the 
polygon before writing to the shape file, and change the orientation if 
needed. Even in edition mode could be a good idea to always use JTS 
orientation, and check every polygon with Geometry.isValid method.
To testers: We should point this as a bug, and try to fix them in 1.9 or 
in 2.0.

Best regards.

Fran Peñarrubia
www.scolab.es

Wolfgang Qual escribió:
> Dear list,
> in fact, exporting a shapefile to Oracle Spatial will result in change of
> the orientation of the vertices. When re-importing that Oracle spatial layer
> to shapefile (export Oracle Spatial layer to shapefile), this "oracle
> spatial" orientation of vertices will remain! Is it a bug? 
>
> Best,
> Wolfgang
>
>   



More information about the Gvsig_internacional mailing list