SlideShare une entreprise Scribd logo
1  sur  75
Télécharger pour lire hors ligne
Location
                                  Location
                                  Location

                      Gavin Heavyside - ACCU 2013 - 12 April 2012
                        gavin@heavyside.co.uk @gavinheavyside
Friday, 12 April 13
Friday, 12 April 13
GPS, Location, GIS, and
                       Spatial Relationships
                      • GPS Technology
                      • GIS and Mapping Concepts
                      • Spatial DBs and SQL
                      • Practical Example

Friday, 12 April 13
Friday, 12 April 13
• www.mydrivesolutions.com
                      • Insurance telematics
                      • Linux,Ruby, Rails, Postgres, PostGIS,
                        NoSQL, Chef, AWS, C++


Friday, 12 April 13
Friday, 12 April 13
• I have no idea what I’m doing




Friday, 12 April 13
GPS


                      • Currently 32 satellites



Friday, 12 April 13
GPS




Friday, 12 April 13
Basic GPS Concepts
                      • 24+ Satellites orbit the earth
                      • Atomic clocks
                      • Each constantly transmits its time and
                        location




Friday, 12 April 13
Basic GPS Concepts

                      • Normally 4 or more sats used by receiver
                      • Distance to each satellite calculated using
                        speed of light
                      • Triangulate position
                      • Derived attributes - speed, bearing

Friday, 12 April 13
http://www.ausairpower.net/TE-GPS-Guided-Weps.html


Friday, 12 April 13
Almanac and Ephemeris

                      • Almanac: GPS constellation info, orbits
                      • Ephemeris: orbital and clock correction
                      • With both in memory, lock is faster
                      • A-GPS gets ephemeris from internet

Friday, 12 April 13
NMEA 0183
                      • Serial ASCII data format
                      • CSV ‘sentences’ for different types of data




Friday, 12 April 13
NMEA Sentences

                      • GGA - Fix information
                      • GSA - DOP and active satellites
                      • GSV - Satellites in view
                      • RMC - Time, date and position

Friday, 12 April 13
Friday, 12 April 13
Problems with GPS

                      • Noise
                      • Urban Canyons
                      • Multipath signals
                      • Solar flares and atmospherics
                      • Mounting of receiver

Friday, 12 April 13
Others

                      • GLONASS
                      • BEIDOU/COMPASS
                      • GALILEO
                      • IRNSS

Friday, 12 April 13
Smartphone Support

                      • All major smartphones have GPS sensors
                      • Balance accuracy, frequency, battery life
                      • Usually subscribe to service and get called
                        back with location updates
                      • Alerts: Geofencing, Significant Change

Friday, 12 April 13
HTML5 GeoLocation




Friday, 12 April 13
Friday, 12 April 13
Digital Maps
                      • Commercial
                       • NAVTEQ, Tele Atlas
                      • Free
                       • OSM
                      • Online
                       • Google, Bing, etc
Friday, 12 April 13
Display
                      • Usually map tiles at different zoom levels
                      • Server will return tiled images for a
                        bounding box
                      • Plenty of libraries commercial or free to
                        embed in apps or web pages
                      • Add your own overlay markers and layers

Friday, 12 April 13
Leaflet
                      • JS plugin
                      • Uses OSM or other tile servers
                      • HW accelerated, touch-compatible
                      • Markers, Polygons, Layers, GeoJSON
                      • http://leafletjs.com


Friday, 12 April 13
Friday, 12 April 13
Digital maps for GIS

                      • Vector representation of your map
                      • Commercial or OSM
                      • Use the road or feature geometry, in
                        conjunction with attributes of the features




Friday, 12 April 13
OpenStreetMap
                      • http://www.openstreetmap.org/
                      • Community generated and curated
                      • XML geometry and metadata composed of
                        nodes, ways, and relations
                      • Can be downloaded in regions, updated
                        incrementally


Friday, 12 April 13
Friday, 12 April 13
Friday, 12 April 13
• Some people when faced with a problem
                        think “I know, I’ll use XML”. Now they have




