SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
GEO Colorado
 RTD Transit Data
    using CartoDB
Key Points
•   Introduce CartoDB
•   Explain about CartoCSS
•   SQL via CartoDB API's
•   Telling your story
CartoDB
• Geospatial mapping
• Data stored in the cloud
• PostGIS engine
• Supports CartoCSS
• SQL API
• Leaflet and Google Maps Libraries
• Graphical Editor for Point & Polygons
• Lots of Examples
• Free 5MB account
• FAST!!!
www.cartodb.com
RTD Transit Data Example
Goal: To create an interactive map to get the
 nearest location from where I am at and to find
 any intersecting routes based on my
 destination.
Requirements:
• Use open data
• Use open source software
• Real Time Interaction
• Enjoyable to users
• Make it informative and Fast!!!
Existing Portal




http://www.rtd-denver.com
Existing Portal




http://www.rtd-denver.com
Existing Portal




http://www.rtd-denver.com
Data & Software

Shapefiles Used
•   http://www.rtd-denver.com/Developer.shtml


Software Used
•   HTML, JavaScript, CSS
•   jQuery
•   CartoDB, Leaflet, CloudMade Tiles
Interative Line Routes
DEMO
http://goo.gl/NWhpG

http://silverbiology.com/projects/cartodb/casestudies/denverrtd/
Resources
CartoCSS:
•   http://mapbox.com/tilemill/docs/manual/carto/
•   http://mapbox.com/carto/latest.html

CartoDB: http://www.cartodb.com

Leaflet: http://leaflet.cloudmade.com/
CartoCSS
#busroutes{
  line-width:2;
  [new_route="16"]{
       line-color:#BD362F
  }
  [new_route="1"]{
       line-color:#51A351
  }
}
SQL Queries
# All stops for a single route
SELECT * FROM
  (SELECT * FROM
      (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as
      new_route, bsid, the_geom FROM busstops) as a
    WHERE a.new_route='6') as b

Regexp_split_to_table ref: http://www.postgresql.org/docs/8.3/static/functions-matching.html


Example: “6, 12, 8, 112, 104” will be transformed to individual rows.
SQL Queries
#closest bus stops
SELECT * FROM busstops
ORDER BY the_geom <-> st_setsrid(st_makepoint(-106, 39),4326)
LIMIT 5


Indexed Nearest Neighbor Search


•   Using the <-> operator, you get the nearest neighbor using the centers of
    the bounding boxes to calculate the inter-object distances.
•   Using the <#> operator, you get the nearest neighbor using the bounding
    boxes themselves to calculate the inter-object distances.

Ref: http://blog.opengeo.org/tag/knn/
WGS 84 (4326) http://spatialreference.org/ref/epsg/4326/
SQL Queries
# returns a row if the bus stops are on the same route
SELECT c.* FROM busroutes c JOIN
   (SELECT a.new_route, a.bsid, b.bsid FROM
         (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as
         new_route, bsid, the_geom FROM busstops WHERE bsid =
         '{{{START STOP ID}}}') as a
         JOIN (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as
         new_route, bsid, the_geom FROM busstops WHERE bsid = '{{{END
         STOP ID}}}') as b ON a.bsid = b.bsid) as d
ON d.new_route = c.route


How to write a query to graph routes for 1st or 2nd degree route. Bus transfers!!!
Failed Queries???
#Only show the line between two points that fall on the bus route
SELECT st_transform( ST_Line_Substring(the_geom,
(SELECT ST_Line_Locate_Point(
(SELECT ST_GeometryN(the_geom,5) FROM busroutes WHERE route='6')
,
(SELECT the_geom FROM (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as new_route,
   bsid, the_geom FROM busstops WHERE bsid = 12978) as a WHERE a.new_route='6'
))),
(SELECT ST_Line_Locate_Point(
(SELECT ST_GeometryN(the_geom,5) FROM busroutes WHERE route='6'),
(SELECT the_geom FROM (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as new_route,
   bsid, the_geom FROM busstops WHERE bsid = 10227) as a WHERE a.new_route='6'
)))), 3857) as the_geom_webmercator
FROM busroutes WHERE route = '6‘
Better Methods & Missing API’s
• PgRoute http://pgrouting.org/
• API for route time tables
• Preferred Transfer locations

