Modify

Opened 11 years ago

Closed 11 years ago

#8309 closed defect (fixed)

org.openstreetmap.josm.io.IllegalDataException while opening shapefile with opendata

Reported by: naoliv Owned by: Don-vip
Priority: normal Milestone:
Component: Plugin opendata Version: latest
Keywords: Cc:

Description

Got this while trying to open the attached shapefile:

org.openstreetmap.josm.io.IllegalDataException: java.io.IOException: org.openstreetmap.josm.plugins.opendata.core.io.geographic.GeoCrsException: Unable to detect CRS !
        at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpImporter.parseDataSet(ShpImporter.java:38)
        at org.openstreetmap.josm.io.OsmImporter.loadLayer(OsmImporter.java:90)
        at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:71)
        at org.openstreetmap.josm.io.OsmImporter.importData(OsmImporter.java:59)
        at org.openstreetmap.josm.plugins.opendata.core.io.AbstractImporter.importData(AbstractImporter.java:65)
        at org.openstreetmap.josm.io.FileImporter.importDataHandleExceptions(FileImporter.java:66)
        at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.importData(OpenFileAction.java:328)
        at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.realRun(OpenFileAction.java:271)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:82)
        at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:145)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: org.openstreetmap.josm.plugins.opendata.core.io.geographic.GeoCrsException: Unable to detect CRS !
        at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parse(ShpReader.java:215)
        at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parseDataSet(ShpReader.java:75)
        at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpImporter.parseDataSet(ShpImporter.java:36)
        ... 15 more
Caused by: org.openstreetmap.josm.plugins.opendata.core.io.geographic.GeoCrsException: Unable to detect CRS !
        at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parseFeature(ShpReader.java:95)
        at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parse(ShpReader.java:192)
        ... 17 more

Josm info:

Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2012-12-30 02:31:41
Last Changed Author: Don-vip
Revision: 5646
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2012-12-29 16:07:47 +0100 (Sat, 29 Dec 2012)
Last Changed Rev: 5646

Identification: JOSM/1.5 (5646 pt_BR)
Memory Usage: 414 MB / 1756 MB (123 MB allocated, but free)
Java version: 1.7.0_09, Oracle Corporation, OpenJDK 64-Bit Server VM
Operating system: Linux

Plugin: Create_grid_of_ways (28412)
Plugin: PicLayer (28807)
Plugin: SimplifyArea (28807)
Plugin: buildings_tools (28891)
Plugin: editgpx (28807)
Plugin: geotools (29116)
Plugin: graphview (28807)
Plugin: jts (28945)
Plugin: merge-overlap (28807)
Plugin: opendata (29115)
Plugin: pdfimport (28807)
Plugin: reverter (28820)
Plugin: turnrestrictions (28807)
Plugin: undelete (28807)
Plugin: utilsplugin2 (29124)

Attachments (1)

shape.tar.bz2 (1.6 MB ) - added by naoliv 11 years ago.
File that throws exception while trying to open

Download all attachments as: .zip

Change History (4)

by naoliv, 11 years ago

Attachment: shape.tar.bz2 added

File that throws exception while trying to open

comment:1 by Don-vip, 11 years ago

Shapefiles usually come with an attached .prj file that contains information about the projection used. This one does not contain such a file, so the plugin cannot guesss which projection to use. Where does your file come from ?

comment:2 by naoliv, 11 years ago

It's from a federal governmental agency. They only provide the dbf, shp and shx files.
With ogr2osm it gives "No projection metadata, falling back to EPSG:4326".

When no info is available, couldn't the plugin provide a list of projections to be selected or, at least, use one default that could cause the least harm possible, like ogr2osm? (instead only giving an exception)

comment:3 by Don-vip, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in [o29497].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.