KML does not write Z value if dimension is greater than 3
---------------------------------------------------------

                 Key: GEOT-3201
                 URL: http://jira.codehaus.org/browse/GEOT-3201
             Project: GeoTools
          Issue Type: Bug
          Components: core xml
    Affects Versions: 2.7-M2
            Reporter: Jose Martinez-Llario
            Priority: Minor


When I use GeoTools to encode a geometry into a KML I have a problem when my 
geometry has 4 dimensions: GeoTools skips the z coordinate in kml. I have 
modified JTS slightly to handle geometries with 4 dimensions.

I was wondering if it is possible to change the following line in the class:

 CoordinatesTypeBinding.java (org.geotools.kml.bindings). The change is just  
to change the == 3 by >= 3.

    public String encode(Object object, String value) throws Exception {
      ............
            if ( cs.getDimension() == 3 && !Double.isNaN( c.z ) ) {
                sb.append(",").append( c.z );
            }
    ..............
    }

Result:
public String encode(Object object, String value) throws Exception {
      ............
            if ( cs.getDimension() >= 3 && !Double.isNaN( c.z ) ) {
                sb.append(",").append( c.z );
            }
    ..............
    }

The code will work exactly the same way than before but it will write the z 
coordinate with 4 dimension coodinates.

Hope it can help.


-- 
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

        

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to