Friday, 12 April 13
Data Formats




Friday, 12 April 13
Geometry Types

                      • Points
                      • Linestrings
                      • Polygons
                      • Compound: MultiPoint etc
                      • 3D: all above with elevation, Polyhedrals

Friday, 12 April 13
Well-Known Text
                               (WKT)
                      • markup language for vector geometry
                      • ISO standard, originally by OGC
                      • Always uses X Y, so watch out when using
                        lat and lon: needs to be (lon lat)
                      • Also an equivalent Well Known Binary used
                        by databases to store spatial data
                      • Can embed SRID (see later)
Friday, 12 April 13
WKT Examples
                      • Point(30 10)
                      • LINESTRING (30 10, 10 30, 40 40)
                      • POLYGON ((30 10, 10 20, 20 40,
                        40 40, 30 10))
                      • POLYGON ((35 10, 10 20, 15 40,
                        45 45, 35 10),(20 30, 35 35,
                        30 20, 20 30))


Friday, 12 April 13
KML

                      • XML data format used by Google Earth
                      • Supports points, lines, markers, polygons,
                        overlays, and much much more
                      • Zip up with assets (e.g. Collada 3D models)
                        into a .kmz file



Friday, 12 April 13
KML




Friday, 12 April 13
Friday, 12 April 13
GeoJSON




Friday, 12 April 13
ShapeFiles
                      • Created by ESRI
                      • Widely used and understood
                      • Points, Lines, Polygons
                      • Collection of files: .shp, .shx, .dbf, others
                      • Can be imported straight into PostGIS with
                        shp2pgsql


Friday, 12 April 13
Friday, 12 April 13
Spatial Reference
                                Systems
                      • The Earth is not flat
                      • Neither is it a spheroid
                       • nor even an ellipsoid
                      • Spatial Reference Systems approximate the
                        geoid of the earth to an ellipsoid



Friday, 12 April 13
Geoid




Friday, 12 April 13
WGS84

                      • The most common (and most useful)
                        spatial reference system
                      • best fitting ellipsoid model to the reference
                        points on the 1996 Earth Gravitational
                        Model geoid
                      • Used by GPS

Friday, 12 April 13
Friday, 12 April 13
Projections

                      • Projections    • Orientation
                       • Cylindrical    • Oblique
                       • Conic          • Equatorial
                       • Azimuthal      • Transverse

Friday, 12 April 13
Transverse Mercator
                      • Some projections look good over most of
                        the globe
                      • Some are only useful locally (e.g. UTM)




Friday, 12 April 13
Geospatial Databases

                      • Ordinary RDBs with support for spatial
                        data types
                      • NoSQL DBs
                       • MongoDB
                       • https://github.com/neo4j/spatial

Friday, 12 April 13
PostGIS

                      • http://postgis.org/
                      • Geospatial Extensions for PostgreSQL
                      • Excellent support for spatial data,
                        operations, indexes
                      • Actively developed

Friday, 12 April 13
Creating a PostGIS DB




Friday, 12 April 13
Spatial Relationships
                      • Many ways to compare geometries
                      • Some can compare different types
                      • Some only valid for same type
                      • CONTAINS, CROSSES, DISJOINT,
                        DISTANCE, DWITHIN, EQUALS,
                        INTERSECTS, OVERLAPS, TOUCHES,
                        WITHIN


Friday, 12 April 13
ST_Equals




Friday, 12 April 13
ST_Intersects




Friday, 12 April 13
ST_DWithin




Friday, 12 April 13
ST_Transform




Friday, 12 April 13
Geography Data Type

                      • Usually measurements are in the units of
                        the spatial reference system
                      • Radians for SRID 4326 (WGS84)
                      • The geography data type can help


Friday, 12 April 13
Geospatial Indexes

                      • Indexes on geo columns are necessary
                      • Covers bounding boxes
                      • Reduces search space
                       • Geos used for calculations

