SlideShare a Scribd company logo
1 of 14
Download to read offline
Building Location Aware Apps -
   Get Started with PostGIS

            PART II

          Lasma Sietinsone
       l.sietinsone@ed.ac.uk
Code




   http://gismatic.com/dev8d/scripts/
pgAdmin III – GUI interface for PostgreSQL
psql - PostgreSQL interactive terminal
 Powerful but need to know commands!
PostGIS – quick show around

 • Functions start with ST_*
 • Metadata tables:
   – geometry_columns
   – spatial_ref_sys
 • Utilities:
   – Shp2pgsql (import)
   – Pgsql2shp (export)
EXERCISE 1 - import ESRI Shapefile
 •   File: greater_london_const_region.shp

 •   shp2pgsql, shp2pgsql-gui: load SHP, DBF files
     $ shp2pgsql  --help
     $ shp2pgsql [options] [shapefile schema.table    | psql
         –h [host] –p [port] –U [user] [database]


 •   Derive centroids:
     –   Place labels on the centre point of my geometries

 •   Derive bounding boxes:
     –   Get all Flickr photos that fall within each bounding box

 •   Dissolve/union shapes

 •   View data with QGIS
Desktop GIS Tools – Fun!

• View database contents (QGIS,
  OpenJUMP)
• Create on-the-fly maps (OpenJump)

QGIS – Quantum GIS
 http://www.qgis.org/

OPENJump
 http://www.openjump.org/
EXERCISE 2 - import CSV file with postcodes

 • File: wc.csv
 • Standard formats: CSV, TEXT
    $ psql --help
    $ psql –h [host] –p [port] –U [user] –c “COPY [tablename]
      FROM [filename] WITH CSV DELIMITER ‘,’” [database]


 • Make geometry from latitude & longitude (northing &
   easting)

 • Set spatial reference system

 • Add spatial index

 • Cluster data
EXERCISE 3 - import OSM
 • osm2pgsql: load OSM data
   $   osm2pgsql --help
   $   osm2pgsql [options] planet.osm
   $   osm2pgsql [options] planet.osm.{gz,bz2}
   $   osm2pgsql [options] file1.osm file2.osm file3.osm


 • Query tags

 • Geometry in text, geojson and other formats

 • Align data with different SRS – projections &
   transformations!
Map projections (SRS, SRID)

 • Conformal – preserve angle
    – WGS84 (EPSG:4326) – Google Earth
    – OSGB 1936 (EPSG:27700) - British
      National Grid
    – Google Projection ("EPSG:900913) –
      Google Maps


 • Equal-area – preserve area


 • Equidistance – preserve
   distance for some standard line

 http://spatialreference.org
EXERCISE 4 – backend for “POIs” app

             OSM based nearest POI
              (Point of Intereset)
              queries for location
             enabled mobile device
 e.g.
 pub? (-> food?) -> cash? -> food?
 supermarket??
 hotel?
EXERCISE 4 – backend for “POIs” app (cont.)




      supermarket             supermarket
EXERCISE 4 – backend for “POIs” app (cont.)


 • Create user tables for OSM POIs:
   – 08_demo_init_poi_tables.sql


 • Create stored procedure for location
   queries:
   – 09_demo_stored_procedure.sql
Thank you!




Questions?

More Related Content

What's hot

Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010Dirkjan Bussink
 
COOKPADでのHadoop利用
COOKPADでのHadoop利用COOKPADでのHadoop利用
COOKPADでのHadoop利用Tatsuya Sasaki
 
Journée DevOps : Un outil de monitoring applicatif
Journée DevOps : Un outil de monitoring applicatifJournée DevOps : Un outil de monitoring applicatif
Journée DevOps : Un outil de monitoring applicatifPublicis Sapient Engineering
 
Ec2 region migration_guide
Ec2 region migration_guideEc2 region migration_guide
Ec2 region migration_guideMotokatsu Matsui
 
Adopting OGC Standards in São Paulo Flood Alert System - FOSS4G 2014 - PDX
Adopting OGC Standards in São Paulo Flood Alert System  - FOSS4G 2014 - PDXAdopting OGC Standards in São Paulo Flood Alert System  - FOSS4G 2014 - PDX
Adopting OGC Standards in São Paulo Flood Alert System - FOSS4G 2014 - PDXIvan Martinez
 
Building a developer community with containers
Building a developer community with containersBuilding a developer community with containers
Building a developer community with containersRex Tsai
 
Kissy component system
Kissy component systemKissy component system
Kissy component systemyiming he
 
Google Cluster Innards
Google Cluster InnardsGoogle Cluster Innards
Google Cluster InnardsMartin Dvorak
 
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...mCloud
 
AWS ロボを作ろう JAWSUG Kobe
AWS ロボを作ろう JAWSUG KobeAWS ロボを作ろう JAWSUG Kobe
AWS ロボを作ろう JAWSUG Kobe崇之 清水
 
マーケティングのためのHadoop利用
マーケティングのためのHadoop利用マーケティングのためのHadoop利用
マーケティングのためのHadoop利用Tatsuya Sasaki
 
[PromCon2018] Prometheus Monitoring Mixins: Using Jsonnet to Package Together...
[PromCon2018] Prometheus Monitoring Mixins: Using Jsonnet to Package Together...[PromCon2018] Prometheus Monitoring Mixins: Using Jsonnet to Package Together...
[PromCon2018] Prometheus Monitoring Mixins: Using Jsonnet to Package Together...Grafana Labs
 
Prometheus Monitoring Mixins
Prometheus Monitoring MixinsPrometheus Monitoring Mixins
Prometheus Monitoring MixinsGrafana Labs
 
Syslog-ng Performance
Syslog-ng Performance Syslog-ng Performance
Syslog-ng Performance Chakrit Phain
 
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...Claire Rioualen
 

What's hot (19)

Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010
 
scikit-cuda
scikit-cudascikit-cuda
scikit-cuda
 
COOKPADでのHadoop利用
COOKPADでのHadoop利用COOKPADでのHadoop利用
COOKPADでのHadoop利用
 
Journée DevOps : Un outil de monitoring applicatif
Journée DevOps : Un outil de monitoring applicatifJournée DevOps : Un outil de monitoring applicatif
Journée DevOps : Un outil de monitoring applicatif
 
Ec2 region migration_guide
Ec2 region migration_guideEc2 region migration_guide
Ec2 region migration_guide
 
Adopting OGC Standards in São Paulo Flood Alert System - FOSS4G 2014 - PDX
Adopting OGC Standards in São Paulo Flood Alert System  - FOSS4G 2014 - PDXAdopting OGC Standards in São Paulo Flood Alert System  - FOSS4G 2014 - PDX
Adopting OGC Standards in São Paulo Flood Alert System - FOSS4G 2014 - PDX
 
Building a developer community with containers
Building a developer community with containersBuilding a developer community with containers
Building a developer community with containers
 
Kissy component system
Kissy component systemKissy component system
Kissy component system
 
Google Cluster Innards
Google Cluster InnardsGoogle Cluster Innards
Google Cluster Innards
 
Doom in SpaceX
Doom in SpaceXDoom in SpaceX
Doom in SpaceX
 
IoT Chess
IoT ChessIoT Chess
IoT Chess
 
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
Developers’ mDay 2019. - Rastko Vasiljević, SuperAdmins – Infrastructure as c...
 
AWS ロボを作ろう JAWSUG Kobe
AWS ロボを作ろう JAWSUG KobeAWS ロボを作ろう JAWSUG Kobe
AWS ロボを作ろう JAWSUG Kobe
 
20131212
2013121220131212
20131212
 
マーケティングのためのHadoop利用
マーケティングのためのHadoop利用マーケティングのためのHadoop利用
マーケティングのためのHadoop利用
 
[PromCon2018] Prometheus Monitoring Mixins: Using Jsonnet to Package Together...
[PromCon2018] Prometheus Monitoring Mixins: Using Jsonnet to Package Together...[PromCon2018] Prometheus Monitoring Mixins: Using Jsonnet to Package Together...
[PromCon2018] Prometheus Monitoring Mixins: Using Jsonnet to Package Together...
 
Prometheus Monitoring Mixins
Prometheus Monitoring MixinsPrometheus Monitoring Mixins
Prometheus Monitoring Mixins
 
Syslog-ng Performance
Syslog-ng Performance Syslog-ng Performance
Syslog-ng Performance
 
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
 

Viewers also liked

Building Location Aware Apps - Get Started with PostGIS, PART I
Building Location Aware Apps - Get Started with PostGIS, PART IBuilding Location Aware Apps - Get Started with PostGIS, PART I
Building Location Aware Apps - Get Started with PostGIS, PART Ilasmasi
 
Database testing in postgresql query
Database testing  in postgresql query Database testing  in postgresql query
Database testing in postgresql query mohammed najim
 
Pg intro part1-theory_slides
Pg intro part1-theory_slidesPg intro part1-theory_slides
Pg intro part1-theory_slideslasmasi
 
Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGISmleslie
 
Building a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQLBuilding a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQLKudos S.A.S
 

Viewers also liked (6)

Introduction to post_gis
Introduction to post_gisIntroduction to post_gis
Introduction to post_gis
 
Building Location Aware Apps - Get Started with PostGIS, PART I
Building Location Aware Apps - Get Started with PostGIS, PART IBuilding Location Aware Apps - Get Started with PostGIS, PART I
Building Location Aware Apps - Get Started with PostGIS, PART I
 
Database testing in postgresql query
Database testing  in postgresql query Database testing  in postgresql query
Database testing in postgresql query
 
Pg intro part1-theory_slides
Pg intro part1-theory_slidesPg intro part1-theory_slides
Pg intro part1-theory_slides
 
Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGIS
 
Building a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQLBuilding a Spatial Database in PostgreSQL
Building a Spatial Database in PostgreSQL
 

Similar to Building Location Aware Apps - Get Started with PostGIS, PART II

Getting Started with PostGIS geographic database - Lasma Sietinsone, EDINA
Getting Started with PostGIS geographic database - Lasma Sietinsone, EDINAGetting Started with PostGIS geographic database - Lasma Sietinsone, EDINA
Getting Started with PostGIS geographic database - Lasma Sietinsone, EDINAJISC GECO
 
공간정보연구원 PostGIS 강의교재
공간정보연구원 PostGIS 강의교재공간정보연구원 PostGIS 강의교재
공간정보연구원 PostGIS 강의교재JungHwan Yun
 
Social Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDBSocial Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDBTakahiro Inoue
 
Integrating PostGIS in Web Applications
Integrating PostGIS in Web ApplicationsIntegrating PostGIS in Web Applications
Integrating PostGIS in Web ApplicationsCommand Prompt., Inc
 
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみたスマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみたTaro Matsuzawa
 
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...Ron Reiter
 
Python en la Plataforma ArcGIS
Python en la Plataforma ArcGISPython en la Plataforma ArcGIS
Python en la Plataforma ArcGISXander Bakker
 
LX 공간정보아카데미 PostGIS 강의자료
LX 공간정보아카데미 PostGIS 강의자료LX 공간정보아카데미 PostGIS 강의자료
LX 공간정보아카데미 PostGIS 강의자료JungHwan Yun
 
Automation in ArcGIS using Arcpy
Automation in ArcGIS using ArcpyAutomation in ArcGIS using Arcpy
Automation in ArcGIS using ArcpyGeodata AS
 
Python Map Automation - Introduction of Arcpy Mapping
Python Map Automation - Introduction of Arcpy MappingPython Map Automation - Introduction of Arcpy Mapping
Python Map Automation - Introduction of Arcpy MappingHakanOGUZ3
 
Building Maps with Leaflet
Building Maps with LeafletBuilding Maps with Leaflet
Building Maps with LeafletAndrew Howard
 
State of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open SourceState of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open SourceOSCON Byrum
 
Brust hadoopecosystem
Brust hadoopecosystemBrust hadoopecosystem
Brust hadoopecosystemAndrew Brust
 
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...confluent
 

Similar to Building Location Aware Apps - Get Started with PostGIS, PART II (20)

Getting started with PostGIS geographic database
Getting started with PostGIS geographic databaseGetting started with PostGIS geographic database
Getting started with PostGIS geographic database
 
Getting Started with PostGIS geographic database - Lasma Sietinsone, EDINA
Getting Started with PostGIS geographic database - Lasma Sietinsone, EDINAGetting Started with PostGIS geographic database - Lasma Sietinsone, EDINA
Getting Started with PostGIS geographic database - Lasma Sietinsone, EDINA
 
공간정보연구원 PostGIS 강의교재
공간정보연구원 PostGIS 강의교재공간정보연구원 PostGIS 강의교재
공간정보연구원 PostGIS 강의교재
 
Post gispguk
Post gispgukPost gispguk
Post gispguk
 
Social Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDBSocial Data and Log Analysis Using MongoDB
Social Data and Log Analysis Using MongoDB
 
Integrating PostGIS in Web Applications
Integrating PostGIS in Web ApplicationsIntegrating PostGIS in Web Applications
Integrating PostGIS in Web Applications
 
Patch Maps
Patch MapsPatch Maps
Patch Maps
 
SAADATMAND_PYTHON
SAADATMAND_PYTHONSAADATMAND_PYTHON
SAADATMAND_PYTHON
 
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみたスマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
スマートフォン勉強会@関東 #11 どう考えてもdisconなものをiPhoneに移植してみた
 
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
BDX 2015 - Scaling out big-data computation & machine learning using Pig, Pyt...
 
Python en la Plataforma ArcGIS
Python en la Plataforma ArcGISPython en la Plataforma ArcGIS
Python en la Plataforma ArcGIS
 
LX 공간정보아카데미 PostGIS 강의자료
LX 공간정보아카데미 PostGIS 강의자료LX 공간정보아카데미 PostGIS 강의자료
LX 공간정보아카데미 PostGIS 강의자료
 
Day 6 - PostGIS
Day 6 - PostGISDay 6 - PostGIS
Day 6 - PostGIS
 
Automation in ArcGIS using Arcpy
Automation in ArcGIS using ArcpyAutomation in ArcGIS using Arcpy
Automation in ArcGIS using Arcpy
 
Python Map Automation - Introduction of Arcpy Mapping
Python Map Automation - Introduction of Arcpy MappingPython Map Automation - Introduction of Arcpy Mapping
Python Map Automation - Introduction of Arcpy Mapping
 
Building Maps with Leaflet
Building Maps with LeafletBuilding Maps with Leaflet
Building Maps with Leaflet
 
Geo Location Initial PoC
Geo Location Initial PoCGeo Location Initial PoC
Geo Location Initial PoC
 
State of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open SourceState of the Art Web Mapping with Open Source
State of the Art Web Mapping with Open Source
 
Brust hadoopecosystem
Brust hadoopecosystemBrust hadoopecosystem
Brust hadoopecosystem
 
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
Using Location Data to Showcase Keys, Windows, and Joins in Kafka Streams DSL...
 

Recently uploaded

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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

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
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
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
 
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?
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
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
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
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
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

Building Location Aware Apps - Get Started with PostGIS, PART II

  • 1. Building Location Aware Apps - Get Started with PostGIS PART II Lasma Sietinsone l.sietinsone@ed.ac.uk
  • 2. Code http://gismatic.com/dev8d/scripts/
  • 3. pgAdmin III – GUI interface for PostgreSQL
  • 4. psql - PostgreSQL interactive terminal Powerful but need to know commands!
  • 5. PostGIS – quick show around • Functions start with ST_* • Metadata tables: – geometry_columns – spatial_ref_sys • Utilities: – Shp2pgsql (import) – Pgsql2shp (export)
  • 6. EXERCISE 1 - import ESRI Shapefile • File: greater_london_const_region.shp • shp2pgsql, shp2pgsql-gui: load SHP, DBF files $ shp2pgsql --help $ shp2pgsql [options] [shapefile schema.table | psql –h [host] –p [port] –U [user] [database] • Derive centroids: – Place labels on the centre point of my geometries • Derive bounding boxes: – Get all Flickr photos that fall within each bounding box • Dissolve/union shapes • View data with QGIS
  • 7. Desktop GIS Tools – Fun! • View database contents (QGIS, OpenJUMP) • Create on-the-fly maps (OpenJump) QGIS – Quantum GIS http://www.qgis.org/ OPENJump http://www.openjump.org/
  • 8. EXERCISE 2 - import CSV file with postcodes • File: wc.csv • Standard formats: CSV, TEXT $ psql --help $ psql –h [host] –p [port] –U [user] –c “COPY [tablename] FROM [filename] WITH CSV DELIMITER ‘,’” [database] • Make geometry from latitude & longitude (northing & easting) • Set spatial reference system • Add spatial index • Cluster data
  • 9. EXERCISE 3 - import OSM • osm2pgsql: load OSM data $ osm2pgsql --help $ osm2pgsql [options] planet.osm $ osm2pgsql [options] planet.osm.{gz,bz2} $ osm2pgsql [options] file1.osm file2.osm file3.osm • Query tags • Geometry in text, geojson and other formats • Align data with different SRS – projections & transformations!
  • 10. Map projections (SRS, SRID) • Conformal – preserve angle – WGS84 (EPSG:4326) – Google Earth – OSGB 1936 (EPSG:27700) - British National Grid – Google Projection ("EPSG:900913) – Google Maps • Equal-area – preserve area • Equidistance – preserve distance for some standard line http://spatialreference.org
  • 11. EXERCISE 4 – backend for “POIs” app OSM based nearest POI (Point of Intereset) queries for location enabled mobile device e.g. pub? (-> food?) -> cash? -> food? supermarket?? hotel?
  • 12. EXERCISE 4 – backend for “POIs” app (cont.) supermarket supermarket
  • 13. EXERCISE 4 – backend for “POIs” app (cont.) • Create user tables for OSM POIs: – 08_demo_init_poi_tables.sql • Create stored procedure for location queries: – 09_demo_stored_procedure.sql