Modify

Opened 4 years ago

Closed 4 years ago

#20532 closed defect (worksforme)

Remote loading of geojson files broken - bug in opendata plugin

Reported by: Mashin Owned by: Don-vip
Priority: normal Milestone:
Component: Core remotecontrol Version:
Keywords: remotecontrol, opendata, geojson Cc:

Description

What steps will reproduce the problem?

  1. Try remote loading geojson file from local disk or internet.

In browser enter: http://localhost:8111/import?new_layer=true&url=file:mypath/mydir/bugtest.geojson

What is the expected result?

Loaded file data as a new layer

What happens instead?

Popup error window with text:
"An unexpected exception occurred that may have come from the 'opendata' plugin. According to the information within the plugin, the author is Don-vip. Try updating to the newest version of this plugin before reporting a bug."

Here is the error log

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-12-28 22:03:23 +0100 (Mon, 28 Dec 2020)
Build-Date:2020-12-30 02:30:55
Revision:17428
Relative:URL: ^/trunk

Identification: JOSM/1.5 (17428 en) Mac OS X 10.16
OS Build number: macOS 11.2.1 (20D74)
Memory Usage: 851 MB / 1820 MB (580 MB allocated, but free)
Java version: 1.8.0_281-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.formdev.flatlaf.FlatDarkLaf
Screen: Display 69733632 1440×900 (scaling 1.00×1.00)
Maximum Screen Size: 1440×900
Best cursor sizes: 16×16→16×16, 32×32→32×32
VM arguments: [-Djava.security.policy=file:<java.home>/lib/security/javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>/bin, -Djava.security.manager, -Djnlpx.origFilenameArg=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/56/1ee8cfb8-2bc3e844, -Djnlpx.remove=false, -Dsun.awt.warmup=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Dmacosx.jnlpx.dock.name=JOSM, -Dmacosx.jnlpx.dock.icon=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/25/4c122699-4466e0ba.icns, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp , -Djnlpx.jvm="<java.home>/bin/java"]
Dataset consistency test: No problems found

Plugins:
+ FastDraw (35640)
+ MicrosoftStreetside (35248)
+ PicLayer (2a9aa7a)
+ PolygonCutOut (v0.7)
+ SimplifyArea (35640)
+ apache-commons (35524)
+ apache-http (35589)
+ buildings_tools (35669)
+ changeset-viewer (25)
+ contourmerge (v0.1.6)
+ editgpx (35562)
+ ejml (35458)
+ flatlaf (35703)
+ geotools (35458)
+ javafx-osx (35655)
+ jaxb (35543)
+ jna (35662)
+ jts (35458)
+ log4j (35458)
+ merge-overlap (35640)
+ opendata (35640)
+ poly (35640)
+ reverter (35688)
+ terracer (35640)
+ utilsplugin2 (35691)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/Freemap&preset&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Golf_Course&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/hiking_routes_with_trail_marking&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/SentieriItaliani&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/LessObtrusiveNodes&style&zip=1
- https://github.com/simon04/coloured-addresses.mapcss/raw/master/dist/coloured-addresses.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features_ryg&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LitObjects&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lit&style&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Osmc&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SlovakiaBicycleRoutes&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
- https://github.com/TelenavMapping/Community_MapRoulette/blob/master/maxspeed.mapcss
+ ${HOME}/Documents/Results/Scripts/JOSM_style/AreaHighway.mapcss

Last errors/warnings:
- 00010.555 W: Not a single layer for the name 'MapBox Satellite': []
- 00010.557 W: Not a single layer for the name 'MapBox Satellite': []
- 00011.428 W: Failed to parse Mappaint styles from 'https://github.com/TelenavMapping/Community_MapRoulette/blob/master/maxspeed.mapcss'. Error was: Encountered " "<" "< "" at line 7, column 1.
- 00011.435 E: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " "<" "< "" at line 7, column 1.
- 00062.406 E: org.openstreetmap.josm.io.OsmTransferException: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED. Cause: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED
- 00062.596 E: Handled by bug report queue: org.openstreetmap.josm.io.OsmTransferException: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED. Cause: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED



=== REPORTED CRASH DATA ===
BugReportExceptionHandler#handleException:
No data collected.

Warning issued by: BugReportExceptionHandler#handleException

=== STACK TRACE ===
Thread: AWT-EventQueue-2 (55) of javawsApplicationThreadGroup
org.openstreetmap.josm.io.OsmTransferException: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED
    at org.openstreetmap.josm.plugins.opendata.core.io.NetworkReader.parseOsm(NetworkReader.java:199)
    at org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask$DownloadTask.parseDataSet(DownloadOsmTask.java:462)
    at org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask$DownloadTask.realRun(DownloadOsmTask.java:470)
    at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94)
    at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED
    at org.openstreetmap.josm.gui.progress.AbstractProgressMonitor.checkState(AbstractProgressMonitor.java:84)
    at org.openstreetmap.josm.gui.progress.AbstractProgressMonitor.subTask(AbstractProgressMonitor.java:136)
    at org.openstreetmap.josm.plugins.opendata.core.io.NetworkReader.parseOsm(NetworkReader.java:149)
    ... 9 more

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2020-12-28 22:03:23 +0100 (Mon, 28 Dec 2020)
Build-Date:2020-12-30 02:30:55
Revision:17428
Relative:URL: ^/trunk