Friday, 12 April 13
EXPLAIN
                      • Use EXPLAIN to check the planner is using
                        spatial indexes, just like other SQL queries




Friday, 12 April 13
Ordnance Survey
                            OpenData

                      • http://www.ordnancesurvey.co.uk/
                        oswebsite/products/os-opendata.html
                      • Vector & Raster data
                      • Maps, Roads, Boundaries, Postcodes


Friday, 12 April 13
Friday, 12 April 13
Code-Point Open

                      • CSV "Database" of UK postcode
                      • (Not Northern Ireland)
                      • 1.6m+ postcodes
                      • Eastings and Northings for each entry
                      • Also county/district & NHS info

Friday, 12 April 13
Data Format
                      • Postcode in field 1




Friday, 12 April 13
Data Format
                      • Eastings, Northings in fields 3,4




Friday, 12 April 13
OS National Grid




Friday, 12 April 13
Geocoding

                      • Find the geographic location of a feature,
                        e.g. address, business, POI
                      • Reverse: Find a feature from a geographic
                        location (e.g. lat/lng)




Friday, 12 April 13
Example App

                      • Put it all together:
                       • Open Data
                       • PostGIS
                       • CRS transformations
                       • Geospatial DB queries

Friday, 12 April 13
Friday, 12 April 13
GeoPostCoder

                      • https://github.com/gavinheavyside/
                        geopostcoder
                      • Bash and SQL to load postcode geo data
                      • Simple Ruby web app to query DB


Friday, 12 April 13
Loading Data

                      • Filter Code-Point Open just to the columns
                        we want
                      • Load into a temporary table
                      • Transform National Grid coordinates to
                        WGS Geography data type



Friday, 12 April 13
Friday, 12 April 13
Friday, 12 April 13
Friday, 12 April 13
Friday, 12 April 13
Friday, 12 April 13
Recap
                      • Lots of sources of location data
                      • You probably have a GPS receiver with you
                      • Lots of data available for free
                      • Plenty of free and open-source tools
                        querying and manipulating spatial data
                      • Go do something interesting with it :)
Friday, 12 April 13
@gavinheavyside
   gavin@heavyside.co.uk

Friday, 12 April 13

Contenu connexe

En vedette

Maximize How You Individualize: because the Journey and Outcome Matter
Maximize How You Individualize: because the Journey and Outcome Matter  Maximize How You Individualize: because the Journey and Outcome Matter
Maximize How You Individualize: because the Journey and Outcome Matter Nicholas Kontopoulos
 
Discussing characters within thriller
Discussing characters within thrillerDiscussing characters within thriller
Discussing characters within thrillerguest743866
 
Jhonner rondon informatica tema vi
Jhonner rondon informatica tema viJhonner rondon informatica tema vi
Jhonner rondon informatica tema vijhonner Rondon
 
前端工程與Rwd _ 中原大學資管系
前端工程與Rwd _ 中原大學資管系前端工程與Rwd _ 中原大學資管系
前端工程與Rwd _ 中原大學資管系彭其捷 Jack
 
كيفية انشاء حساب جديد
كيفية انشاء حساب جديدكيفية انشاء حساب جديد
كيفية انشاء حساب جديدainoulmeneinfo
 
Orientazioa kontrol txartela
Orientazioa kontrol txartelaOrientazioa kontrol txartela
Orientazioa kontrol txartelaEsther
 
Silk leadership lab_januari_2015_brochure
Silk leadership lab_januari_2015_brochureSilk leadership lab_januari_2015_brochure
Silk leadership lab_januari_2015_brochureSilk Lab
 
Coding Dojo - Surrey Rubyists #2 - 26 April 2011
Coding Dojo - Surrey Rubyists #2 - 26 April 2011Coding Dojo - Surrey Rubyists #2 - 26 April 2011
Coding Dojo - Surrey Rubyists #2 - 26 April 2011Gavin Heavyside
 
06 05 kingdom a-right luke 6 20-31 final
06 05 kingdom a-right luke 6 20-31 final06 05 kingdom a-right luke 6 20-31 final
06 05 kingdom a-right luke 6 20-31 finalSSMC
 
"I will build My church and the gates of hell shall not prevail agaist it"
"I will build My church and the gates of hell shall not prevail agaist it" "I will build My church and the gates of hell shall not prevail agaist it"
"I will build My church and the gates of hell shall not prevail agaist it" SSMC
 
Presentation web 2.0
Presentation web 2.0Presentation web 2.0
Presentation web 2.0maucgg80
 
Kizzar Images 1
Kizzar Images 1Kizzar Images 1
Kizzar Images 1robink54
 
Father’s Day Sermon 17th June 2012
Father’s Day Sermon 17th June 2012Father’s Day Sermon 17th June 2012
Father’s Day Sermon 17th June 2012SSMC
 
Social Evaluation
Social EvaluationSocial Evaluation
Social Evaluationguest743866
 
Raising godly children 19 jun 15
Raising godly children 19 jun 15Raising godly children 19 jun 15
Raising godly children 19 jun 15SSMC
 

En vedette (20)

Maximize How You Individualize: because the Journey and Outcome Matter
Maximize How You Individualize: because the Journey and Outcome Matter  Maximize How You Individualize: because the Journey and Outcome Matter
Maximize How You Individualize: because the Journey and Outcome Matter
 
Discussing characters within thriller
Discussing characters within thrillerDiscussing characters within thriller
Discussing characters within thriller
 
Jhonner rondon informatica tema vi
Jhonner rondon informatica tema viJhonner rondon informatica tema vi
Jhonner rondon informatica tema vi
 
前端工程與Rwd _ 中原大學資管系
前端工程與Rwd _ 中原大學資管系前端工程與Rwd _ 中原大學資管系
前端工程與Rwd _ 中原大學資管系
 
كيفية انشاء حساب جديد
كيفية انشاء حساب جديدكيفية انشاء حساب جديد
كيفية انشاء حساب جديد
 
Orientazioa kontrol txartela
Orientazioa kontrol txartelaOrientazioa kontrol txartela
Orientazioa kontrol txartela
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 
Silk leadership lab_januari_2015_brochure
Silk leadership lab_januari_2015_brochureSilk leadership lab_januari_2015_brochure
Silk leadership lab_januari_2015_brochure
 
Coding Dojo - Surrey Rubyists #2 - 26 April 2011
Coding Dojo - Surrey Rubyists #2 - 26 April 2011Coding Dojo - Surrey Rubyists #2 - 26 April 2011
Coding Dojo - Surrey Rubyists #2 - 26 April 2011
 
06 05 kingdom a-right luke 6 20-31 final
06 05 kingdom a-right luke 6 20-31 final06 05 kingdom a-right luke 6 20-31 final
06 05 kingdom a-right luke 6 20-31 final
 
2012 07 24 backbone_1
2012 07 24 backbone_12012 07 24 backbone_1
2012 07 24 backbone_1
 
UC Berkeley
UC BerkeleyUC Berkeley
UC Berkeley
 
"I will build My church and the gates of hell shall not prevail agaist it"
"I will build My church and the gates of hell shall not prevail agaist it" "I will build My church and the gates of hell shall not prevail agaist it"
"I will build My church and the gates of hell shall not prevail agaist it"
 
Presentation web 2.0
Presentation web 2.0Presentation web 2.0
Presentation web 2.0
 
Mis Trabajos
Mis TrabajosMis Trabajos
Mis Trabajos
 
Kizzar Images 1
Kizzar Images 1Kizzar Images 1
Kizzar Images 1
 
Number
NumberNumber
Number
 
Father’s Day Sermon 17th June 2012
Father’s Day Sermon 17th June 2012Father’s Day Sermon 17th June 2012
Father’s Day Sermon 17th June 2012
 
Social Evaluation
Social EvaluationSocial Evaluation
Social Evaluation
 
Raising godly children 19 jun 15
Raising godly children 19 jun 15Raising godly children 19 jun 15
Raising godly children 19 jun 15
 

Similaire à Location Location Location

Pig and Python to Process Big Data
Pig and Python to Process Big DataPig and Python to Process Big Data
Pig and Python to Process Big DataShawn Hermans
 
Osm techniques and developemnt
Osm techniques and developemntOsm techniques and developemnt
Osm techniques and developemntDongpo Deng
 
Visualisation of Big Imaging Data
Visualisation of Big Imaging DataVisualisation of Big Imaging Data
Visualisation of Big Imaging DataSlava Kitaeff, PhD
 
Geo Tools for First Responders - SOTM US 2014 - Full Version
Geo Tools for First Responders - SOTM US 2014 - Full VersionGeo Tools for First Responders - SOTM US 2014 - Full Version
Geo Tools for First Responders - SOTM US 2014 - Full Versionnfgusedautoparts
 
Graph database & neo4j
Graph database & neo4jGraph database & neo4j
Graph database & neo4jSandip Jadhav
 
OpenStreetMap in 3D - current developments
OpenStreetMap in 3D - current developmentsOpenStreetMap in 3D - current developments
OpenStreetMap in 3D - current developmentsvirtualcitySYSTEMS GmbH
 
20121216 OSM Taiwan Workshop
20121216 OSM Taiwan Workshop20121216 OSM Taiwan Workshop
20121216 OSM Taiwan WorkshopDongpo Deng
 
GIS and Map Tiles
GIS and Map TilesGIS and Map Tiles
GIS and Map TilesPetr Pridal
 
Clustering large-scale data Buzzwords 2013 full
Clustering large-scale data Buzzwords 2013 fullClustering large-scale data Buzzwords 2013 full
Clustering large-scale data Buzzwords 2013 fullDan-George Filimon
 
Spatial Data, KML, and the University Web
Spatial Data, KML, and the University WebSpatial Data, KML, and the University Web
Spatial Data, KML, and the University WebGlennon Alan
 
Behunin and lasslo inexpensive mobile mapping solutions
Behunin and lasslo inexpensive mobile mapping solutionsBehunin and lasslo inexpensive mobile mapping solutions
Behunin and lasslo inexpensive mobile mapping solutionsGeCo in the Rockies
 
GNO Code: Geospatial Visualization in the Browser - An Overview
GNO Code: Geospatial Visualization in the Browser - An OverviewGNO Code: Geospatial Visualization in the Browser - An Overview
GNO Code: Geospatial Visualization in the Browser - An OverviewRob Schley
 
Proud to be polyglot!
Proud to be polyglot!Proud to be polyglot!
Proud to be polyglot!NLJUG
 
Saving Money with Open Source GIS
Saving Money with Open Source GISSaving Money with Open Source GIS
Saving Money with Open Source GISbryanluman
 
Maps4 finland 28.8.2012, pekka sarkola
Maps4 finland 28.8.2012, pekka sarkolaMaps4 finland 28.8.2012, pekka sarkola
Maps4 finland 28.8.2012, pekka sarkolaOlli Rinne
 
Maps4Finland 28.8.2012, Pekka Sarkola
Maps4Finland 28.8.2012, Pekka SarkolaMaps4Finland 28.8.2012, Pekka Sarkola
Maps4Finland 28.8.2012, Pekka SarkolaApps4Finland
 
Cassandra Hadoop Best Practices by Jeremy Hanna
Cassandra Hadoop Best Practices by Jeremy HannaCassandra Hadoop Best Practices by Jeremy Hanna
Cassandra Hadoop Best Practices by Jeremy HannaModern Data Stack France
 
The Whitebox Geospatial-Analyisis Tools Project and Open-Access GIS
The Whitebox Geospatial-Analyisis Tools Project and Open-Access GISThe Whitebox Geospatial-Analyisis Tools Project and Open-Access GIS
The Whitebox Geospatial-Analyisis Tools Project and Open-Access GISGolgi Alvarez
 
