Hello,

I've done quite a bit of searching and haven't been able to find anyone who
solved this issue, so I'm hoping someone here can help.

I'm using gt-shapefile 14.0.

I have a series of ESRI shape files and only one in the whole batch is
causing failure. I'm downloading the shape file (and its associated prj,
etc.) from here:

http://tfr.faa.gov/save_pages/5_5245.shp.zip

I can open it in QGIS and see the shape over Guam. However, when I perform
the following in Scala (shape file path is already extracted and defined):

val shapeFile = new File(shapeFilePath)
val dataFile = FileDataStoreFinder.getDataStore(shapeFile)
val source = dataFile.getFeatureSource
val schema = source.getSchema

It errors on the last line with the following stack trace:

Exception in thread "main"
org.opengis.parameter.InvalidParameterValueException: Value -215.143 is out
of range [-180..180].
at org.geotools.parameter.Parameter.ensureValidValue(Parameter.java:290)
at org.geotools.parameter.Parameter.setValue(Parameter.java:620)
at org.geotools.referencing.wkt.Parser.parseProjection(Parser.java:625)
at org.geotools.referencing.wkt.Parser.parseProjCS(Parser.java:917)
at
org.geotools.referencing.wkt.Parser.parseCoordinateReferenceSystem(Parser.java:225)
at
org.geotools.referencing.wkt.Parser.parseCoordinateReferenceSystem(Parser.java:204)
at
org.geotools.referencing.factory.ReferencingObjectFactory.createFromWKT(ReferencingObjectFactory.java:1090)
at org.geotools.data.PrjFileReader.<init>(PrjFileReader.java:94)
at org.geotools.data.PrjFileReader.<init>(PrjFileReader.java:68)
at
org.geotools.data.shapefile.ShapefileSetManager.openPrjReader(ShapefileSetManager.java:106)
at
org.geotools.data.shapefile.ShapefileFeatureSource.readAttributes(ShapefileFeatureSource.java:516)
at
org.geotools.data.shapefile.ShapefileFeatureSource.buildFeatureType(ShapefileFeatureSource.java:472)
at
org.geotools.data.shapefile.ShapefileFeatureStore.buildFeatureType(ShapefileFeatureStore.java:131)
at
org.geotools.data.store.ContentFeatureSource.getAbsoluteSchema(ContentFeatureSource.java:343)
at
org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:312)
at
org.geotools.data.store.ContentFeatureSource.getSchema(ContentFeatureSource.java:112)

It's obviously telling me that it thinks it found a long out of range, but
I'm able to load and map the ShapeFile in other programs.

Any advice on this?

Thanks for reading!
------------------------------------------------------------------------------
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to