JDBCFeatureSourceTest cannot  work with DB2 Spatial Extender
------------------------------------------------------------

                 Key: GEOT-2109
                 URL: http://jira.codehaus.org/browse/GEOT-2109
             Project: GeoTools
          Issue Type: Improvement
          Components: data jdbc-ng
    Affects Versions: 2.6-M0
            Reporter: Christian Mueller


Reason 1) no rounding 

JDBCFeatureSourceTest>>testBoundary 

     assertEquals(0d, bounds.getMinX());
     assertEquals(0d, bounds.getMinY());
     assertEquals(2d, bounds.getMaxX());
     assertEquals(2d, bounds.getMaxY());

should check with rounding, the following would work:

     assertEquals(0d, new Double(Math.round(bounds.getMinX())));
     assertEquals(0d, new Double(Math.round(bounds.getMinY())));
     assertEquals(2d, new Double(Math.round(bounds.getMaxX())));
     assertEquals(2d, new Double(Math.round(bounds.getMaxY())));

The same holds true for 

JDBCFeatureSourceTest>>testBoundsWithQuery

     assertEquals(1d, new Double(Math.round(bounds.getMinX())));
     assertEquals(1d, new Double(Math.round(bounds.getMinY())));
     assertEquals(1d, new Double(Math.round(bounds.getMaxX())));
     assertEquals(1d, new Double(Math.round(bounds.getMaxY())));

Reason 2) CRS check in

JDBCFeatureSourceTest>>testSchema
JDBCFeatureSourceTest>>testBoundary 
JDBCFeatureSourceTest>>testBoundaryWithQuery 

The line 

assertEquals(CRS.decode("EPSG:4326"), bounds.getCoordinateReferenceSystem()); 

is hard stuff. DB2 Spatial Extender has his WGS 84 CRS , but it is not equal as 
implemented in geotools.

A good idea would be to introduce a protected method 

protected boolean areCRSEqual(crs1, csr2) {
  return crs1.equals(crs2);
}

und use it 

assertTrue(areCRSEqual(CRS.decode("EPSG:4326"), 
bounds.getCoordinateReferenceSystem()));

This would give me the possiblity to do my own special equal check in my Test 
class.


-- 
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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to