The shapefile code will read the prj file for you; the value is available as:
CoordianteReferenceSystem sourceCRS = shapefiledatastore.getSchema().getDefaultGeometry().getCoordianteReferenceSystem(). I am a bit worried that cannot understand your problem; reading you email it sounds like the above value would be a "state plane" format? And you may be asking how to reproject the data to "EPSG:4326". If you simply want find the best match for sourceCRS and ask the data store to use it ... CoordianteReferenceSystem exactCRS = CRS.lookupIdentifier( sourceCRS, true ); shapefiledatastore.forceCRS( exactCRS ); // this exact CRS from the epsg database will be used by the shapefile from here on out Cheers, Jody Links: http://docs.codehaus.org/display/GEOTDOC/01+CRS+Helper+Class http://docs.codehaus.org/display/GEOTDOC/Shapefile+Plugin > pilloff a écrit : > >> Can the shapefile reader look in the .prj file >> and the GeoTools supplied CRS database and determine the best match >> automatically? >> > > You may read the content of .prj file as WKT and gives it to > > CRS.parseWKT(String) > > If you really need an EPSG code, it may be worth to try CRS.lookupIdentifier. > > Martin > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Geotools-gt2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
