Presentation is loading. Please wait.

Presentation is loading. Please wait.

John Maurer PacIOOS Hawaii Data Explorer: Workshop Google Maps API Examples:

Similar presentations


Presentation on theme: "John Maurer PacIOOS Hawaii Data Explorer: Workshop Google Maps API Examples:"— Presentation transcript:

1 John Maurer john.maurer@hawaii.edu PacIOOS Hawaii Data Explorer: http://pacioos.org/map/ Workshop Google Maps API Examples: http://pacioos.org/outreach/gis_workshop/gmap.html Google Maps API Documentation: http://code.google.com/apis/maps/ http://code.google.com/apis/maps/documentation/javascrip t/v2/reference.html GDAL/OGR Documentation: http://www.gdal.org/ http://www.gdal.org/ogr/john.maurer@hawaii.edu http://pacioos.org/map/ http://pacioos.org/outreach/gis_workshop/gmap.html http://code.google.com/apis/maps/ http://code.google.com/apis/maps/documentation/javascrip t/v2/reference.htmlhttp://www.gdal.org/http://www.gdal.org/ogr/ Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer

2 Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer

3 But first, some philosophy. Any technical project has: Some big “IFFS”… Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer

4 interoperable Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer fast flexible simple Aim for sweet spot (intersection/heart) but in reality you cannot achieve all IFFS equally…

5 Game Plan: Investigate the “IFFS” of using Google Maps for… Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer 1.Imagery USGS DEM Oahu hillshade UH/SOEST/HMRG Hawaii bathymetry 2.Points fish aggregating devices (FADs) 3.Polygons humpback whale national marine sanctuary 4.Polylines underwater cables

6 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer Use GDAL and OGR command-line utilities that come with OSGeo4W: Use DOS if you do not have a Unix terminal installed on your Windows machine: open the “Start” window (more info)more info type “cmd” (this opens the DOS “command” window) cd c:\osgeo4w\bin (or wherever you installed OSGeo4W) NOTE: You will need to specify the full data path to wherever you download files in the examples that follow…

7 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer USGS DEM Oahu hillshade: Get the data: http://hawaii.gov/dbedt/gis/data/hilloah.tif.zip Get data summary: gdalinfo hilloah.tif Reproject from UTM Zone 4 NAD83 to latlon WGS84: gdalwarp -t_srs "epsg:4326" hilloah.tif hilloah.epsg4326.tif Reformat from GeoTIFF to PNG (and make zero values transparent): gdal_translate -of PNG -a_nodata 0 hilloah.epsg4326.tif hilloah.epsg4326.png Produce image tiles (this will take a few minutes): gdal2tiles.py --s_srs="+init=epsg:4326" --zoom=5-15 -a 0,0,0 hilloah.epsg4326.png

8 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer USGS DEM Oahu hillshade: View page source of http://pacioos.org/outreach/gis_workshop/gmap.htmlhttp://pacioos.org/outreach/gis_workshop/gmap.html Add untiled imagery to Google Maps: Look at JavaScript for: function toggleDem // implement GGroundOverlayGGroundOverlay Add tiled imagery to Google Maps: Look at JavaScript for: function toggleDemTiled // implement GCopyright, GTileLayer, and GTileLayerOverlayGCopyrightGTileLayerGTileLayerOverlay function getTMSTiledUrl // converts TMS tile order to Google Maps tile order…

9 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer UH/SOEST/HMRG Hawaii bathymetry: Get the image: http://pacioos.org/outreach/gis_workshop/hmrg_bathy_50m.png Get data summary: gdalinfo hmrg_bathy_50m.png Expand indexed color to RGB values (needed for gdal2tiles.py below): gdal_translate -of vrt -expand rgba hmrg_bathy_50m.png hmrg_bathy_50m.vrt Produce image tiles (this will take a few hours): gdal2tiles.py --s_srs="+init=epsg:4326" --zoom=0-14 hmrg_bathy_50m.vrt

10 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer UH/SOEST/HMRG Hawaii bathymetry: View page source of http://pacioos.org/outreach/gis_workshop/gmap.htmlhttp://pacioos.org/outreach/gis_workshop/gmap.html Add untiled imagery to Google Maps: Look at JavaScript for: function toggleBathyColor // implement GGroundOverlayGGroundOverlay Add tiled imagery to Google Maps: Look at JavaScript for: function toggleBathyColorTiled // implement GCopyright, GTileLayer, and GTileLayerOverlayGCopyrightGTileLayerGTileLayerOverlay function getTMSTiledUrl // converts TMS tile order to Google Maps tile order… Add WMS tiled imagery to Google Maps: Look at JavaScript for: gmap_wms.js function toggleBathyColorWMS // implement createWMSTileLayer from gmap_wms.js

