GeoTools

Polygon with holes not handled by

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.3.0
  • Fix Version/s: 2.6-M2
  • Component/s: arcsde plugin
  • Labels:
    None
  • Environment:
    Java 1.5.x, Linux centos/redhat 4.x, ArcSDE 9.0, Oracle 10,9

Description

If you read polygons with holes from using Polygon type from the oracle database, the holes are not read. A work around for this has bug ha in years been to use MulitiPolygon, but that causes invalid shape files for Arcview.

The bug is line 883 and 892 in the file plugin/arcsde/datastore/src/org/geotools/data/arcsde/GeometryBuilder.java

Current code is
883:int nHoles = parts.length - 1;
892:linearCoordArray = parts[i + 1][0];

I have changed my own code to the following and then
it works ok with polygon.
883:int nHoles = parts[0].length - 1;
892:linearCoordArray = parts[0][i + 1];

I have tested this with many many hundred thousand of polygons and so far
this have worked ok. I will test it with Arcsde 9.2 next week.

Activity

Hide
Lars Aksel Opsahl added a comment -
I have now tested the code with ArcSDE 9.2 and it works ok.
Show
Lars Aksel Opsahl added a comment - I have now tested the code with ArcSDE 9.2 and it works ok.
Hide
Gabriel Roldán added a comment -
thanks Lars for catching this out and the patch. I'll try to fix it on svn this afternoon at after office hour.
Show
Gabriel Roldán added a comment - thanks Lars for catching this out and the patch. I'll try to fix it on svn this afternoon at after office hour.
Hide
Gabriel Roldán added a comment -
added a unit test that exposes the problem when storing a polygon with holes and then reading it back from the database (rev #29645)
Show
Gabriel Roldán added a comment - added a unit test that exposes the problem when storing a polygon with holes and then reading it back from the database (rev #29645)
Hide
Gabriel Roldán added a comment -
problem was already fixed, reenabled the failing tests as for r33610
Show
Gabriel Roldán added a comment - problem was already fixed, reenabled the failing tests as for r33610

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: