Opened 6 years ago
Closed 6 years ago
#17529 closed defect (fixed)
No Attributes for Shapefiles
Reported by: | elliottplack | Owned by: | openbrian |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Plugin opendata | Version: | tested |
Keywords: | tags attributes regression shapefile | Cc: |
Attachments (2)
Change History (17)
comment:1 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → needinfo |
comment:3 by , 6 years ago
It does happen with all shapefiles. I've tried three from unrelated sources, including one that I know worked in the past. Here's one for testing.
comment:4 by , 6 years ago
Keywords: | regression shapefile added |
---|---|
Owner: | changed from | to
Priority: | normal → major |
Status: | needinfo → new |
Confirmed.
@openbrian can you please take a look? It's a major regression.
comment:5 by , 6 years ago
Found a NPE in ShpReader.java line 288. I'm on it.
@elliottplack Can this shapefile be turned into a test case and committed to the JOSM repository?
comment:6 by , 6 years ago
2019-03-31 22:59:12.242 INFO: Open file: /home/brian/Workshop/Projects/JOSM/bug/17529/west_webmerc.shp (20396 bytes)
2019-03-31 22:59:12.425 INFO: Using charset UTF-8
2019-03-31 22:59:14.121 INFO: Loading ESRI WKID database...
2019-03-31 22:59:14.230 INFO: ESRI WKID database loaded
2019-03-31 22:59:14.375 SEVERE: java.lang.NullPointerException
java.lang.NullPointerException
at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.readNonGeometricAttributes(ShpReader.java:288)
at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parseFeature(ShpReader.java:125)
at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parse(ShpReader.java:245)
at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpReader.parseDataSet(ShpReader.java:77)
at org.openstreetmap.josm.plugins.opendata.core.io.geographic.ShpImporter.parseDataSet(ShpImporter.java:32)
at org.openstreetmap.josm.gui.io.importexport.OsmImporter.loadLayer(OsmImporter.java:120)
at org.openstreetmap.josm.gui.io.importexport.OsmImporter.importData(OsmImporter.java:97)
at org.openstreetmap.josm.plugins.opendata.core.io.AbstractImporter.importData(AbstractImporter.java:55)
at org.openstreetmap.josm.gui.io.importexport.FileImporter.importDataHandleExceptions(FileImporter.java:95)
at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.importData(OpenFileAction.java:367)
at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.realRun(OpenFileAction.java:319)
at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:95)
at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:143)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
comment:7 by , 6 years ago
Yes, absolutely. The shapefile is extracted from a US Census dataset and is public domain
comment:8 by , 6 years ago
I confirmed the sample file opens in QGIS. There appears to be a single polygon with 11 properties: PLACENS, GEOID, NAMELSAD, CLASSFP, FUNCSTAT, ALAND, AWATER, INTPLAT, INTPLONG, Shape_Leng, Shape_Area.
comment:9 by , 6 years ago
@elliotplack Can you capture the versions of core and opendata plugin you are running. An easy way to do this is to run JOSM, and click Help > Report Bug. That will load a web form with data pre-populated into a ticket form. You don't have to submit that bug, but please copy the data into this bug.
comment:10 by , 6 years ago
I launch JOSM via the jar file on Windows using the command java -jar -Xmx2g c:\...\josm-tested.jar
. I see now that there's an update but I believe the version number below was latest when I first encountered the bug.
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2019-03-03 00:16:03 +0100 (Sun, 03 Mar 2019) Build-Date:2019-03-02 23:16:53 Revision:14824 Relative:URL: ^/trunk Identification: JOSM/1.5 (14824 en) Windows 10 64-Bit OS Build number: Windows 10 Enterprise 1803 (17134) Memory Usage: 841 MB / 1820 MB (684 MB allocated, but free) Java version: 1.8.0_201-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Screen: \Display0 1366x768, \Display1 1920x1080, \Display2 1920x1080 Maximum Screen Size: 1920x1080 Plugins: + FastDraw (34949) + SimplifyArea (34867) + apache-commons (34506) + buildings_tools (34904) + ejml (34389) + geotools (34513) + jaxb (34678) + jts (34524) + opendata (34911) + utilsplugin2 (34932) Tagging presets: + https://josm.openstreetmap.de/josmfile?page=Presets/Heritage&zip=1 Map paint styles: - https://josm.openstreetmap.de/josmfile?page=Styles/TigerReviewedNo&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/LessObtrusiveNodes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Surface-DataEntry&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/Surface&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
by , 6 years ago
Attachment: | 17529_autotest_patch.diff added |
---|
comment:14 by , 6 years ago
I also attached an automated test. Make sure to create test/data/regress/17529 and put west_webmerc.dbf and west_webmerc.shp in there from the test data linked above.
comment:15 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks! Applied in [o34997:34998].
Please attach your shapefile.