SlideShare a Scribd company logo
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

More Related Content

Viewers also liked

Creative Commons
Creative CommonsCreative Commons
Creative Commons
Beth Gourley
 
Census 2010
Census 2010Census 2010
Census 2010
guest9bba2a1
 
The Power Of The Net
The Power Of The NetThe Power Of The Net
The Power Of The Net
Julian Matthews
 
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
Ted 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 Cars
LinkedIn
 

Viewers also liked (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 to 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 capabilities
Microsoft Tech Community
 
Spark - Citi Bike NYC
Spark - Citi Bike NYCSpark - Citi Bike NYC
Spark - Citi Bike NYC
Sushmanth Sagala
 
SoTM US Routing
SoTM US RoutingSoTM US Routing
SoTM US Routing
MapQuest
 
OSCON july 2011
OSCON july 2011OSCON july 2011
OSCON july 2011
chelm
 
Pycon2011
Pycon2011Pycon2011
Pycon2011
Django Stars
 
Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGIS
mleslie
 
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
AkshatTiwari530170
 
NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...
NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...
NodeUkraine - Postgresql для хипстеров или почему ваш следующий проект должен...
DmitryChirkin1
 
Mongoskin - Guilin
Mongoskin - GuilinMongoskin - Guilin
Mongoskin - Guilin
Jackson Tian
 
2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky2014 bigdatacamp asya_kamsky
2014 bigdatacamp asya_kamsky
Data Con LA
 
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
Northeast Arc Users Group Presentations
 
Pgrouting_foss4guk_ross_mcdonald
Pgrouting_foss4guk_ross_mcdonaldPgrouting_foss4guk_ross_mcdonald
Pgrouting_foss4guk_ross_mcdonald
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
Ibrar 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 Operators
Nicholas 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 2016
Luigi 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 Engine
DataWorks Summit
 
Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Postgres vs Mongo / Олег Бартунов (Postgres Professional)Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Ontico
 
Oh, that ubiquitous JSON !
Oh, that ubiquitous JSON !Oh, that ubiquitous JSON !
Oh, that ubiquitous JSON !
Alexander Korotkov
 
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
javier ramirez
 

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

More from Mike Giddens

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

More from 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
 

Recently uploaded

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 

Recently uploaded (20)

Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 

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