This is a very simple example to get you started using PostGIS with Dropwizard, an excellent way to create Java-based web services. In this case, a spatial service -- very handy for using with OpenLayers or other services. This is by no means a complicated example application, more just a bootstrap example for getting started.
Setup should be pretty simple:
- Create a database with PostGIS extensions
- Create a new schema named 'tokoro' (it's a good idea to use schemas with PostGIS to make data migration easier in the future)
- Edit src/main/resources/tokoro.yml with your PostgreSQL settings (username, host, password, db, etc.)
- Run the migration via db migrate src/main/resources/tokoro.yml
- Start the server via server src/main/resources/tokoro.yml
- Hit the server