Weitere ähnliche Inhalte

Andere mochten auch

Yahoo! Hack University: Accessibility Innovations and Challenges
Yahoo! Hack University: Accessibility Innovations and ChallengesYahoo! Hack University: Accessibility Innovations and Challenges
Yahoo! Hack University: Accessibility Innovations and ChallengesTed Drake
 
intro to information visualization
intro to information visualization intro to information visualization
intro to information visualization Joris Klerkx
 
What All Library Staff Should Know About Open Access to Research
What All Library Staff Should Know About Open Access to Research What All Library Staff Should Know About Open Access to Research
What All Library Staff Should Know About Open Access to Research Robyn Hall
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Andere mochten auch (7)

Creative Commons
Creative CommonsCreative Commons
Creative Commons
 
Census 2010
Census 2010Census 2010
Census 2010
 
The Power Of The Net
The Power Of The NetThe Power Of The Net
The Power Of The Net
 
Yahoo! Hack University: Accessibility Innovations and Challenges
Yahoo! Hack University: Accessibility Innovations and ChallengesYahoo! Hack University: Accessibility Innovations and Challenges
Yahoo! Hack University: Accessibility Innovations and Challenges
 
intro to information visualization
intro to information visualization intro to information visualization
intro to information visualization
 
What All Library Staff Should Know About Open Access to Research
What All Library Staff Should Know About Open Access to Research What All Library Staff Should Know About Open Access to Research
What All Library Staff Should Know About Open Access to Research
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Ähnlich wie Geo CO - RTD Denver

What are customers building with new Bing Maps capabilities
What are customers building with new Bing Maps capabilitiesWhat are customers building with new Bing Maps capabilities
What are customers building with new Bing Maps capabilitiesMicrosoft Tech Community
 
SoTM US Routing
SoTM US RoutingSoTM US Routing
SoTM US RoutingMapQuest
 
OSCON july 2011
OSCON july 2011OSCON july 2011
OSCON july 2011chelm
 
Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGISmleslie
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfAkshatTiwari530170
 
NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...
NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...
NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...DmitryChirkin1
 
Mongoskin - Guilin
Mongoskin - GuilinMongoskin - Guilin
Mongoskin - GuilinJackson Tian
 
2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamskyData Con LA
 
Pgrouting_foss4guk_ross_mcdonald
Pgrouting_foss4guk_ross_mcdonaldPgrouting_foss4guk_ross_mcdonald
Pgrouting_foss4guk_ross_mcdonaldRoss McDonald
 
Postgres Conference (PgCon) New York 2019
Postgres Conference (PgCon) New York 2019Postgres Conference (PgCon) New York 2019
Postgres Conference (PgCon) New York 2019Ibrar Ahmed
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Hidenori Fujimura
 
PostgreSQL 9.4 JSON Types and Operators
PostgreSQL 9.4 JSON Types and OperatorsPostgreSQL 9.4 JSON Types and Operators
PostgreSQL 9.4 JSON Types and OperatorsNicholas Kiraly
 
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016Luigi Dell'Aquila
 
Presto: Optimizing Performance of SQL-on-Anything Engine
Presto: Optimizing Performance of SQL-on-Anything EnginePresto: Optimizing Performance of SQL-on-Anything Engine
Presto: Optimizing Performance of SQL-on-Anything EngineDataWorks Summit
 
Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Postgres vs Mongo / Олег Бартунов (Postgres Professional)Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Postgres vs Mongo / Олег Бартунов (Postgres Professional)Ontico
 
Your Timestamps Deserve Better than a Generic Database
Your Timestamps Deserve Better than a Generic DatabaseYour Timestamps Deserve Better than a Generic Database
Your Timestamps Deserve Better than a Generic Databasejavier ramirez
 

Ähnlich wie Geo CO - RTD Denver (20)

What are customers building with new Bing Maps capabilities
What are customers building with new Bing Maps capabilitiesWhat are customers building with new Bing Maps capabilities
What are customers building with new Bing Maps capabilities
 
Spark - Citi Bike NYC
Spark - Citi Bike NYCSpark - Citi Bike NYC
Spark - Citi Bike NYC
 
SoTM US Routing
SoTM US RoutingSoTM US Routing
SoTM US Routing
 
OSCON july 2011
OSCON july 2011OSCON july 2011
OSCON july 2011
 
Pycon2011
Pycon2011Pycon2011
Pycon2011
 
Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGIS
 
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdfCOMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
COMPUTER SCIENCE PROJECT OF RAILWAY RESERVATION SYSTEM PYTHON PROGRAMMING.pdf
 
NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...
NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...
NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...
 
Mongoskin - Guilin
Mongoskin - GuilinMongoskin - Guilin
Mongoskin - Guilin
 
2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky
 
Making Use of Query Layers & Spatial Views
Making Use of Query Layers & Spatial ViewsMaking Use of Query Layers & Spatial Views
Making Use of Query Layers & Spatial Views
 
Pgrouting_foss4guk_ross_mcdonald
Pgrouting_foss4guk_ross_mcdonaldPgrouting_foss4guk_ross_mcdonald
Pgrouting_foss4guk_ross_mcdonald
 
Postgres Conference (PgCon) New York 2019
Postgres Conference (PgCon) New York 2019Postgres Conference (PgCon) New York 2019
Postgres Conference (PgCon) New York 2019
 
Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性Web+GISという視点から見たGISの方向性
Web+GISという視点から見たGISの方向性
 
PostgreSQL 9.4 JSON Types and Operators
PostgreSQL 9.4 JSON Types and OperatorsPostgreSQL 9.4 JSON Types and Operators
PostgreSQL 9.4 JSON Types and Operators
 
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
Geospatial Graphs made easy with OrientDB - Codemotion Warsaw 2016
 
Presto: Optimizing Performance of SQL-on-Anything Engine
Presto: Optimizing Performance of SQL-on-Anything EnginePresto: Optimizing Performance of SQL-on-Anything Engine
Presto: Optimizing Performance of SQL-on-Anything Engine
 
Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Postgres vs Mongo / Олег Бартунов (Postgres Professional)Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Postgres vs Mongo / Олег Бартунов (Postgres Professional)
 
Oh, that ubiquitous JSON !
Oh, that ubiquitous JSON !Oh, that ubiquitous JSON !
Oh, that ubiquitous JSON !
 
Your Timestamps Deserve Better than a Generic Database
Your Timestamps Deserve Better than a Generic DatabaseYour Timestamps Deserve Better than a Generic Database
Your Timestamps Deserve Better than a Generic Database
 

Mehr von Mike Giddens

SilverBiology DROCG
SilverBiology DROCGSilverBiology DROCG
SilverBiology DROCGMike Giddens
 
Small Herbaria Michigan - SilverCollection
Small Herbaria Michigan - SilverCollectionSmall Herbaria Michigan - SilverCollection
Small Herbaria Michigan - SilverCollectionMike Giddens
 
GeoCO GeoJSON & GeoLocate
GeoCO GeoJSON & GeoLocateGeoCO GeoJSON & GeoLocate
GeoCO GeoJSON & GeoLocateMike Giddens
 
GeoCO Denver Crime Presentation
GeoCO Denver Crime PresentationGeoCO Denver Crime Presentation
GeoCO Denver Crime PresentationMike Giddens
 
iDigBio Presentation - Botany 2012
iDigBio Presentation - Botany 2012iDigBio Presentation - Botany 2012
iDigBio Presentation - Botany 2012Mike Giddens
 

Mehr von Mike Giddens (6)

SilverBiology DROCG
SilverBiology DROCGSilverBiology DROCG
SilverBiology DROCG
 
Small Herbaria Michigan - SilverCollection
Small Herbaria Michigan - SilverCollectionSmall Herbaria Michigan - SilverCollection
Small Herbaria Michigan - SilverCollection
 
GeoCO GeoJSON & GeoLocate
GeoCO GeoJSON & GeoLocateGeoCO GeoJSON & GeoLocate
GeoCO GeoJSON & GeoLocate
 
HelpingScience
HelpingScienceHelpingScience
HelpingScience
 
GeoCO Denver Crime Presentation
GeoCO Denver Crime PresentationGeoCO Denver Crime Presentation
GeoCO Denver Crime Presentation
 
