LiteCoordinateSequence converts 2D to 3D
----------------------------------------

                 Key: GEOT-970
                 URL: http://jira.codehaus.org/browse/GEOT-970
             Project: GeoTools
          Issue Type: Bug
          Components: core geometry, core main
    Affects Versions: 2.3.M0, 2.2.0
            Reporter: Cory Horner
         Assigned To: Cory Horner
             Fix For: 2.2.1, 2.3


This problem is revealed by exporting a postgis layer in uDig to shapefile.  In 
IndexedShapefileDataStore#write(), the line:

int dims = JTSUtilities.guessCoorinateDims(g.getCoordinates());

demonstrates a 2D point going in, and a 3D point coming out.  

LiteCoordinateSequence should set the Z coordinate to be Double.NaN rather than 
0.0.

Index: src/org/geotools/util/LiteCoordinateSequence.java
===================================================================
--- src/org/geotools/util/LiteCoordinateSequence.java   (revision 21873)
+++ src/org/geotools/util/LiteCoordinateSequence.java   (working copy)
@@ -99,7 +99,7 @@
     public Coordinate getCoordinateInternal(int i) {
       double x = coords[i * dimension];
       double y = coords[i * dimension + 1];
-      double z = dimension == 2 ? 0.0 : coords[i * dimension + 2];
+      double z = dimension == 2 ? java.lang.Double.NaN : coords[i * dimension 
+ 2];
       return new Coordinate(x, y, z);
     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to