Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geoserver importer fails at parsing a GeoJSON containing decimal numbers #332

Open
giohappy opened this issue Apr 12, 2022 · 1 comment
Open

Comments

@giohappy
Copy link

When trying to import this dataset the Geoserver importer (2.19.x) throws the following error:

2022-04-12 21:57:30,417 ERROR [geoserver.rest] - Found conflicting types Double and Long for property mag
java.lang.IllegalStateException: Found conflicting types Double and Long for property mag
	at org.geotools.geojson.feature.FeatureTypeHandler.primitive(FeatureTypeHandler.java:160)
	at org.json.simple.parser.JSONParser.parse(JSONParser.java:428)
	at org.json.simple.parser.JSONParser.parse(JSONParser.java:312)
	at org.geotools.geojson.GeoJSONUtil.parse(GeoJSONUtil.java:280)
	at org.geotools.geojson.feature.FeatureJSON.readFeatureCollectionSchema(FeatureJSON.java:503)
	at org.geoserver.importer.format.GeoJSONFormat.task(GeoJSONFormat.java:152)
	at org.geoserver.importer.format.GeoJSONFormat.list(GeoJSONFormat.java:142)
	at org.geoserver.importer.Importer.createTasks(Importer.java:687)
	at org.geoserver.importer.Importer.initForDirectory(Importer.java:584)
	at org.geoserver.importer.Importer.addTasks(Importer.java:501)
	at org.geoserver.importer.Importer.update(Importer.java:474)
	at org.geoserver.importer.rest.ImportTaskController.acceptData(ImportTaskController.java:294)
	at org.geoserver.importer.rest.ImportTaskController.taskPost(ImportTaskController.java:194)
	at sun.reflect.GeneratedMethodAccessor903.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
@simboss simboss added needs estimate A plan needs to be proposed for the fix or ehancement adn estimated Internal GeoNode labels Apr 12, 2022
@aaime
Copy link
Member

aaime commented Apr 13, 2022

For a general discussion on the state of GeoJSON import, see #323

Specifically for this one, I've tested with 2.21.x and found that parsing works, but import fails to create target table... ah it does because I tried to import an array before, what a pain. Opened a ticket for it. Otherwise the import works fine.

So in terms of estimates:

  • Fix gt-geojson to handle a mix of long/double values: 1 day
    (same caution as in the other ticket, pad if assigned to someone that's not familiar with gt-gejson)

I'm adding another estimate entry for the other ticket, since the postgis issue is related to handling arrays.

@aaime aaime removed the needs estimate A plan needs to be proposed for the fix or ehancement adn estimated label Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants