gis mapping applications on ipad - esri map automation with python & java script
DESCRIPTION
Presented by Lindsey Felton & Jeremy Coulson, Frederick County, in August 2012 at EPAN User Group Meeting.TRANSCRIPT
![Page 1: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/1.jpg)
Lindsey Felton, GIS AnalystJeremy Coulson, Webmaster
Frederick County, VA
![Page 2: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/2.jpg)
Concept and Early Dev
• What we had: the printed book.• What was asked: a digital book.
• Page County for inspiration.• Chief problem: A mobile solution with no
dependence on server technology, network connection, or OS capabilities.
![Page 3: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/3.jpg)
Why No Network?
![Page 4: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/4.jpg)
Map Creation• Data driven pages in
ArcMap.
![Page 5: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/5.jpg)
Map Creation
• Python script to export those maps to JPEGs.• Concern: Creating one HTML page for each
map – 400+ maps! – is laborious and would make updates difficult.
![Page 6: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/6.jpg)
JavaScript to Select Images
• Instead of one page for each image, we can use one page that loads any image requested.
• Vastly simplifies updates and maintenance.• Example: link points to jpeg.html?s=map300.
![Page 7: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/7.jpg)
JavaScript to Select Images
![Page 8: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/8.jpg)
Street Indexes
• To find a street by its name, we provide a list of streets with links to map book pages.
• VB formats table inExcel to be saved asCSV.
![Page 9: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/9.jpg)
Street Indexes
• Python script reads CSV and writes out a big HTML table.
![Page 10: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/10.jpg)
Street Indexes• The result is a table that loads in the browser
with no need for server tech or network.
![Page 11: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/11.jpg)
First Version Delivered• We had built what we set out to build: a digital
version of the printed map book.• We sent it to the fire chiefs and they seemed
to have one overarching common desire: an address search.
![Page 12: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/12.jpg)
Address Search Sans Server
• An address search with ASP.NET/SQL Server, PHP/MySQL, etc. would have been simple and quick. We had to remain independent of a server or network connection.
• We tried jQuery plugins, HTML5 web storage, and other ideas that were all too complex or slow.
• Final solution: a simple (and very long) JavaScript associative array.
![Page 13: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/13.jpg)
Address Search Sans Server
• Again, we turned to Python to automate data processing and write our array.
![Page 14: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/14.jpg)
Address Search Sans Server
• The array associates each address with a page number.
![Page 15: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/15.jpg)
Address Search Sans Server
• Browsers on mobile devices process the resulting 1.2 MB JS file quickly.
![Page 16: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/16.jpg)
Second Version Delivered
• New requests for functionality are taking us far beyond a simple digital version of a printed reference to a true navigational tool.
• Directions, interactive map images, etc.• How to get data without
network?• How to detect network
serve content conditionally?
![Page 17: GIS Mapping Applications on iPad - Esri Map Automation with Python & Java Script](https://reader035.vdocument.in/reader035/viewer/2022062705/5565a5c3d8b42a0a768b531f/html5/thumbnails/17.jpg)
Resources
• Mapbook open source on GitHub: https://github.com/mrcoulson/Emergency-Responders-Mapbook
• Python download: http://www.python.org/download/releases/3.2.3/