> Jesse Eichar <[EMAIL PROTECTED]> wrote on 11/03/2006 12:28:14 PM:
>
>> I have a map whose CRS was determined by the projection from a
>> Shapefile (WKT). I am adding a WMS layer which provides a set of
>> EPSG codes that it provides. I want to see if the CRS of the map
>> matches one of those EPSG codes. Currently we just hope that there
>> is an identifier indicating what CRS it is. We considered creating a
>> CRS for each EPSG code and creating the math transform, then checking
>> to see if it is an identity transform but that is too slow and
>> probably won't match as often as we want since its precision is most
>> likely very high.
The CRS.equalsIgnoreMetadata(...) method will probably be faster than comparing
the MathTransforms. This is already a kind of "loose equals", not numerically
but in the sense of ignoring metadata like "area of validity" and the EPSG
code.
However it doesn't solve the precision problem.
If we only want to check among a few CRS, this is probably the easiest solution
(except for numerical precision issue). If we want to get an EPSG code for an
arbitrary CRS by searching the whole EPSG database, then this is a significant
work. We should not try to modify an existing class; I don't believe they are
suitable for that. I believe that a brand new class would be necessary. The
purpose for this class would just be to reduce the search to a few CRS
candidates (not necessarly a single record), and from that point we would use
the existing classes for creating the few candidate CRS from the EPSG database
and compare them with the expected CRS.
An other solution is to compare only the CRS name. But I'm not sure that we can
rely on naming consistency between different CRS creators.
Is there any of the above paths that seem more appropriate for your goal?
Martin
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel