When I revisited my old spatial.election uni project, I faced several issues while trying to start it on modern versions of Java, PostgreSQL and Tomcat. I seized the opportunity to give it a major update and fix some old bugs.

First of all, here is the demo.

v1small v2small

Preview Images | V1.0 | V2.0


Downloads

Requirements for spatial.election 2.0

  • PostgreSQL 9.3 9.6
  • PostGIS 2.1 2.3.1
  • Tomcat 7.0
  • Java 1.7 1.8

Run

The easiest way to run the software, is to run an up-to-date Java and my Docker Postgis container. Here are the details…

Java

  • Check your current Java Runtime Environment, it should be at least version 1.8.
java -version

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode

Database

The database adapter expects a connectable PostgreSQL database spatial_election on local port 5432. There should be a user postgres with password postgres. You could change any of these settings by editing the source XML or by altering the compiled (jar|war)\WEB-INF\lib\database-2.0.jar\META-INF\persistence.xml.

  • (a) Check your current PostgreSQL installation, it should be at least version 9.6. Make sure PostGIS is installed as well.
psql --version
dpkg -l | grep postgis

Execution

  • (a) Install and run Tomcat. Upload and deploy the WAR file provided. If the startup fails, check the Java Version which the Tomcat Server runs on.
  • (b) Simply run the executable JAR file. Note: the port number might change.
java -jar server##2.0-20161203.jar

Changes

  • [general] new dependencies with new methods, e.g. jetty moved from org.codehaus to org.eclipse
  • [general] moved from direct Hibernate implementation to JPA API
  • [database] fixed key column types on various tables: smallint, bigint, integer to integer
  • [website] changed visuals from insignificant “Erststimme” to important “Zweitstimme”, fixed bug in calculating colour intensity.