In doing some testing of DWITHIN with DB2, I found that it does not support the use of a units parameter in a query using a query like: query = new Query( "CUSTOMERS", CQL.toFilter("DWITHIN(GEOM, POINT(-121.914 37.311), 1.0, kilometers)") ); DB2 uses the distance value assuming it is in the coordinate system units which in this case are decimal degrees which returns a very different result from what is expected.
I've been able to correct the DB2 filter so that it produces the expected result although I'm not sure if this would change any current users of DWITHIN with the expectation that the units are ignored. It appears that CQL.toFilter() supports only the following values "\"feet\"", "\"meters\"", "\"statute miles\"", "\"nautical miles\"", "\"kilometers\"", It does not support a filter without one of these values. In poking around the source for other JDBC drivers, it seems that some ignore the units and others support different units from those allowed by CQL.toFilter(). The PostGIS code appears to support the following units: put("kilometers", 1000.0); put("kilometer", 1000.0); put("mm", 0.001); put("millimeter", 0.001); put("mi", 1609.344); put("miles", 1609.344); put("NM", 1852d); put("feet", 0.3048); put("ft", 0.3048); put("in", 0.0254); However it doesn't support "statute miles" or "nautical miles". CQL.toFilter() doesn't support plain "miles". The Oracle code appears to support the following units: put("metre", "m"); put("meters", "m"); put("kilometers", "km"); put("mi", "Mile"); put("miles", "Mile"); put("NM", "naut_mile"); put("feet", "foot"); put("ft", "foot"); put("in", "inch"); A similarly inconsistent set of units. Is there a logical explanation for this? --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today.http://sdm.link/intel _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users