Modify

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:

Description

Using plugin OpenData, a shapefile's attributes usually appear as tags in JOSM. This functionality appears to be broken now. Here's an example:

https://i.imgur.com/aoXpBhL.png

Attachments (2)

17529_patch.diff (1.1 KB ) - added by openbrian 6 years ago.
a patch to bring back attributes for polygons
17529_autotest_patch.diff (1.1 KB ) - added by openbrian 6 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 by Don-vip, 6 years ago

Owner: changed from Don-vip to elliottplack
Status: newneedinfo

Please attach your shapefile.

comment:2 by stoecker, 6 years ago

I think it happens with all.

comment:3 by elliottplack, 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 Don-vip, 6 years ago

Keywords: regression shapefile added
Owner: changed from elliottplack to openbrian
Priority: normalmajor
Status: needinfonew

Confirmed.
@openbrian can you please take a look? It's a major regression.

comment:5 by anonymous, 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 anonymous, 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 elliottplack, 6 years ago

Yes, absolutely. The shapefile is extracted from a US Census dataset and is public domain

comment:8 by anonymous, 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 anonymous, 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 elliottplack, 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

comment:11 by Don-vip, 6 years ago

@Brian: status of this please?

by openbrian, 6 years ago

Attachment: 17529_patch.diff added

a patch to bring back attributes for polygons

comment:12 by openbrian, 6 years ago

Fixed. Patch is attached.

comment:13 by Don-vip, 6 years ago

Thanks! I'll try it tonight :)

by openbrian, 6 years ago

Attachment: 17529_autotest_patch.diff added

comment:14 by openbrian, 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 Don-vip, 6 years ago

Resolution: fixed
Status: newclosed

Thanks! Applied in [o34997:34998].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain openbrian.
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.