iDigBio Presentation - Botany 2012
iDigBio Presentation - Botany 2012iDigBio Presentation - Botany 2012
iDigBio Presentation - Botany 2012
 

Kürzlich hochgeladen

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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
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
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
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
 
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
 
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
 
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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
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
 

Kürzlich hochgeladen (20)

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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
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)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
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
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
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!
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
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
 
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
 
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
 
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
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
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
 

Geo CO - RTD Denver

  • 1. GEO Colorado RTD Transit Data using CartoDB
  • 2. Key Points • Introduce CartoDB • Explain about CartoCSS • SQL via CartoDB API's • Telling your story
  • 3. CartoDB • Geospatial mapping • Data stored in the cloud • PostGIS engine • Supports CartoCSS • SQL API • Leaflet and Google Maps Libraries • Graphical Editor for Point & Polygons • Lots of Examples • Free 5MB account • FAST!!! www.cartodb.com
  • 4. RTD Transit Data Example Goal: To create an interactive map to get the nearest location from where I am at and to find any intersecting routes based on my destination. Requirements: • Use open data • Use open source software • Real Time Interaction • Enjoyable to users • Make it informative and Fast!!!
  • 8. Data & Software Shapefiles Used • http://www.rtd-denver.com/Developer.shtml Software Used • HTML, JavaScript, CSS • jQuery • CartoDB, Leaflet, CloudMade Tiles
  • 11. Resources CartoCSS: • http://mapbox.com/tilemill/docs/manual/carto/ • http://mapbox.com/carto/latest.html CartoDB: http://www.cartodb.com Leaflet: http://leaflet.cloudmade.com/
  • 12. CartoCSS #busroutes{ line-width:2; [new_route="16"]{ line-color:#BD362F } [new_route="1"]{ line-color:#51A351 } }
  • 13. SQL Queries # All stops for a single route SELECT * FROM (SELECT * FROM (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as new_route, bsid, the_geom FROM busstops) as a WHERE a.new_route='6') as b Regexp_split_to_table ref: http://www.postgresql.org/docs/8.3/static/functions-matching.html Example: “6, 12, 8, 112, 104” will be transformed to individual rows.
  • 14. SQL Queries #closest bus stops SELECT * FROM busstops ORDER BY the_geom <-> st_setsrid(st_makepoint(-106, 39),4326) LIMIT 5 Indexed Nearest Neighbor Search • Using the <-> operator, you get the nearest neighbor using the centers of the bounding boxes to calculate the inter-object distances. • Using the <#> operator, you get the nearest neighbor using the bounding boxes themselves to calculate the inter-object distances. Ref: http://blog.opengeo.org/tag/knn/ WGS 84 (4326) http://spatialreference.org/ref/epsg/4326/
  • 15. SQL Queries # returns a row if the bus stops are on the same route SELECT c.* FROM busroutes c JOIN (SELECT a.new_route, a.bsid, b.bsid FROM (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as new_route, bsid, the_geom FROM busstops WHERE bsid = '{{{START STOP ID}}}') as a JOIN (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as new_route, bsid, the_geom FROM busstops WHERE bsid = '{{{END STOP ID}}}') as b ON a.bsid = b.bsid) as d ON d.new_route = c.route How to write a query to graph routes for 1st or 2nd degree route. Bus transfers!!!
  • 16. Failed Queries??? #Only show the line between two points that fall on the bus route SELECT st_transform( ST_Line_Substring(the_geom, (SELECT ST_Line_Locate_Point( (SELECT ST_GeometryN(the_geom,5) FROM busroutes WHERE route='6') , (SELECT the_geom FROM (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as new_route, bsid, the_geom FROM busstops WHERE bsid = 12978) as a WHERE a.new_route='6' ))), (SELECT ST_Line_Locate_Point( (SELECT ST_GeometryN(the_geom,5) FROM busroutes WHERE route='6'), (SELECT the_geom FROM (SELECT replace(regexp_split_to_table(routes, E','), ' ', '') as new_route, bsid, the_geom FROM busstops WHERE bsid = 10227) as a WHERE a.new_route='6' )))), 3857) as the_geom_webmercator FROM busroutes WHERE route = '6‘
  • 17. Better Methods & Missing API’s • PgRoute http://pgrouting.org/ • API for route time tables • Preferred Transfer locations