11 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer fish aggregating devices (FADs): Get the data: http://hawaii.gov/dbedt/gis/data/fads_nmfs.shp.zip Get data summary: ogrinfo -so fads_nmfs.shp fads_nmfs Produce KML: ogr2ogr -f KML fads_nmfs.kml fads_nmfs.shp Produce GeoJSON: ogr2ogr -t_srs "EPSG:4326" -f GeoJSON fads_nmfs.json fads_nmfs.shp

12 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer fish aggregating devices (FADs): View page source of http://pacioos.org/outreach/gis_workshop/gmap.htmlhttp://pacioos.org/outreach/gis_workshop/gmap.html Add KML to Google Maps: Look at JavaScript for: function toggleFads // implement GGeoXmlGGeoXml Add GeoJSON to Google Maps: Look at JavaScript for: function toggleFadsGeoJson // implement MarkerManagerMarkerManager function createFadMarker // implement GMarker, ELabel, GEvent.addListenerGMarkerELabelGEvent.addListener Add tiled WMS to Google Maps: Look at JavaScript for: gmap_wms.js function toggleFadsWMS // implement createWMSTileLayer from gmap_wms.js

13 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer humpback whale national marine sanctuary: Get the data: http://hawaii.gov/dbedt/gis/data/sanctuary.shp.zip Get data summary: ogrinfo –so hihwnms.shp hihwnms Produce KML: ogr2ogr -f KML hihwnms.kml hihwnms.shp Produce GeoJSON: ogr2ogr -t_srs "EPSG:4326" -f GeoJSON hihwnms.json hihwnms.shp

14 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer humpback whale national marine sanctuary: View page source of http://pacioos.org/outreach/gis_workshop/gmap.htmlhttp://pacioos.org/outreach/gis_workshop/gmap.html Add KML to Google Maps: Look at JavaScript for: function toggleWhale // implement GGeoXmlGGeoXml Add GeoJSON to Google Maps: Look at JavaScript for: function toggleWhaleGeoJson function createWhalePolygon // implement PolylineEncoder, ELabel, GEvent.addListenerPolylineEncoderELabelGEvent.addListener Add tiled WMS to Google Maps: Look at JavaScript for: gmap_wms.js function toggleWhaleWMS // implement createWMSTileLayer from gmap_wms.js

15 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer underwater cables: Get the data: http://hawaii.gov/dbedt/gis/data/cables.zip Get data summary: ogrinfo -so Cables.shp Cables Produce KML: ogr2ogr -f KML Cables.kml Cables.shp Produce GeoJSON: ogr2ogr -t_srs "EPSG:4326" -f GeoJSON Cables.json Cables.shp

16 Command Center: Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer underwater cables: View page source of http://pacioos.org/outreach/gis_workshop/gmap.htmlhttp://pacioos.org/outreach/gis_workshop/gmap.html Add KML to Google Maps: Look at JavaScript for: function toggleCable // implement GGeoXmlGGeoXml Add GeoJSON to Google Maps: Look at JavaScript for: function toggleCableGeoJson function createCablePolyline // implement PolylineEncoder, ELabel, GEvent.addListenerPolylineEncoderELabelGEvent.addListener Add tiled WMS to Google Maps: Look at JavaScript for: gmap_wms.js function toggleCableWMS // implement createWMSTileLayer from gmap_wms.js

17 Synopsis: Here are the sweet spots when applying Goggle Maps for… Richard (Abe) CoughlinHAWAII PACIFIC GIS CONFERENCE 2012 WORKSHOP - Open Source applications in Web MappingJohn Maurer 1.Imagery  untiled imagery are sluggish (but simple) tiles are “good and plenty”: fastest in map but requires storage space can change opacity, specify stack order, and show copyright no time?, no space?: tiled WMS next best can use WMS GetFeatureInfo to query map click for data 2.Points KML: minimal support in Google Maps compared to Google Earthminimal support KML = , WMS = , GeoJSON = MarkerManager is your friendMarkerManager 3.Polygons/Polylines: KML = , WMS = , GeoJSON = PolylineEncoder is your friendPolylineEncoder


Download ppt "John Maurer PacIOOS Hawaii Data Explorer: Workshop Google Maps API Examples:"

Similar presentations


Ads by Google