Wow that is an old page :-) Question - what version of GeoTools are you using?
Can this example work for you? - http://docs.codehaus.org/display/GEOTDOC/04+How+to+Read+a+Shapefile The example is written for GeoTools 2.5, but the process is similar for GeoTools 2.4.1. Your exception does not make a great deal of sense to me, Hints.FEAURE_DETACHED is used by things like the renderer that want to make sure that they can directly hack at the Geometry information without messing up the original. Kind of a "not only am I read-only; the copy I have is completely separate from the origional data". Only other thing I can think of is that you do not have all the jar files you need in order to run? The link above should help with that. Jody > Hey guys, I’m new at this and I’ve been trying to use some of the data > reading examples on the website (e.g. > http://geotools.codehaus.org/Data+Reading). Here’s the code I have: > > *import* java.net.URL; > > *import* org.geotools.data._shapefile_.ShapefileDataStore; > > *public* *class* NeighborhoodsIndexer { > > *public* *static* *void* main(String[] args) *throws* Exception { > > String shpPath = "file:/C:/temp/neighborhoods.shp"; > > URL shapeURL = *new* URL(shpPath); > > ShapefileDataStore store = *new* ShapefileDataStore(shapeURL); > > } > > > Here’s the stack trace: > > Exception in thread "main" java.lang.NoSuchFieldError: FEATURE_DETACHED > > at > org.geotools.data.shapefile.ShapefileDataStore.<clinit>(_ShapefileDataStore.java:124_) > > at > com.dexknows.indexer.NeighborhoodsIndexer.main(_NeighborhoodsIndexer.java:11_) > > Does anyone know how to overcome this one? > > Thanks- > > Eric > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > 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
