Maps on Demand
A Service orientated approach to dynamic map creation
A Service orientated approach to dynamic map creation
The Goals of this project was to allow a user to dynamically create their own map atlas depending on their needs at the time of creation. We wanted the web site to perform most if not all of the data crunching on the browsing and be abstract enough to be easily implemented into any previous web site.
Using the OpenLayers draw tool the user can draw the area on the map they wish to export as a map Atlas
Since the starting point of the grids are based off the bounding box coordinates of the user drawn polygon the code will then run a Hit Test on the user drawn polygon and remove any grids that don't intersect using JSClipper
The remaining grid coordinates will then be posted to the REST interface and the service will run a Hit Test on the geometries in the Database. The service will return only the id of the grid and either True or False
The web site will then remove any grids that returned a false and display the created grids to the user
After the user adds optional information, such as basemap, additional emails, and notes, the website will post the data back to the server as a stringified JSON
Using the google-gson library the service will parse the string into a class that will hold our data to be used by a buffered writer to write out a control file
Depending on the type of map the user wants the config file will point to different available templates
The service will then start the python scripts using the config file as a parameter
The python script will start and read/parse the config file.
The main python script(_mapbook_main) utilizes the python multiproccesing module for the creation of the individual map pages. The script will parse the geojson of the created map grids and pull the page numbers to divide them up evenly depending on the number of processors the config file has listed
The python script for creating the index sheet and map book pages will use arcpy to create in memory feature classes using the coordinates listed in the Geojson to be exported with the map. For layers that are already stored in the database the templates utilize Query layers and the python script will update the query to reflect the chosen data.
Text box data such as page numbers will update using the information from the config file and the parsed geojson
Stantec
US Army Corps of Engineers
This Presentation
JsClipper
Play! Framework
Spring Framework
GeoJSON
OpenLayers
Work