Skip to content

linyatis/hibernate-spatial-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Working project for Hibernate Spatial 4 Tutorial

This project is based on Hibernate Spatial 4 Tutorial, working with PostgreSQL + PostGIS (but you can also use with others databases, just change the dialect in persistence.xml).

Follow these instructions to run this project:

###Preparing database

  1. Create database hstutorial
    Note: if needed, change url, username and password for you database connection, into persistence.xml.

  2. In hstutorial database, run psql CREATE EXTENSION postgis;

###Preparing application

  1. Clone and compile this project:
git clone https://github.com/linyatis/hibernate-spatial-tutorial.git
cd hibernate-spatial-tutorial
mvn compile

###Running application

  1. Save some data:
    mvn exec:java -Dexec.mainClass="event.EventManager" -Dexec.args="store POINT(10 5)"
    
  2. Select points inside a polygon:
    mvn exec:java -Dexec.mainClass="event.EventManager" -Dexec.args="find POLYGON((1 1,20 1,20 20,1 20,1 1))"
    
  3. Be happy =)

About

Working project for Hibernate Spatial 4 Tutorial

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages