OpenStreetMap for Web Developers. Serge Wroclawski State of the Map US August 2010



Similar documents
How To Use Mugeda Content

SPHOL213: Intro to Web Content Management in SharePoint 2013

AN INTRODUCTION TO MAPBOX TOOLS AND SOFTWARE. Matt Gregory 24 July 2013

Overview. How It Works

Visualizing MongoDB Objects in Concept and Practice

OpenStreetMap for the Web

Lecture 9 Chrome Extensions

ArcGIS Server mashups

WP Popup Magic User Guide

Quick and Easy Web Maps with Google Fusion Tables. SCO Technical Paper

Developer Tutorial Version 1. 0 February 2015

Adaptive Enterprise Solutions

The Smart Forms Web Part allows you to quickly add new forms to SharePoint pages, here s how:

Using the Google Maps API for Flow Visualization Where on Earth is my Data?

OSM Tile Server. 1 Task Description & Background. Contents. (Version 2) <frederik.ramm@geofabrik.de>,

Integrating Luceo with your Website Using iframes. Version 4.1 Jan 15, 2013

Ingham County Equalization/Tax Mapping Viewer Tutorial

Web Frameworks for Python Geospatial Development

WP Popup Magic User Guide

Publishing KML Services Tutorial

Tracking Internal Traffic

Build an ArcGIS Online Application

Step by Step Guide for GIS Cloud Applications

Introduction... 1 Welcome Screen... 2 Map View Generating a map Map View Basic Map Features... 4

Up and Running with LabVIEW Web Services

Geographic Web Application

We automatically generate the HTML for this as seen below. Provide the above components for the teaser.txt file.

Iceberg Commerce Video Gallery Extension 2.0 For Magento Version 1.3, 1.4, 1.5, 1,6

What's new in gvsig Desktop 2.0

Community Health Maps Lab Series:

Creating Acrobat Forms Acrobat 9 Professional

IMRG Peermap API Documentation V 5.0

Welcome to the Shortlist story map application template

Table Of Contents: I. MapifyPro: Installation. II. General Overview & License Activation. III. Map Settings. IV. Map Location Settings. V.

Your Blueprint websites Content Management System (CMS).

Building and Deploying Web Applications

GEM global earthquake model. User guide: Android mobile tool for field data collection. Rosser, J., J.G. Morley, A. Vicini. Data capture tools

Neues vom QGIS Server und QGIS-Webclient

Camtasia Recording Settings

introduces the subject matter, presents clear navigation, is easy to visually scan, and leads to more in-depth content. Additional Resources 10

6. If you want to enter specific formats, click the Format Tab to auto format the information that is entered into the field.

How To Draw A Pie Chart On Google Charts On A Computer Or Tablet Or Ipad Or Ipa Or Ipam Or Ipar Or Iporom Or Iperom Or Macodeo Or Iproom Or Gorgonchart On A

Filtered Views for Microsoft Dynamics CRM

HANDS-ON WORKSHOP TOOLS FOR SPATIAL DATA VISUALIZATION: Using selected Open Source tools and Open Data to visualize your own spatial data

Basic tutorial for Dreamweaver CS5

App Development for Modern UI MODULE 4: APP DEVELOPMENT ESSENTIALS

Spectrum Technology Platform

Tutorial: Building a Dojo Application using IBM Rational Application Developer Loan Payment Calculator

Combining Drupal Content Management System with OGC Web Services

Traitware Authentication Service Integration Document

Contents. The OWRB Floodplain Viewer. Creating Maps Helpful Tips... 10

M GIS. A Short Introduction to Volunteered Geographic Information Presentation of the OpenStreetMap Project

GEO 425, Spring 2012 LAB 3: Introduction to Web Map Services

Pay with Amazon Integration Guide

Magento module Documentation

Creating Fill-able Forms using Acrobat 8.0: Part 1

MASTERTAG VALUE-ADDED SERVICES FOR ADVERTISERS SET-UP GUIDE

AUTOMATED CONFERENCE CD-ROM BUILDER AN OPEN SOURCE APPROACH Stefan Karastanev

Exercises for Data Visualisation for Analysis in Scholarly Research

First Bytes Programming Lab 2

How to use Google Analytics to track clicks from within s

Create interactive web graphics out of your SAS or R datasets

Google Sites: Creating, editing, and sharing a site

M-Files Gantt View. User Guide. App Version: Author: Joel Heinrich

Title: A vulnerability in Google AdSense. Automatic extraction of links to ads.

Working with Indicee Elements

TIBCO Spotfire Business Author Essentials Quick Reference Guide. Table of contents:

Tableau Server Trusted Authentication

Ulyxes automatic deformation monitoring system

WebFOCUS BI Portal: S.I.M.P.L.E. as can be

Adding 3rd-Party Visualizations to OBIEE Kevin McGinley

HANDS-ON WORKSHOP: SPATIAL DATA VISUALIZATION Using selected Open Source tools and Open Data to visualize your own spatial data

Designing and Implementing Forms 34

SiteBuilder 2.1 Manual

Visualizing a Neo4j Graph Database with KeyLines

Data Visualization Using Google Maps: the Hard Way and the Easy Way

Portals and Hosted Files

ArcGIS online Introduction Module 1: How to create a basic map on ArcGIS online Creating a public account with ArcGIS online...

Report Author User Guide Galigeo s BI*Where for SAP BO Location Intelligence Platform. Quick Start Guide

Config Guide. Gimmal Smart Tiles (SharePoint-Hosted) Software Release 4.4.0

Adding Links to Resources

Macromedia Dreamweaver 8 Developer Certification Examination Specification

Spotfire v6 New Features. TIBCO Spotfire Delta Training Jumpstart

About the Salesforce1 Mobile App Workbook...1. Tutorial 1: Initial Set Up...2. Tutorial 2: Use the Mobile App...4

CRM Developer Form

Visualizing an OrientDB Graph Database with KeyLines

Embedded BI made easy

How To Create A Site In Sharepoint 2013

House Design Tutorial

TIBCO Spotfire Web Player Release Notes

How to georectify an image in ArcMap 10

Getting Started Guide

Google AdWords TM Conversion Tracking Guide

Create and share a map with GIScloud.com

Transcription:

OpenStreetMap for Web Developers Serge Wroclawski State of the Map US August 2010

You'll get the most out of this talk if... You know HTML You know some Javascript You have a basic understanding of mapping (lat, long)

What we'll cover Simple embedded maps Controlling the map with OpenLayers Controlling the view, zoom Multiple layers Multi-Marker maps Map searching

Adding a simple map to our web site 1) Pick an area you want to map on openstreetmap.org 2) Click Export on top 3) Paste the HTML snippet into your web page 4) Make yourself a peanut butter sandwich

Clicking Embed

What does that look like? <html> <head> <title>my first embedded OpenStreetMap page</title> </head> <body> <iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.openstreetmap.org/export/embed.html?bbox=- 77.04819,38.98687,-77.01669,39.00181&layer=mapnik" style="border: 1px solid black"></iframe> <br /> <small> <a href="http://www.openstreetmap.org/?lat=38.99434&lon=- 77.03244&zoom=14&layers=M">View Larger Map</a> </small> </body </html>

And how does it look?

Adding a marker We want to add a marker (pin) to our map OSM's export allows us to to do that

Circling Back We've covered the most common use cases for embedding OSM Showing an area Placing a marker to indicate location OpenStreetMap.org makes this easy

Jargon Tiles images in a slippy map Render process of turning raw data into visual representation Geocoding Location search. The locational result of a query

OSM vs Commercial Mapping Services Traditional Commercial Maps Rendered maps Developer Key Single API Single provider OpenStreetMap Rendered maps or raw data Multiple APIs No developer key needed Several providers (some free, some commercial Ability to roll your own

Mapstraction Mapstraction provides a single, simple overlay to multiple mapping providers OpenStreetMap, Google, Yahoo Provides several abstractions for OSM Alternatively OpenLayers, OpenIcon, Nominatim Recommended even if you're using another provider

Tiles A map is made up of many images called tiles The tiles are close together so they appear as a single image As the user scrolls across the map, new tiles are loaded

Layers A map layer consists of data from one datasource A map consists of one or more layers Layers are georectified (aligned) and projected on top of one another

Our First Map Create a div to hold the map Create a map associated with that div Add OSM as a layer to the map <div id="ourmap"></div> <script src="http://www.openlayers.org/api/openlayers.js"> </script> <script> map = new OpenLayers.Map("ourMap"); map.addlayer(new OpenLayers.Layer.OSM()); map.zoomtomaxextent(); </script>

Mapping a Specific Area Option 1: Selecting a point and zooming to it Find the point you like Specify the point as the center and manually specify zoom level Option 2: Zooming to an extent Find the bounding box Set the map to zoom there Hope the zoom is what you want

Zooming to a specific object We have the lat/long of our object If you don't know it, we'll discuss that later Create our map Transform our point to EPSG:4326 Set the centerpoint and zoom map = new OpenLayers.Map("demoMap"); map.addlayer(new OpenLayers.Layer.OSM()); ourpoint = new OpenLayers.LonLat( 77.04, 38.99) ourpoint.transform(new OpenLayers.Projection("EPSG:4326" ), map.getprojectionobject()); map.setcenter(ourpoint, 17);

Finding the bounding box of an area We want to provide a map of a specific location First we have to define that area in terms of a bounding box If you don't know the boundries, use OSM's export tab Export displays the top, right, left and bottom boundries

Zooming to a bounding box Create our map Create our bounds Transform them Set the zoomtoextent and set it to try to get the cloesest zoom (defaults to false) map = new OpenLayers.Map("demoMap"); map.addlayer(new OpenLayers.Layer.OSM()); map = new OpenLayers.Map("demoMap"); map.addlayer(new OpenLayers.Layer.OSM()); bounds = new OpenLayers.Bounds( 77.03949, 38.9899, 77.02625, 39.99684); bounds.transform(new OpenLayers.Projection("EPSG:4326"), map.getprojectionobject()); map.zoomtoextent(bounds, true);

Adding a Marker and infobox to a map We want to create a marker (pin) on the map We also want to set a title on the label And some more detailed information on a popup box We need to make a new layer Set the label and info box

Adding our marker Make our map Set the default projection Set another projection Add our marker layer map = new OpenLayers.Map("map", { projection: "EPSG:900913", displayprojection: "EPSG:4326"}); map.addlayer(new OpenLayers.Layer.OSM()); var markers = new OpenLayers.Layer.Text( "text", {location: "./markers.txt", projection: map.displayprojection}); map.addlayer(markers); map.zoomtomaxextent();

OSM Search Search/Geocoding is included in OpenStreetMap Called Nominatim Use it online: http://nominatim.openstreetmap.org/search Pass it parameters: format = {xml json html} (defaults to html) q = {my search parameter} viewbox = {left,top,right,bottom} constrain search to a bounding box It also groks some special words as key/value pairs so cafe becomes amenity=cafe and some translation as well

A query to Nominatim I'm using Ruby RestClient Use whatever you like. You could do it via Javascript too, if you knew more JS than me result = RestClient.get 'http://nominatim.openstreetmap.org/search', {:params => {:q => 'McDonalds Silver Spring MD', :format => 'json'}}.to_s results = JSON.parse(result.to_s) Now we have our results in an array!

Analyzing a Result {"lon"=> 77.030243, "place_id"=>9175196, "class"=>"amenity", "icon"=> "http://nominatim.openstreetmap.org/images/mapicons/food_fastfood.p.20.png", "type"=>"fast_food", "osm_id"=>480594520, "display_name"=> "McDonalds, 8507, Colesville Road, Sligo, Washington, Montgomery County, 20910, Maryland, United States of America", "licence"=> "Data Copyright OpenStreetMap Contributors, Some Rights Reserved. CC BY SA 2.0.", "lat"=>38.9949658, "boundingbox"=> [38.9948654174805, 38.9950675964355, 77.0303497314453, 77.0301361083984], "osm_type"=>"node"}

Where to go from here? Mapping Libraries Rendering Implementing OSM in your environment Commercial Support

Mapping Libraries OpenLayers We only barely scratched the surface Mapstraction Easier to use, Much less mature Commercial Alternatives CloudMade API Uses OSM Data, comprehensive, easier to use, more featureful Mapquest/AOL? Bing?

Rendering Commercial Rendering Services Cloudmade Commercial Support DIY Several Companies (Geofabrik, others) Mapnik OSMRender

Your Own OSM Service OSM Components DB Rails Mapnik Apache Glue

Commercial Support Custom Rendering Cloudmade offers custom tile rendering on their hardward OSM Support Many individuals and companies offer support for installing/maintaining private OSM instances Listed on the OSM Wiki

Thank You!