Modify

Opened 5 months ago

Closed 4 months 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 4 months ago.
a patch to bring back attributes for polygons
17529_autotest_patch.diff (1.1 KB) - added by openbrian 4 months ago.

Download all attachments as: .zip

Change History (17)

comment:1 Changed 5 months ago by Don-vip

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

Please attach your shapefile.

comment:2 Changed 5 months ago by stoecker

I think it happens with all.

comment:3 Changed 5 months ago by elliottplack

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 Changed 5 months ago by Don-vip

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 Changed 5 months ago by anonymous

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 Changed 5 months ago by anonymous

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 Changed 5 months ago by elliottplack

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

comment:8 Changed 5 months ago by anonymous

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 Changed 5 months ago by anonymous

@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 Changed 5 months ago by elliottplack

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 Changed 4 months ago by Don-vip

@Brian: status of this please?

Changed 4 months ago by openbrian

Attachment: 17529_patch.diff added

a patch to bring back attributes for polygons

comment:12 Changed 4 months ago by openbrian

Fixed. Patch is attached.

comment:13 Changed 4 months ago by Don-vip

Thanks! I'll try it tonight :)

Changed 4 months ago by openbrian

Attachment: 17529_autotest_patch.diff added

comment:14 Changed 4 months ago by openbrian

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 Changed 4 months ago by Don-vip

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.