Milton Jonathan ha scritto:
> Hello Andrea
>
> Hmm, so instead of CRS.lookupEpsgCode(refSys, true), you would suggest
> something like:
>
> SRID = CRS.lookupIdentifier(refSys, true);
> if (SRID != null)
> SRID = SRID.substring(SRID.indexOf(':')+1);
>
> If I understand it well, the advantage is that this will work even if
> the authority being used (or the authority that has a matching code for
> the refSys) is not the EPSG one, right?
Yeah, but that's not the main advantage I see. If you have a feature
type coming from a shapefile whose .prj contains:
GEOGCS["GCS_WGS_1984",DATUM["WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
the resulting CRS will have no identifier whatsoever, yet
the above method should be able to identify it as 4326 anyways
(provided "WGS_1984" is a valid EPSG datum identifier).
> Actually, when I read your e-mail I thought at first about using:
> SRID = CRS.lookupIdentifier(Citations.POSTGIS, refSys, true);
>
> But then it returned null - I guess because the Postgis EPSG jar is not
> being used (and shouldn't be, right? only one epsg jar at a time, if I
> recall correctly..?)
Indeed, just one at a time. The PostGIS authority is just a clone of
the hsql one that stores the data into PostgreSQL instead of HSQL,
there are no significant gains with using it unless you have several
other applications hitting the same authority and you want to
centralize storage of the SRS data.
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
-------------------------------------------------------------------------
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