Lab : Experimenting with Geospatial Services
Michael Flaxman
Massachusetts Institute of Technology
based on URISA Workshop exercise by
Zhong-Ren Peng, Ph.D.
University of Wisconsin – Milwaukee
Joseph Ferreira, Jr., Ph.D.
Massachusetts Institute of Technology
Objectives
1) To understand the layering of data, application tools, web mapping interoperability standards, and web service protocols involved in modern internet GIS applications.
2) To compare alternative strategies for utilizing geospatial services, from spatial data search with GIS download to direct online use.
3) To examine a few geospatial services “under the covers” in order to understand the nature and purpose of the URL requests and XML responses between the clients and web services.
4) To experiment with “middleware” tools for tailoring geospatial web services to accommodate “local knowledge” and customize client applications.
Overarching issues
Audience: Who does the system serve? Does it serve them well?
Flexibility: What other uses are supported? Can users download computable data? Can users upload or exchange data?
Thematic Content: What are the primary types of data available? Is metadata available describing currentness, methods, scale, projection, etc?
Background Content: What other incidental content is available? Can the background information be separated from the foreground?
Basic Data Type: Is it a picture of a map? Unclassified imagery like an orthophoto? Classified grid data? Points, lines and polygons?
Fitness for Use: Does the data/interface allow cartographic manipulation? Printing? Editing? Analysis?
Price / Licensing: Is this data available free or at cost? Even if free, what are the licensing restrictions? How do these issues affect public planning use, private firm use, citizen use?
Tips and Tricks
Learn to parse URLs yourself (allows you to repurpose sites and services, debug errors)
Question mark separates path name and program or page name from parameters list
¶meter1=blah¶meter2=blah+again
The ampersand separates parameters, and the equals sign its assigned value
Spaces are not allowed in URLS, so "+" symbol is substituted
To clarify, paste URL into a text editor and substitute line breaks for question mark and ampersands
Example (standard Web Mapping Service or WMS):
http://maps.massgis.state.ma.us/mapaccess/main.jsp?dpi=120&request=GetMap&layers=MHD+Roads&styles=Class&srs=EPSG:26986&bbox=233500,900000,236500,902500&width=640&height=480&format=image/png&service=wms
Becomes
http://maps.massgis.state.ma.us/mapaccess/main.jsp
dpi=120
request=GetMap
layers=MHD+Roads
styles=Class
srs=EPSG:26986
bbox=233500,900000,236500,902500
width=640
height=480
format=image/png
service=wms
(Not self-explanatory, but a step in the right direction. Full WMS description can be found here for those interested:
OpenGIS® Web Map Service (WMS) Implementation Specification, Version 1.3.0, 2006-Mar-15, 06-042)
Part I – Online Mapping Sites
A) Sites Designed Primarily for Online Use
Explore these sites, noting the issues above.
National Government Agencies
EPA’s Enviromapper: http://www.epa.gov/enviro/html/em
Rich mature example of online mapping
Special permission required for access to underlying services (e.g., Oracle account)
U.S. Department of Transportation Federal Highway Administration
What is the annual average daily traffic volume on Mass. Ave?
http://hepgis.fhwa.dot.gov/hepgis_v2/GeneralInfo/Map.aspx
General Mapping Sites
Traffic info on Microsoft’s Virtual Earth: http://local.live.com/help/en-us/tCoverage.htm
A) Sites With Data Download Capabilities
The National Map http://nationalmap.gov/
USGS-led effort at coherent, cross-agency national map layers
Try the online mapping viewer: http://nmviewogc.cr.usgs.gov/viewer.htm
Geospatial OneStop (Portal for Federal GIS data): http://gos2.geodata.gov/wps/portal/gos
Latest version is ESRI-powered under the covers
Canadian Geospatial Data Infrastructure (CGDI): http://www.geoconnections.org/CGDI.cfm
One of the more mature national spatial data infrastructure (SDI) sites
http://www.geoconnections.org/CGDI.cfm/fuseaction/home.welcome/gcs.cfm
MassGIS: http://mass.gov/mgis
good state agency website for finding and disseminating geospatial data
won URISA ESIG award last year (for web services part)
Accessible at several levels:
online mapping: http://mass.gov/mgis/mapping.htm
downloadable datasets: http://mass.gov/mgis/database.htm
Part II – Accessing Geospatial Services (from web browsers)
MIT OrthoServer (10 year old website!): http://ortho.mit.edu
‘Seamless’ interface: HYPERLINK http://ortho.mit.edu/nsdi/seamless6.cgi
HTML-wrapped image: (try other values)
http://ortho.mit.edu/nsdi/seamless6.cgi?zoom=8&x0=237000&y0=902000&action=pan&pwidth=640&pheight=480&x=123&y=169
Ortho snippet only: (try other values)
http://ortho.mit.edu/nsdi/seamless8.cgi?zoom=8&x0=237000&y0=902000&action=pan&pwidth=640&pheight=480
Parameters are now a little different from WMS 1.2 ‘get map’ standard
MassGIS: HYPERLINK "http://mass.gov/mgis/" \t "_blank" http://mass.gov/mgis
Also accessible via OGC-compliant WMS and WFS protocols
HYPERLINK "http://mass.gov/mgis/websrv.htm" \t "_blank" http://mass.gov/mgis/websrv.htm
Example URL requesting WMS image (street map): (try pasting into a browser) HYPERLINK "http://maps.massgis.state.ma.us/mapaccess/main.jsp?dpi=120&request=GetMap&layers=MHD+Roads&styles=Class&srs=EPSG:26986&bbox=233500,900000,236500,902500&width=640&height=480&format=image/png&service=wms" \t "_blank" http://maps.massgis.state.ma.us/mapaccess/main.jsp?dpi=120&request=GetMap&layer HYPERLINK "http://maps.massgis.state.ma.us/mapaccess/main.jsp?dpi=120&request=GetMap&layers=MHD+Roads&styles=Class&srs=EPSG:26986&bbox=233500,900000,236500,902500&width=640&height=480&format=image/png&service=wms" \t "_blank" s=MHD+Roads&styles=Class&srs=EPSG:26986&bbox=233500,900000,236500,9025 HYPERLINK "http://maps.massgis.state.ma.us/mapaccess/main.jsp?dpi=120&request=GetMap&layers=MHD+Roads&styles=Class&srs=EPSG:26986&bbox=233500,900000,236500,902500&width=640&height=480&format=image/png&service=wms" \t "_blank" 00&width=640&height=480&format=image/png&service=wms
Using APIs
Yahoo Traffic API using "REST" web URLS:
What is the current traffic on Mass Ave at MIT?
http://local.yahooapis.com/MapsService/V1/trafficData?appid=YahooDemo&street=77+Massachusetts+Ave&city=Cambridge&state=MA
Part III – Accessing ArcWeb and WMS Services (from ArcMap or ArcExplorer)
A) Finding WMS Services
Web-search approaches:
OGC WMS Server List
http://www.skylab-mobilesystems.com/en/wms_serverlist.html
ESRI’s ArcWeb Services: http://www.arcwebservices.com
You need to register with ESRI to use their ArcWeb Services
Sign up for your own account, or
Use my trial/evaluation account for today (password will change tomorrow)
User = jfjr
Password = urisa06
Access from ArcMap
Start/ArcGIS/ArcMap\
Open saved ArcMap document
Y:\demos\esri\arcweb_cambridge_start.mxd
OR, load shapefiles and coverages from
Y:\data
Next, Access the ArcWeb services:
Click the ‘Plus-sign’ button (Add Data)
Navigate up/down directory tree to find and click on ‘GIS Servers’
Choose ArcWeb services and log in as shown in the powerpoints
Choose the FEMA_Flood layer
Note (lack of) responsiveness of layers, try the ‘info’ button
Recognize how source data in different coordinates have been merged
Access from ArcExplorer
Start/ArcGIS/ArcExplorer 9.1
Open saved ArcExplorer document
Y:\demo\ arcexplorer_example.axl
OR create your own connection to ArcWeb services
Click the ‘Plus-sign’ button (Add Data)
Choose WWW site and log in as shown in the powerpoints
Choose the FEMA_Flood layer
Save the ArcExplorer map into Y:\demos\esri\arcexplorer_example.axl
Examine this AXL file from Notepad
Accessing WMS services from ArcMap
Again, click the ‘Plus-sign’ button (Add Data)
This time, add Cambridge, MA, layers in Y:\data before adding FEMA_Flood
Under ‘GIS Servers’ choose ‘WMS Servers’
Enter this URL for the MassGIS WMS service
http://maps.massgis.state.ma.us/mapaccess/main.jsp?
Click ‘OK’ and then ‘Add’
If you click ‘Get Layers’ it will take 1+ minutes to get the long list
Once back in ArcMap, layer may not show if zoomed in/out too far
Find ‘schools’ under ‘Infrastructure’
Grayed out check mark means it can’t be mapped (wrong zoom, coordinates,…)
Cambridge, Flood, and MassGIS layers won’t mashup well unless ArcMap knows (and handles) projection of each layer
If you want to open a fresh ArcMap document with the local layers, ArcWeb services, and WMS services already connected, open this ArcMap document
Y:\demos\ arcweb_flood_schools_demo_final.mxd
Part III – Accessing Google Map Services
Boston.com election contribution website
http://www.boston.com/news/special/bigarticles/campaign_finance/page2.html?p1=email_to_a_friend
Live ‘mashup’ webpage (for Back Bay):
http://boston.faneuilmedia2.com/gov/detail_map.html?from=top&zip=02116&z=13
Note: you can ‘pan’ the map or click on dots for further info
View source and look for call to google with machine/directory-specific Key:
http://maps.google.com/maps?file=api&v=2.60&key=AB...
Rest is javascript to interact with Google maps and overlay/identify entries in local election contribution database maintained by consultant (Faneuil Media, Inc.)
Part IV – Accessing the MIT ‘intelligent middleware’ Site
Main page for Middleware tools: http://uis.mit.edu/umi/auth
Webpage for DSNI properties: Y:\demos\middleware\dni_mashup_v2.htm
View Source and lookfor URLs in IFRAME tags
Copy URLs for table and map into Firefox browser address bar
Edit URL for report to remove style sheet parameter
Wikka documentation of various Middleware web services:
http://uis.mit.edu/wikka
Try other Web Services – top-10 owners in Dudley Triangle
HYPERLINK "http://uis.mit.edu/umi/service/report.php?Request=QueryReport&name=top_own_parcels_a_jf1&tablename=own05_mixed_after&studyarea=triangle&xsl=http://uis.mit.edu/umi/xl/report.xsl" http://uis.mit.edu/umi/service/report.php?Request=QueryReport&name=top_own_parcels_a_jf1&tablename=own05_mixed_after&studyarea=triangle&xsl=http://uis.mit.edu/umi/xl/report.xsl
Enter into Excel as Web Query
Build Your Own Case Study
Select a location in the U.S. which interests you. Using the national map or seemless.usgs.gov, find and download:
National Elevation Data (NED 1/9)
Land Use / Land Cover (NLCD)
Transportation (varies)
Hydrology (varies)
Now select an international location. Which of the data above are available for your site?
Lab Questions
Web services can be evaluated from the point of view of a consumer, from that of a producer, or from that of a policymaker.