SQL For Everything
Geoprocessing and Cartography With
PostGIS

Bill Morris – Geosprocket LLC
Speedy Background
• SQL = Structured Query Language
• Beloved/BeHated by Database Admins
• Runs Behind Nearly Everything

...
Ever Fired Up a Computer?
You’ve Used SQL.

SQL For Everything - Bill Morris - Geosprocket LLC
So What’s PostGIS?
• A spatial extender for the PostgreSQL
database system
• Free as in Speech, Free as in Beer

SQL For E...
What’s Post-PostGIS?
• A parody on Twitter. Pay no mind.

SQL For Everything - Bill Morris - Geosprocket LLC
What’s CartoDB?
• A PostGIS environment built for the web
• “Open-Source Fusion Tables”
• Build your own server:
https://g...
SQL For Everything - Bill Morris - Geosprocket LLC
SQL For Everything - Bill Morris - Geosprocket LLC
Back to SQL.

SQL For Everything - Bill Morris - Geosprocket LLC
SQL as we know it

Source: Chicago Crime Commission & Openstreetmap Contributors
SQL For Everything - Bill Morris - Geospr...
SELECT * FROM territory_all WHERE
“NAME” LIKE ‘Latin%’

Source: Chicago Crime Commission & Openstreetmap Contributors
SQL ...
SELECT * FROM territory_all WHERE
name LIKE ‘Latin%’

SQL For Everything - Bill Morris - Geosprocket LLC
Geoprocessing as we know it

SQL For Everything - Bill Morris - Geosprocket LLC
Geoprocessing in PostGIS

SELECT ST_Whatever( geoprocess! )

SQL For Everything - Bill Morris - Geosprocket LLC
Geoprocessing in PostGIS

SQL For Everything - Bill Morris - Geosprocket LLC
Buffer 500m

SQL For Everything - Bill Morris - Geosprocket LLC
Buffer 500m from the points that
fall on Ashland Ave

SQL For Everything - Bill Morris - Geosprocket LLC
Append two layers of different
geometry types

SQL For Everything - Bill Morris - Geosprocket LLC
Geoprocessing Optimized

…png?sql=…

SQL For Everything - Bill Morris - Geosprocket LLC
?

SQL For Everything - Bill Morris - Geosprocket LLC
This is Familiar

google.com?q=GIS

SQL For Everything - Bill Morris - Geosprocket LLC
…png?sql=…

SQL For Everything - Bill Morris - Geosprocket LLC
http://2.tiles.cartocdn.com/geosprocket/tiles/vtparcels_burlington2002b/15/9714/11850.png

SQL For Everything - Bill Morri...
http://2.tiles.cartocdn.com/geosprocket/tiles/vtparcels_burlington2002b/15/9714/11850.png?sql
=SELECT * FROM vtparcels_bur...
http://2.tiles.cartocdn.com/geosprocket/tiles/vtparcels_burlington2002b/15/9714/11850.png?sql
=SELECT 20 as distance, st_b...
Going off the Rails a Bit . . .

https://gist.github.com/wboykinm/5533575
SQL For Everything - Bill Morris - Geosprocket L...
SQL For Everything - Bill Morris - Geosprocket LLC
A Query Turns This . . .

SQL For Everything - Bill Morris - Geosprocket LLC
Into This.

SQL For Everything - Bill Morris - Geosprocket LLC
I’m barely scratching the surface of SQL here.

https://gist.github.com/wboykinm/5533575
SQL For Everything - Bill Morris ...
Why Care?
Because the web wants to see
your data

SQL For Everything - Bill Morris - Geosprocket LLC
SQL For Everything - Bill Morris - Geosprocket LLC
SQL For Everything - Bill Morris - Geosprocket LLC
SQL For Everything - Bill Morris - Geosprocket LLC
SQL For Everything - Bill Morris - Geosprocket LLC
PostGIS

SQL For Everything - Bill Morris - Geosprocket LLC
Thanks! Accepting all questions:

wboykinm@geosprocket.com

@vtcraghead

SQL For Everything - Bill Morris - Geosprocket LL...
Upcoming SlideShare
Loading in...5
×

Sql for Everything: GIS on the Web

156

Published on