Identification: JOSM/1.5 (17428 en) Mac OS X 10.16
OS Build number: macOS 11.2.1 (20D74)
Memory Usage: 855 MB / 1820 MB (603 MB allocated, but free)
Java version: 1.8.0_281-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.formdev.flatlaf.FlatDarkLaf
Screen: Display 69733632 1440×900 (scaling 1.00×1.00)
Maximum Screen Size: 1440×900
Best cursor sizes: 16×16→16×16, 32×32→32×32
VM arguments: [-Djava.security.policy=file:<java.home>/lib/security/javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>/bin, -Djava.security.manager, -Djnlpx.origFilenameArg=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/56/1ee8cfb8-2bc3e844, -Djnlpx.remove=false, -Dsun.awt.warmup=true, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=NULL,2048m, -Dmacosx.jnlpx.dock.name=JOSM, -Dmacosx.jnlpx.dock.icon=${HOME}/Library/Application Support/Oracle/Java/Deployment/cache/6.0/25/4c122699-4466e0ba.icns, -Djnlp.application.href=https://josm.openstreetmap.de/download/josm.jnlp , -Djnlpx.jvm="<java.home>/bin/java"]
Dataset consistency test: No problems found

Plugins:
+ FastDraw (35640)
+ MicrosoftStreetside (35248)
+ PicLayer (2a9aa7a)
+ PolygonCutOut (v0.7)
+ SimplifyArea (35640)
+ apache-commons (35524)
+ apache-http (35589)
+ buildings_tools (35669)
+ changeset-viewer (25)
+ contourmerge (v0.1.6)
+ editgpx (35562)
+ ejml (35458)
+ flatlaf (35703)
+ geotools (35458)
+ javafx-osx (35655)
+ jaxb (35543)
+ jna (35662)
+ jts (35458)
+ log4j (35458)
+ merge-overlap (35640)
+ opendata (35640)
+ poly (35640)
+ reverter (35688)
+ terracer (35640)
+ utilsplugin2 (35691)

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/Freemap&preset&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Golf_Course&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/hiking_routes_with_trail_marking&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/SentieriItaliani&zip=1

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/LessObtrusiveNodes&style&zip=1
- https://github.com/simon04/coloured-addresses.mapcss/raw/master/dist/coloured-addresses.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features_ryg&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_features&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Cycleways&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LitObjects&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lit&style&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Osmc&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/SlovakiaBicycleRoutes&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&style&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Maxspeed&zip=1
- https://github.com/TelenavMapping/Community_MapRoulette/blob/master/maxspeed.mapcss
+ ${HOME}/Documents/Results/Scripts/JOSM_style/AreaHighway.mapcss

Last errors/warnings:
- 00010.555 W: Not a single layer for the name 'MapBox Satellite': []
- 00010.557 W: Not a single layer for the name 'MapBox Satellite': []
- 00011.428 W: Failed to parse Mappaint styles from 'https://github.com/TelenavMapping/Community_MapRoulette/blob/master/maxspeed.mapcss'. Error was: Encountered " "<" "< "" at line 7, column 1.
- 00011.435 E: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered " "<" "< "" at line 7, column 1.
- 00062.406 E: org.openstreetmap.josm.io.OsmTransferException: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED. Cause: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED
- 00062.596 E: Handled by bug report queue: org.openstreetmap.josm.io.OsmTransferException: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED. Cause: org.openstreetmap.josm.gui.progress.ProgressException: Expected states are [IN_TASK] but current state is FINISHED

Attachments (1)

bugtest.geojson (4.0 KB ) - added by anonymous 4 years ago.

Download all attachments as: .zip

Change History (7)

by anonymous, 4 years ago

Attachment: bugtest.geojson added

comment:1 by Mashin, 4 years ago

To add to this, when trying to load geojson from a remote server over https://
e.g. http://localhost:8111/import?new_layer=true&url=https://myserver/path/bugtest.geojson

I get popup with message:

"Authentication at the OSM server with the OAuth token 'ltlSl9eyyJ1LA09bwoqS2u5cbojYEl36ipMrnBz5' failed. Please launch the preferences dialog and retrieve another OAuth token."

My OAuth token works for OSM server connection.
And remote loading .osm files work fine.

comment:2 by Mashin, 4 years ago

Any chance this would get patched before 21.02 release? Please!

comment:3 by GerdP, 4 years ago

Hmm, the documentation https://wiki.openstreetmap.org/wiki/JOSM/RemoteControl#import_command says
"instructs JOSM to download the specified OSM file and add it to the current data set."
Since geojson is not an OSM file I wonder why you expect that this works.

comment:4 by Mashin, 4 years ago

I just though that if JOSM can open other formats it would be able to do it this way as well.

I did some more research here is what I found:

# This works
http://localhost:8111/import?new_layer=true&url=file:path/File.osm

# This doesn't work - shows plugin bud message
http://localhost:8111/import?new_layer=true&url=file:path/File.geojson

# This works [html header set to content-type: application/octet-stream]
http://localhost:8111/import?new_layer=true&url=https://codeforsanjose.github.io/OSM-SouthBay/SJ_Buildings/out/clean/buildings_1421.osm

# This doesn't work [html header set to content-type: application/octet-stream] - shows  OAuth token message
http://localhost:8111/import?new_layer=true&url=https://storage.googleapis.com/ct-import-bucket/Parts/Fragment_100.geojson

# This works [html header set to content-type: text/plain]
http://localhost:8111/import?new_layer=true&url=https://storage.googleapis.com/ct-import-bucket/Parts/Fragment_1.geojson



comment:5 by Mashin, 4 years ago

hmm.. maybe it's not text/plain, but this works for me:

http://localhost:8111/import?new_layer=true&url=https://lepiller.eu/files/ct-import/westcog/Fragment_357.geojson

comment:6 by Don-vip, 4 years ago

Priority: majornormal
Resolution: worksforme
Status: assignedclosed

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.