From: Alessio F. <ale...@gm...> - 2006-05-17 13:12:59
|
Hi list, I would like to start a discussion about the following problem: 1 - Creating a DefaultMapContext and setting up an area of interest with a CRS will produce a ReferencedEnvelope inside this, i.e. a jts Envelope (tha= t is always longitude-latitude on my understanding) plus a CRS which could have any kind of Axis orientation. 2 - Consider the queryLayer method of the StreamingRenderer, when the SourceCRS (the one from the FeatureSource Geometry attribute) ... CoordinateReferenceSystem sourceCrs =3D currLayer .getFeatureSource().getSchema( ).getDefaultGeometry() .getCoordinateSystem() ... is different from the DestinationCRS (the final map CRS), the method performs the following operations: ... transform =3D operationFactory.createOperation(destinationCrs, sourceCrs).getMathTransform(); if (transform !=3D null && !transform.isIdentity()) { ... envelope =3D JTS.transform(envelope, null, transform, 10); ... } ... The envelope is a ReferencedEnvelope. Now consider this test-case: ReferencedEnvelope =3D> jts Envelope (lon lat) + EPSG:4326 from hsql (lat lon) If the two CRSs have a different Axis orientation the final transform will swap the coordinates and the resulting envelope is unconsitent with the SourceCRS, because there is no check on the Axis orientation anywhere. The result is that the BBOX filter built by this method is wrong. Hope to see some comments and feedbacks about this. If you needed I can produce a real test-case where the method fails. Regards, Alessio. --=20 --------------------------------------------------------- Alessio Fabiani Software Engineer http://afabiani.wordpress.com --------------------------------------------------------- |