Hi,
investigating why saving a feature type was taking so long
on trunk I found out this code:

@Override
public String toString(Object obj) {
     CoordinateReferenceSystem crs = (CoordinateReferenceSystem) obj;
     try {
         return "EPSG:" + CRS.lookupEpsgCode(crs, true);
     }
     catch (FactoryException e) {
         XStreamPersister.LOGGER.warning( "Could not determine epsg code 
of crs, encoding as WKT");
         return crs.toWKT();
     }
}

Doing a full lookup can take a whole lot of time, can't we
use lookupEpsgCode(crs, false) instead, or just save the
wkt form? In any case we're saving the native CRS there,
I don't believe any significant information will be lost
if we just use the WKT form (and if the native code came
from a EPSG id, like those coming from postgis, the
lookupEspgCode(crs, false) will quickly catch the official
code anyways).

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to