SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
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

Más contenido relacionado

Destacado

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
 

Destacado (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
 

Similar a 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
 

Similar a 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
 

Más de 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
 

Más de 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
 

Último

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 

Último (20)

A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

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