2

The geotools DataStoreFinder expects a Map of properties, including mainly the connectivity information, depending on the store.

For the PostGIS plugin this includes the dbtype (which must be "postgis") and the database host, port, schema, database, username and password.

http://docs.geotools.org/stable/userguide/library/jdbc/postgis.html

In my application, there are other tables which are being accessed using Spring Data (JPA Repositories / Hibernate and Hibernate Spatial).

Is there a way to make the PostGIS connection information to use the standard JEE DataSource that is injected by Spring? This way I won't have to duplicate the configuration to the same database and do custom property handling.

jbx
  • 21,365
  • 18
  • 90
  • 144
  • if you can get a JNDI reference for the datastore you could use that to create a new geotools datastore, otherwise I suspect you will need to write new code for the datastores. – Ian Turton Nov 12 '18 at 08:54
  • It should be possible to enable JNDI in Spring Boot's embedded Tomcat and add the DataSource to the NamingContext with some JNDI name. Will have a go at it. – jbx Nov 12 '18 at 08:59
  • did you had any luck in integrating datasource provided by spring boot with geotool? – Haider Apr 13 '20 at 18:32
  • I didn't use geotools in the end – jbx Apr 14 '20 at 12:26

0 Answers0