1

I am attempting to configure stardog to handle geospatial functions. I have been following the instructions and I have placed the properties file as directed in the home folder. I now want to enable geospatial functions. I set spatial.use.jts=true as instructed. I then placed the jts jar in the server classpath. I am not sure exactly which folder this is, so I placed it in the server folder (I also placed it in the server subfolders and also STARDOG_HOME, just to be sure!).

I then tried to run a geospatial function: ?feature geof:nearby(53.3442497253418 -6.240039825439453 2 http://qudt.org/vocab/unit#Kilometer).

and I get an internal server error, which produces the following error in the log (only the first few lines printed here): ERROR 2017-05-30 16:22:47,298 [XNIO-1 task-2] com.complexible.stardog.protocols.http.server.StardogHttpServiceLoader:accept(228): An unexpected exception was handled by the server org.openrdf.query.QueryEvaluationException: com.complexible.stardog.plan.eval.ExecutionException: The database has geospatial functionality disabled, cannot perform spatial queries.

What am I doing wrong, why are geospatial functions still disabled?

Kris
  • 63
  • 7

1 Answers1

2

If you are using a Community license, geospatial functions are disabled. Using a Developer/Enterprise trial would fix that.

Additionally, you need to set spatial.enabled=true in your database's properties, either during db create (stardog-admin db create -n myDb -o spatial.enabled=true --) or by offlining the db and editing the metadata (stardog-admin metadata set -o spatial.enabled=true -- myDb)

If you are still having issues, feel free to report them in the Stardog Community forum.

  • Hi Stephen, many thanks for providing an answer. Applying your solution crashed the data unfortunately (I won't go into details). So, I tried from scratch and followed your instruction to use stardog-admin metadata set -o spatial.enabled=true -- myDb. Unfortunately, now the data base gives the following error in the log when I try and create it - ERROR 2017-05-31 java.lang.NoClassDefFoundError: com/vividsolutions/jts/geom/Geometry at com.complexible.stardog.spatial.impl.LuceneGeospatialIndex. – Kris May 31 '17 at 13:40
  • As mentioned on the Stardog Forums (https://community.stardog.com/t/error-when-creating-a-db-with-geospatial-data/369/4) it appears that you're missing the JTS jar. – Michael Jun 01 '17 at 12:09