An overview of geoprocessing in its best web incarnation: PostGIS

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
156
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Sql for Everything: GIS on the Web

  1. 1. SQL For Everything Geoprocessing and Cartography With PostGIS Bill Morris – Geosprocket LLC
  2. 2. Speedy Background • SQL = Structured Query Language • Beloved/BeHated by Database Admins • Runs Behind Nearly Everything SQL For Everything - Bill Morris - Geosprocket LLC
  3. 3. Ever Fired Up a Computer? You’ve Used SQL. SQL For Everything - Bill Morris - Geosprocket LLC
  4. 4. So What’s PostGIS? • A spatial extender for the PostgreSQL database system • Free as in Speech, Free as in Beer SQL For Everything - Bill Morris - Geosprocket LLC
  5. 5. What’s Post-PostGIS? • A parody on Twitter. Pay no mind. SQL For Everything - Bill Morris - Geosprocket LLC
  6. 6. What’s CartoDB? • A PostGIS environment built for the web • “Open-Source Fusion Tables” • Build your own server: https://github.com/CartoDB/cartodb20 • Or get a hosted account: http://cartodb.com/ SQL For Everything - Bill Morris - Geosprocket LLC
  7. 7. SQL For Everything - Bill Morris - Geosprocket LLC
  8. 8. SQL For Everything - Bill Morris - Geosprocket LLC
  9. 9. Back to SQL. SQL For Everything - Bill Morris - Geosprocket LLC
  10. 10. SQL as we know it Source: Chicago Crime Commission & Openstreetmap Contributors SQL For Everything - Bill Morris - Geosprocket LLC
  11. 11. SELECT * FROM territory_all WHERE “NAME” LIKE ‘Latin%’ Source: Chicago Crime Commission & Openstreetmap Contributors SQL For Everything - Bill Morris - Geosprocket LLC
  12. 12. SELECT * FROM territory_all WHERE name LIKE ‘Latin%’ SQL For Everything - Bill Morris - Geosprocket LLC
  13. 13. Geoprocessing as we know it SQL For Everything - Bill Morris - Geosprocket LLC
  14. 14. Geoprocessing in PostGIS SELECT ST_Whatever( geoprocess! ) SQL For Everything - Bill Morris - Geosprocket LLC
  15. 15. Geoprocessing in PostGIS SQL For Everything - Bill Morris - Geosprocket LLC
  16. 16. Buffer 500m SQL For Everything - Bill Morris - Geosprocket LLC
  17. 17. Buffer 500m from the points that fall on Ashland Ave SQL For Everything - Bill Morris - Geosprocket LLC
  18. 18. Append two layers of different geometry types SQL For Everything - Bill Morris - Geosprocket LLC
  19. 19. Geoprocessing Optimized …png?sql=… SQL For Everything - Bill Morris - Geosprocket LLC
  20. 20. ? SQL For Everything - Bill Morris - Geosprocket LLC
  21. 21. This is Familiar google.com?q=GIS SQL For Everything - Bill Morris - Geosprocket LLC
  22. 22. …png?sql=… SQL For Everything - Bill Morris - Geosprocket LLC
  23. 23. http://2.tiles.cartocdn.com/geosprocket/tiles/vtparcels_burlington2002b/15/9714/11850.png SQL For Everything - Bill Morris - Geosprocket LLC
  24. 24. http://2.tiles.cartocdn.com/geosprocket/tiles/vtparcels_burlington2002b/15/9714/11850.png?sql =SELECT * FROM vtparcels_burlington2002b WHERE area>8000 SQL For Everything - Bill Morris - Geosprocket LLC
  25. 25. http://2.tiles.cartocdn.com/geosprocket/tiles/vtparcels_burlington2002b/15/9714/11850.png?sql =SELECT 20 as distance, st_buffer(the_geom_webmercator,50) as the_geom_webmercator FROM vtparcels_burlington2002b WHERE area>80000 SQL For Everything - Bill Morris - Geosprocket LLC
  26. 26. Going off the Rails a Bit . . . https://gist.github.com/wboykinm/5533575 SQL For Everything - Bill Morris - Geosprocket LLC
  27. 27. SQL For Everything - Bill Morris - Geosprocket LLC
  28. 28. A Query Turns This . . . SQL For Everything - Bill Morris - Geosprocket LLC
  29. 29. Into This. SQL For Everything - Bill Morris - Geosprocket LLC
  30. 30. I’m barely scratching the surface of SQL here. https://gist.github.com/wboykinm/5533575 SQL For Everything - Bill Morris - Geosprocket LLC
  31. 31. Why Care? Because the web wants to see your data SQL For Everything - Bill Morris - Geosprocket LLC
  32. 32. SQL For Everything - Bill Morris - Geosprocket LLC
  33. 33. SQL For Everything - Bill Morris - Geosprocket LLC
  34. 34. SQL For Everything - Bill Morris - Geosprocket LLC
  35. 35. SQL For Everything - Bill Morris - Geosprocket LLC
  36. 36. PostGIS SQL For Everything - Bill Morris - Geosprocket LLC
  37. 37. Thanks! Accepting all questions: wboykinm@geosprocket.com @vtcraghead SQL For Everything - Bill Morris - Geosprocket LLC
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×