JOSM / geojson

Allows reading GeoJSON using different projections – NOW PART OF JOSM CORE
Apache License 2.0
13 stars 10 forks source link

Can't open geojson exported by QGIS #2

Closed naoliv closed 7 years ago

naoliv commented 8 years ago

This file http://naoliv.iq.unesp.br/osm/problem-josm.geojson can't be read in JOSM:

INFO: Parsing GeoJSON: /tmp/s/problem-josm.geojson
Oct 19, 2016 10:54:30 PM org.openstreetmap.josm.Main error
SEVERE: Unknown CRS urn:ogc:def:crs:OGC:1.3:CRS84
Oct 19, 2016 10:54:30 PM org.openstreetmap.josm.Main error
SEVERE: Error while reading json file!

It was exported as EPSG:4326, WGS 84 in QGIS and it can be read back without any problems.

simon04 commented 8 years ago

The stack trace is:

java.lang.UnsupportedOperationException
    at org.openstreetmap.josm.plugins.geojson.DataSetBuilder.build(DataSetBuilder.java:73)
    at org.openstreetmap.josm.plugins.geojson.GeoJsonFileImporter.importData(GeoJsonFileImporter.java:42)
    at org.openstreetmap.josm.io.FileImporter.importDataHandleExceptions(FileImporter.java:90)
    at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.importData(OpenFileAction.java:349)
    at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.realRun(OpenFileAction.java:302)
    at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
    at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:141)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
simon04 commented 8 years ago

The stack trace is:

java.lang.UnsupportedOperationException: Unknown CRS urn:ogc:def:crs:OGC:1.3:CRS84
    at org.openstreetmap.josm.plugins.geojson.DataSetBuilder.build(DataSetBuilder.java:71)
    at org.openstreetmap.josm.plugins.geojson.GeoJsonFileImporter.importData(GeoJsonFileImporter.java:43)
    at org.openstreetmap.josm.io.FileImporter.importDataHandleExceptions(FileImporter.java:90)
    at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.importData(OpenFileAction.java:349)
    at org.openstreetmap.josm.actions.OpenFileAction$OpenFileTask.realRun(OpenFileAction.java:302)
    at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:93)
    at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:141)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.opengis.referencing.NoSuchAuthorityCodeException: Authority "OGC" is unknown or doesn't match the supplied hints. Maybe it is defined in an unreachable JAR file?
    at org.geotools.referencing.factory.ManyAuthoritiesFactory.noSuchAuthority(ManyAuthoritiesFactory.java:489)
    at org.geotools.referencing.factory.ManyAuthoritiesFactory.getAuthorityFactory(ManyAuthoritiesFactory.java:467)
    at org.geotools.referencing.factory.ManyAuthoritiesFactory.getCRSAuthorityFactory(ManyAuthoritiesFactory.java:548)
    at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:801)
    at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:802)
    at org.geotools.referencing.factory.FallbackAuthorityFactory.createCoordinateReferenceSystem(FallbackAuthorityFactory.java:640)
    at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:802)
    at org.geotools.referencing.factory.AuthorityFactoryAdapter.createCoordinateReferenceSystem(AuthorityFactoryAdapter.java:802)
    at org.geotools.referencing.factory.ThreadedAuthorityFactory.createCoordinateReferenceSystem(ThreadedAuthorityFactory.java:731)
    at org.geotools.referencing.DefaultAuthorityFactory.createCoordinateReferenceSystem(DefaultAuthorityFactory.java:179)
    at org.geotools.referencing.CRS.decode(CRS.java:520)
    at org.openstreetmap.josm.plugins.geojson.DataSetBuilder.build(DataSetBuilder.java:67)
    ... 11 more
Caused by: org.geotools.factory.FactoryNotFoundException: No factory of kind "CRSAuthorityFactory" found.
    at org.geotools.factory.FactoryRegistry.getServiceProvider(FactoryRegistry.java:375)
    at org.geotools.factory.FactoryCreator.getServiceProvider(FactoryCreator.java:145)
    at org.geotools.referencing.ReferencingFactoryFinder.getAuthorityFactory(ReferencingFactoryFinder.java:220)
    at org.geotools.referencing.ReferencingFactoryFinder.getCRSAuthorityFactory(ReferencingFactoryFinder.java:440)
    at org.geotools.referencing.factory.AllAuthoritiesFactory.fromFactoryRegistry(AllAuthoritiesFactory.java:118)
    at org.geotools.referencing.factory.ManyAuthoritiesFactory.getAuthorityFactory(ManyAuthoritiesFactory.java:452)
    ... 21 more

Sees to be this issue of Geotools: https://osgeo-org.atlassian.net/browse/GEOT-1710