neo4j-contrib / spatial

Neo4j Spatial is a library of utilities for Neo4j that faciliates the enabling of spatial operations on data. In particular you can add spatial indexes to already located data, and perform spatial operations on the data like searching for data within specified regions or within a specified distance of a point of interest. In addition classes are provided to expose the data to geotools and thereby to geotools enabled applications like geoserver and uDig.
http://neo4j-contrib.github.io/spatial
Other
777 stars 191 forks source link

importShapefile error #373

Closed v2belleville closed 3 years ago

v2belleville commented 3 years ago

Hello,

when trying to import shape file I get errors that prevent loading the file

polygons : image

points : image

Attached are the log for a test db in 3.5.20 neo4j.log debug.log

craigtaverner commented 3 years ago

Could you provide sample data for this, as my test data does not show this error.

galtay commented 3 years ago

Hi, I'm having the same issue using a census shape file. https://www2.census.gov/geo/tiger/GENZ2019/shp/cb_2019_01_puma10_500k.zip

galtay commented 3 years ago

by setting

JAVA_HOME==/usr/lib/jvm

I was able to get a new error which is progress!

Failed to invoke procedure spatial.importShapefile: Caused by: java.lang.IllegalArgumentException: org.geotools.styling.StyleFactory is not an ImageIO SPI class

galtay commented 3 years ago

OK, downgraded from java 11 to java 8 and now this seems to be working. This is a useful tool on ubuntu sudo update-alternatives --config java

craigtaverner commented 3 years ago

Thanks, @galtay, I just noticed this error for the first time last week when I inadvertently tried to run with java11. Since Neo4j Spatial only currently supports Neo4j 3.x, and Neo4j 3.x are still built using Java8, we are stuck with Java8 for now.

This particular error seems to be a symptom of geotools libraries not supporting newer Java, at least the versions of Geotools that spatial uses. I have been looking into porting spatial to neo4j 4.x, and java 11, and it looks to be a massive job due to the way transactions are handled in Neo4j 4.x. Once I've solved that, I will also need to upgrade geotools to get passed this error.