Analysing OpenStreetMap Data with QGIS
Analysing OpenStreetMap Data with QGISAnalysing OpenStreetMap Data with QGIS
Analysing OpenStreetMap Data with QGISSK53
 

Similaire à Location Location Location (20)

Pig and Python to Process Big Data
Pig and Python to Process Big DataPig and Python to Process Big Data
Pig and Python to Process Big Data
 
Osm techniques and developemnt
Osm techniques and developemntOsm techniques and developemnt
Osm techniques and developemnt
 
Visualisation of Big Imaging Data
Visualisation of Big Imaging DataVisualisation of Big Imaging Data
Visualisation of Big Imaging Data
 
Measure Everything
Measure EverythingMeasure Everything
Measure Everything
 
Geo Tools for First Responders - SOTM US 2014 - Full Version
Geo Tools for First Responders - SOTM US 2014 - Full VersionGeo Tools for First Responders - SOTM US 2014 - Full Version
Geo Tools for First Responders - SOTM US 2014 - Full Version
 
Graph database & neo4j
Graph database & neo4jGraph database & neo4j
Graph database & neo4j
 
OpenStreetMap in 3D - current developments
OpenStreetMap in 3D - current developmentsOpenStreetMap in 3D - current developments
OpenStreetMap in 3D - current developments
 
20121216 OSM Taiwan Workshop
20121216 OSM Taiwan Workshop20121216 OSM Taiwan Workshop
20121216 OSM Taiwan Workshop
 
GIS and Map Tiles
GIS and Map TilesGIS and Map Tiles
GIS and Map Tiles
 
Clustering large-scale data Buzzwords 2013 full
Clustering large-scale data Buzzwords 2013 fullClustering large-scale data Buzzwords 2013 full
Clustering large-scale data Buzzwords 2013 full
 
Spatial Data, KML, and the University Web
Spatial Data, KML, and the University WebSpatial Data, KML, and the University Web
Spatial Data, KML, and the University Web
 
Behunin and lasslo inexpensive mobile mapping solutions
Behunin and lasslo inexpensive mobile mapping solutionsBehunin and lasslo inexpensive mobile mapping solutions
Behunin and lasslo inexpensive mobile mapping solutions
 
GNO Code: Geospatial Visualization in the Browser - An Overview
GNO Code: Geospatial Visualization in the Browser - An OverviewGNO Code: Geospatial Visualization in the Browser - An Overview
GNO Code: Geospatial Visualization in the Browser - An Overview
 
Proud to be polyglot!
Proud to be polyglot!Proud to be polyglot!
Proud to be polyglot!
 
Saving Money with Open Source GIS
Saving Money with Open Source GISSaving Money with Open Source GIS
Saving Money with Open Source GIS
 
Maps4 finland 28.8.2012, pekka sarkola
Maps4 finland 28.8.2012, pekka sarkolaMaps4 finland 28.8.2012, pekka sarkola
Maps4 finland 28.8.2012, pekka sarkola
 
Maps4Finland 28.8.2012, Pekka Sarkola
Maps4Finland 28.8.2012, Pekka SarkolaMaps4Finland 28.8.2012, Pekka Sarkola
Maps4Finland 28.8.2012, Pekka Sarkola
 
Cassandra Hadoop Best Practices by Jeremy Hanna
Cassandra Hadoop Best Practices by Jeremy HannaCassandra Hadoop Best Practices by Jeremy Hanna
Cassandra Hadoop Best Practices by Jeremy Hanna
 
The Whitebox Geospatial-Analyisis Tools Project and Open-Access GIS
The Whitebox Geospatial-Analyisis Tools Project and Open-Access GISThe Whitebox Geospatial-Analyisis Tools Project and Open-Access GIS
The Whitebox Geospatial-Analyisis Tools Project and Open-Access GIS
 
Analysing OpenStreetMap Data with QGIS
Analysing OpenStreetMap Data with QGISAnalysing OpenStreetMap Data with QGIS
Analysing OpenStreetMap Data with QGIS
 

