Gmap Polygon Service Registry Entry

Description

Gmap Polygon is a combination of enterprise Java code, JSP samples, and US polygon geodata. It was developed by Peter White for the NCPHI Lab, and is intended to be combined with data service providers to visual Google Maps representations of State, Zip 3, or Zip 5 polygons from behind secure websites.

Gmap-Polygon is the main java code, it contains code for connecting to the database, objectifying polygons, and translating polygon geocoordinates and time series data into graphs. It also has some JSP session beans to manage JSP encoding and presentation.

Gmap-Poly-Web is a jsp project with a simple sample polygon drawer. It has controls for selecting states, then zip 3's within that state, then zip 5's within those zip 3's. It will probably serve as a handy base for any services trying to display with Gmap Polygon code.

Loader-Gmaps-Polygon is a java project for loading geodata from KML files into databases, it also has simple CSVs for the main databases needed by Gmap-Polygon. It is recommended to use the csvs to load data as it is simple and almost all databases know how to load CSVs into their contents.

Location of source code

The source code for gmap-polygon is located in the same repository at: http://phgrid.googlecode.com/svn/gmap-polygon

The source code for gmap-poly-web is located in the phgrid repository at: http://phgrid.googlecode.com/svn/gmap-poly-web

The source code for loader-gmaps-polygon is located in the phgrid repository at http://phgrid.googlecode.com/svn/loader-gmaps-polygon

Deployment instructions

Prerequisites:

    • A local build box with subversion, maven, and a servlet container installed.
    • A database (we use postgres, but if you can get the drivers for whatever you prefer to use, go ahead)

Installation/Configuration:

    1. Load the database with the geodata.
      1. Download the four database creation scripts from the loader-gmaps-polygon project's "ddl" directory (http://phgrid.googlecode.com/svn/loader-gmaps-polygon/ddls) and the three geodata files from the loader-gmaps.polygon project "csv" directory (svn co http://phgrid.googlecode.com/svn/loader-gmaps-polygon/csvs csv's).
      2. Using your databases preferred method, create the tables and upload the data from the csv. (the documentation for the postgres method (called COPY) can be found here.)
    2. Check out, configure, and build the gmap-polygon code from the repository.
      1. Check out the code from the repository (svn co http://phgrid.googlecode.com/svn/gmap-polygon gmap-polygon).
      2. Configure the test and main properties database connection properties in the gmap-polygon.filter-example.properties (located in the trunk directory) and rename the file gmap-polygon.filter.properties (also note, you may need to update the pom file with a new JDBC driver dependency if you are not using postgres or sql server as your database)
      3. Build the package using mvn package.
      4. If the build tests pass, Install the package into the repository using mvn install.
    3. Check out, build, and install the gmap-poly-web code from the repository
      1. Check out the code (svn co http://phgrid.googlecode.com/svn/gmap-poly-web gmap-poly-web ).
    4. Build the web project using the mvn package command (note, gmap-polygon must be built and installed into the maven repository for this to work)
    5. Deploy the resulting war file (located in the target directory) on the servlet container.

Link to the gmap-poly-web demo

There is a link to a running gmap-poly-web instance here