Dernier

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Dernier (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Location Location Location

  • 1. Location Location Location Gavin Heavyside - ACCU 2013 - 12 April 2012 gavin@heavyside.co.uk @gavinheavyside Friday, 12 April 13
  • 3. GPS, Location, GIS, and Spatial Relationships • GPS Technology • GIS and Mapping Concepts • Spatial DBs and SQL • Practical Example Friday, 12 April 13
  • 5. • www.mydrivesolutions.com • Insurance telematics • Linux,Ruby, Rails, Postgres, PostGIS, NoSQL, Chef, AWS, C++ Friday, 12 April 13
  • 7. • I have no idea what I’m doing Friday, 12 April 13
  • 8. GPS • Currently 32 satellites Friday, 12 April 13
  • 10. Basic GPS Concepts • 24+ Satellites orbit the earth • Atomic clocks • Each constantly transmits its time and location Friday, 12 April 13
  • 11. Basic GPS Concepts • Normally 4 or more sats used by receiver • Distance to each satellite calculated using speed of light • Triangulate position • Derived attributes - speed, bearing Friday, 12 April 13
  • 13. Almanac and Ephemeris • Almanac: GPS constellation info, orbits • Ephemeris: orbital and clock correction • With both in memory, lock is faster • A-GPS gets ephemeris from internet Friday, 12 April 13
  • 14. NMEA 0183 • Serial ASCII data format • CSV ‘sentences’ for different types of data Friday, 12 April 13
  • 15. NMEA Sentences • GGA - Fix information • GSA - DOP and active satellites • GSV - Satellites in view • RMC - Time, date and position Friday, 12 April 13
  • 17. Problems with GPS • Noise • Urban Canyons • Multipath signals • Solar flares and atmospherics • Mounting of receiver Friday, 12 April 13
  • 18. Others • GLONASS • BEIDOU/COMPASS • GALILEO • IRNSS Friday, 12 April 13
  • 19. Smartphone Support • All major smartphones have GPS sensors • Balance accuracy, frequency, battery life • Usually subscribe to service and get called back with location updates • Alerts: Geofencing, Significant Change Friday, 12 April 13
  • 22. Digital Maps • Commercial • NAVTEQ, Tele Atlas • Free • OSM • Online • Google, Bing, etc Friday, 12 April 13
  • 23. Display • Usually map tiles at different zoom levels • Server will return tiled images for a bounding box • Plenty of libraries commercial or free to embed in apps or web pages • Add your own overlay markers and layers Friday, 12 April 13
  • 24. Leaflet • JS plugin • Uses OSM or other tile servers • HW accelerated, touch-compatible • Markers, Polygons, Layers, GeoJSON • http://leafletjs.com Friday, 12 April 13
  • 26. Digital maps for GIS • Vector representation of your map • Commercial or OSM • Use the road or feature geometry, in conjunction with attributes of the features Friday, 12 April 13
  • 27. OpenStreetMap • http://www.openstreetmap.org/ • Community generated and curated • XML geometry and metadata composed of nodes, ways, and relations • Can be downloaded in regions, updated incrementally Friday, 12 April 13
  • 30. • Some people when faced with a problem think “I know, I’ll use XML”. Now they have Friday, 12 April 13
  • 32. Geometry Types • Points • Linestrings • Polygons • Compound: MultiPoint etc • 3D: all above with elevation, Polyhedrals Friday, 12 April 13
  • 33. Well-Known Text (WKT) • markup language for vector geometry • ISO standard, originally by OGC • Always uses X Y, so watch out when using lat and lon: needs to be (lon lat) • Also an equivalent Well Known Binary used by databases to store spatial data • Can embed SRID (see later) Friday, 12 April 13
  • 34. WKT Examples • Point(30 10) • LINESTRING (30 10, 10 30, 40 40) • POLYGON ((30 10, 10 20, 20 40, 40 40, 30 10)) • POLYGON ((35 10, 10 20, 15 40, 45 45, 35 10),(20 30, 35 35, 30 20, 20 30)) Friday, 12 April 13
  • 35. KML • XML data format used by Google Earth • Supports points, lines, markers, polygons, overlays, and much much more • Zip up with assets (e.g. Collada 3D models) into a .kmz file Friday, 12 April 13
  • 39. ShapeFiles • Created by ESRI • Widely used and understood • Points, Lines, Polygons • Collection of files: .shp, .shx, .dbf, others • Can be imported straight into PostGIS with shp2pgsql Friday, 12 April 13
  • 41. Spatial Reference Systems • The Earth is not flat • Neither is it a spheroid • nor even an ellipsoid • Spatial Reference Systems approximate the geoid of the earth to an ellipsoid Friday, 12 April 13
  • 43. WGS84 • The most common (and most useful) spatial reference system • best fitting ellipsoid model to the reference points on the 1996 Earth Gravitational Model geoid • Used by GPS Friday, 12 April 13
  • 45. Projections • Projections • Orientation • Cylindrical • Oblique • Conic • Equatorial • Azimuthal • Transverse Friday, 12 April 13
  • 46. Transverse Mercator • Some projections look good over most of the globe • Some are only useful locally (e.g. UTM) Friday, 12 April 13
  • 47. Geospatial Databases • Ordinary RDBs with support for spatial data types • NoSQL DBs • MongoDB • https://github.com/neo4j/spatial Friday, 12 April 13
  • 48. PostGIS • http://postgis.org/ • Geospatial Extensions for PostgreSQL • Excellent support for spatial data, operations, indexes • Actively developed Friday, 12 April 13
  • 49. Creating a PostGIS DB Friday, 12 April 13
  • 50. Spatial Relationships • Many ways to compare geometries • Some can compare different types • Some only valid for same type • CONTAINS, CROSSES, DISJOINT, DISTANCE, DWITHIN, EQUALS, INTERSECTS, OVERLAPS, TOUCHES, WITHIN Friday, 12 April 13
  • 55. Geography Data Type • Usually measurements are in the units of the spatial reference system • Radians for SRID 4326 (WGS84) • The geography data type can help Friday, 12 April 13
  • 56. Geospatial Indexes • Indexes on geo columns are necessary • Covers bounding boxes • Reduces search space • Geos used for calculations Friday, 12 April 13
  • 57. EXPLAIN • Use EXPLAIN to check the planner is using spatial indexes, just like other SQL queries Friday, 12 April 13
  • 58. Ordnance Survey OpenData • http://www.ordnancesurvey.co.uk/ oswebsite/products/os-opendata.html • Vector & Raster data • Maps, Roads, Boundaries, Postcodes Friday, 12 April 13
  • 60. Code-Point Open • CSV "Database" of UK postcode • (Not Northern Ireland) • 1.6m+ postcodes • Eastings and Northings for each entry • Also county/district & NHS info Friday, 12 April 13
  • 61. Data Format • Postcode in field 1 Friday, 12 April 13
  • 62. Data Format • Eastings, Northings in fields 3,4 Friday, 12 April 13
  • 64. Geocoding • Find the geographic location of a feature, e.g. address, business, POI • Reverse: Find a feature from a geographic location (e.g. lat/lng) Friday, 12 April 13
  • 65. Example App • Put it all together: • Open Data • PostGIS • CRS transformations • Geospatial DB queries Friday, 12 April 13
  • 67. GeoPostCoder • https://github.com/gavinheavyside/ geopostcoder • Bash and SQL to load postcode geo data • Simple Ruby web app to query DB Friday, 12 April 13
  • 68. Loading Data • Filter Code-Point Open just to the columns we want • Load into a temporary table • Transform National Grid coordinates to WGS Geography data type Friday, 12 April 13
  • 74. Recap • Lots of sources of location data • You probably have a GPS receiver with you • Lots of data available for free • Plenty of free and open-source tools querying and manipulating spatial data • Go do something interesting with it :) Friday, 12 April 13
  • 75. @gavinheavyside gavin@heavyside.co.uk Friday, 12 April 13