SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
GIS, Python and company

    Igor Pochechuev
    22-23 October, 2011
    Kyiv, Ukraine
Pycon2011
Content
●   What is geometry?
    geometry formats
●   How to store geo data?
    spatial databases
●   Where we can get geo data?
●   Render it!
●   Demo
General provisions
     what we got
Geometry
                       formats

●   WKT, WKB
●   KML, GML (xml based)
●   GeoJSON (json based)
●   Shapefile (ESRI open specification)
●   etc.
Geometry
                     common types

●   Point
    (x, y)
●   Line
    (<point>, <point1>, <point2>, …)
●   Polygon
    (<line>, <line1>, <line2>, …)
MultiGeometry
                 additional types of geometry

●   MultiPoint
    (<point>, <point1>, <point2>, ...)
●   MultiLine
    (<line>, <line1>, <line2>, ...)
●   MultiPolygon
    (<polygon>, <polygon1>, <polygon2>, ...)
Database layer
  storing spatial data
Storing data
                     spatial databases
●   SpatiaLite (SQLite)
●   MySQL
●   Oracle
●   PostGIS (PostgreSQL)
Storing data
   right choice




PostGIS
How to get geo data?
      vector data
Getting data
     vector data


OpenStreetMap
OpenStreetMap
                              stats

●   < 400 000 registered users
●   ~ 1 100 000 000 nodes (points)
●   100 000 000 ways
●   ~ 800 — 3 000 nodes added each day
●   ~ 100 000 — 300 000 ways added each day
●   More statistics:
    http://wiki.openstreetmap.org/wiki/Stats
OpenStreetMap
                              downloading ...

●   Download planet.osm
    http://wiki.openstreetmap.org/wiki/Planet.osm
●   OSM API
    http://api.openstreetmap.org/api/0.6/map?bbox=11.54,48.14,11.543,48.145

●   JOSM (download through desktop app)
    http://wiki.openstreetmap.org/wiki/JOSM
●   Third part services (GIS LAB)
    http://gis-lab.info/projects/osm-export.html
Loading data to database
>wget http://wiki.openstreetmap.org/wiki/Planet.osm
OSM2PgSQL
                                    loading data

●   osm2pgsql
    -d <db_name>
    -H <db_host>
    -U <db_user>
    -P <db_port>
    -c # create tables if needed
    -s # store tmp data in database
    -S osm.import.style # mapping style
    -k # add tags without column to an additional hstore
    -z extra_data # hstore column containing all tags that start with 'extra_data'
    RU-KRS.osm # path to OSM data file
Rendering ...
Rendering
             tool choosing




MapServer                    Mapnik
Mapnik
                       description

●   Written in C++
●   Python interface
●   OpenStreetMap, Flickr, CloudMade use mapnik
●   PostGIS, Shapefiles, GeoTIFF, OSM XML, ...
●   PNG, JPG, SVG, PDF, ...
Mapnik
map example
Layers
 intro
Mapnik
                                  code example

import mapnik

m = mapnik.Map(600,300,"+proj=latlong +datum=WGS84")
m.background = mapnik.Color('steelblue')

r = mapnik.Rule()
r.symbols.append(mapnik.PolygonSymbolizer(mapnik.Color('#f2eff9')))
r.symbols.append(mapnik.LineSymbolizer(mapnik.Color('rgb(50%,50%,50%)'),0.1))

s = mapnik.Style()
s.rules.append(r)
m.append_style('World Style',s)
Mapnik
                                  code example

import mapnik

m = mapnik.Map(600, 300, "+proj=latlong +datum=WGS84")
m.background = mapnik.Color('steelblue')

r = mapnik.Rule()
r.symbols.append(mapnik.PolygonSymbolizer(mapnik.Color('#f2eff9')))
r.symbols.append(mapnik.LineSymbolizer(mapnik.Color('rgb(50%,50%,50%)'),0.1))

s = mapnik.Style()
s.rules.append(r)
m.append_style('World Style',s)
Mapnik
                                  code example

import mapnik

m = mapnik.Map(600, 300, "+proj=latlong +datum=WGS84")
m.background = mapnik.Color('steelblue')

r = mapnik.Rule()
r.symbols.append(mapnik.PolygonSymbolizer(mapnik.Color('#f2eff9')))
r.symbols.append(mapnik.LineSymbolizer(mapnik.Color('rgb(50%,50%,50%)'), 0.1))

s = mapnik.Style()
s.rules.append(r)
m.append_style('World Style',s)
Mapnik
                                  code example

import mapnik

m = mapnik.Map(600, 300, "+proj=latlong +datum=WGS84")
m.background = mapnik.Color('steelblue')

r = mapnik.Rule()
r.symbols.append(mapnik.PolygonSymbolizer(mapnik.Color('#f2eff9')))
r.symbols.append(mapnik.LineSymbolizer(mapnik.Color('rgb(50%,50%,50%)'), 0.1))

s = mapnik.Style()
s.rules.append(r)
m.append_style('World Style',s)
Mapnik
                             code example 2

lyr = mapnik.Layer('world', "+proj=latlong +datum=WGS84")

lyr.datasource = mapnik.Shapefile(file='world_borders.shp')

lyr.styles.append('World Style')

m.layers.append(lyr)

m.zoom_to_box(lyr.envelope())

mapnik.render_to_file(m,'world.png', 'png')
Mapnik
                             code example 2

lyr = mapnik.Layer('world', "+proj=latlong +datum=WGS84")

lyr.datasource = mapnik.Shapefile(file='world_borders.shp')

lyr.styles.append('World Style')

m.layers.append(lyr)

m.zoom_to_box(lyr.envelope())

mapnik.render_to_file(m,'world.png', 'png')
Mapnik
                             code example 2

lyr = mapnik.Layer('world', "+proj=latlong +datum=WGS84")

lyr.datasource = mapnik.Shapefile(file='world_borders.shp')

lyr.styles.append('World Style')

m.layers.append(lyr)

m.zoom_to_box(lyr.envelope())

mapnik.render_to_file(m,'world.png', 'png')
Map in browser
Mapnik
tile description
Mapnik
                       map services

●   Tile Map Service
●   Web Map Service
Mapnik
                    TMS

http: //website.com/<zoom>/<x>/<y>.png

../tiles/12/2451/1360.png
Mapnik
                             using osm scripts

●   svn export http://svn.openstreetmap.org/applications/rendering/...
●   ./generate_xml.py --password 'value' --host 'value' --port 'value'
    --user 'value' --dbname 'value'
●   MAPNIK_MAP_FILE='osm.xml' MAPNIK_TILE_DIR='tiles/'
    ./generate_tiles.py
Mapnik XML
<Map bgcolor="#b5d0d0">
<Style name="map_style">
   <Rule>
       <MaxScaleDenominator>[scale]</MaxScaleDenominator>
       <MinScaleDenominator>[scale]</MinScaleDenominator>
       <Filter>[field]='value'</Filter>
       <PointSymbolizer/>
       <LineSymbolizer/>
       <PolygonSymbolizer/>
       …
   </Rule>
</Style>
Mapnik XML
<Layer name="misc_boundaries">

<StyleName>map_style</StyleName>
<Datasource>
   <Parameter name="table">
       (select way,way_area,name,boundary from polygon
       where boundary='national_park') as boundary
   </Parameter>
   <Parameter name='dbname'>[dbname]</Parameter>
   <Parameter name='host'>[host]</Parameter>
   <Parameter name='user'>[user]</Parameter>
   …
</Datasource>
</Layer>
Tile generating



./generate_tiles.py
Got tiles, what's next?
Frontend maps
                    choosing tool

●   OpenLayers
●   GeoExt
●   Leaflet
OpenLayers
●   Most powerfull
●   Most used
●   Large community
●   OSM supported
●   OSM, Google, Yahoo maps in one string
●   TMS, WMS, WFS
●   GML, GeoJSON, GeoRSS
OpenLayers
Show time!
Thanks!
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Server side geo_tools_in_drupal_pnw_2012
Server side geo_tools_in_drupal_pnw_2012Server side geo_tools_in_drupal_pnw_2012
Server side geo_tools_in_drupal_pnw_2012Mack Hardy
 
OSM data in MariaDB / MySQL - All the world in a few large tables
OSM data in MariaDB / MySQL - All the world in a few large tablesOSM data in MariaDB / MySQL - All the world in a few large tables
OSM data in MariaDB / MySQL - All the world in a few large tableshholzgra
 
Having fun with graphs, a short introduction to D3.js
Having fun with graphs, a short introduction to D3.jsHaving fun with graphs, a short introduction to D3.js
Having fun with graphs, a short introduction to D3.jsMichael Hackstein
 
3D + MongoDB = 3D Repo
3D + MongoDB = 3D Repo3D + MongoDB = 3D Repo
3D + MongoDB = 3D RepoMongoDB
 
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
Spatial functions in  MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and othersSpatial functions in  MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and othersHenrik Ingo
 
Grails : Ordr, Maps & Charts
Grails : Ordr, Maps & ChartsGrails : Ordr, Maps & Charts
Grails : Ordr, Maps & ChartsHenk Jurriens
 
Scala meetup - Intro to spark
Scala meetup - Intro to sparkScala meetup - Intro to spark
Scala meetup - Intro to sparkJavier Arrieta
 
Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGISmleslie
 
MongoDB GeoSpatial Feature
MongoDB GeoSpatial FeatureMongoDB GeoSpatial Feature
MongoDB GeoSpatial FeatureHüseyin BABAL
 
Geospatial and MongoDB
Geospatial and MongoDBGeospatial and MongoDB
Geospatial and MongoDBNorberto Leite
 
Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.Dr. Volkan OBAN
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvasGary Yeh
 
Transforming public data into thematic maps (TDC2019 presentation)
Transforming public data into thematic maps (TDC2019 presentation)Transforming public data into thematic maps (TDC2019 presentation)
Transforming public data into thematic maps (TDC2019 presentation)Helder da Rocha
 
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.UA Mobile
 

Was ist angesagt? (20)

Server side geo_tools_in_drupal_pnw_2012
Server side geo_tools_in_drupal_pnw_2012Server side geo_tools_in_drupal_pnw_2012
Server side geo_tools_in_drupal_pnw_2012
 
OSM data in MariaDB / MySQL - All the world in a few large tables
OSM data in MariaDB / MySQL - All the world in a few large tablesOSM data in MariaDB / MySQL - All the world in a few large tables
OSM data in MariaDB / MySQL - All the world in a few large tables
 
Having fun with graphs, a short introduction to D3.js
Having fun with graphs, a short introduction to D3.jsHaving fun with graphs, a short introduction to D3.js
Having fun with graphs, a short introduction to D3.js
 
3D + MongoDB = 3D Repo
3D + MongoDB = 3D Repo3D + MongoDB = 3D Repo
3D + MongoDB = 3D Repo
 
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
Spatial functions in  MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and othersSpatial functions in  MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
Spatial functions in MySQL 5.6, MariaDB 5.5, PostGIS 2.0 and others
 
Logging in JavaScript - Part-3
Logging in JavaScript - Part-3Logging in JavaScript - Part-3
Logging in JavaScript - Part-3
 
Grails : Ordr, Maps & Charts
Grails : Ordr, Maps & ChartsGrails : Ordr, Maps & Charts
Grails : Ordr, Maps & Charts
 
Day 6 - PostGIS
Day 6 - PostGISDay 6 - PostGIS
Day 6 - PostGIS
 
Scala meetup - Intro to spark
Scala meetup - Intro to sparkScala meetup - Intro to spark
Scala meetup - Intro to spark
 
Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGIS
 
MongoDB GeoSpatial Feature
MongoDB GeoSpatial FeatureMongoDB GeoSpatial Feature
MongoDB GeoSpatial Feature
 
Geospatial and MongoDB
Geospatial and MongoDBGeospatial and MongoDB
Geospatial and MongoDB
 
Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.Advanced Data Visualization in R- Somes Examples.
Advanced Data Visualization in R- Somes Examples.
 
d3 is cool
d3 is coold3 is cool
d3 is cool
 
Intro to HTML5 Canvas
Intro to HTML5 CanvasIntro to HTML5 Canvas
Intro to HTML5 Canvas
 
Html5 canvas
Html5 canvasHtml5 canvas
Html5 canvas
 
Transforming public data into thematic maps (TDC2019 presentation)
Transforming public data into thematic maps (TDC2019 presentation)Transforming public data into thematic maps (TDC2019 presentation)
Transforming public data into thematic maps (TDC2019 presentation)
 
Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.Gems of GameplayKit. UA Mobile 2017.
Gems of GameplayKit. UA Mobile 2017.
 
Efek daun
Efek daunEfek daun
Efek daun
 
Snow
SnowSnow
Snow
 

Andere mochten auch

Grace Photo Show
Grace  Photo ShowGrace  Photo Show
Grace Photo Showdabeaty
 
HotelToWeb
HotelToWebHotelToWeb
HotelToWebdidemc
 
HTWRateHunter
HTWRateHunterHTWRateHunter
HTWRateHunterdidemc
 
Hotel To Web Katalog
Hotel To Web KatalogHotel To Web Katalog
Hotel To Web Katalogdidemc
 
Nj 09 Q4 Paul Kadzielawa
Nj 09 Q4 Paul KadzielawaNj 09 Q4 Paul Kadzielawa
Nj 09 Q4 Paul KadzielawaPKadzielawa
 
ภารกิจ การจัด และการดำเนินงานทางทหาร สำหรับบรรยายมหาลัย
ภารกิจ การจัด และการดำเนินงานทางทหาร สำหรับบรรยายมหาลัยภารกิจ การจัด และการดำเนินงานทางทหาร สำหรับบรรยายมหาลัย
ภารกิจ การจัด และการดำเนินงานทางทหาร สำหรับบรรยายมหาลัยminiindy
 
GeoDjango in a nutshell
GeoDjango in a nutshellGeoDjango in a nutshell
GeoDjango in a nutshellDjango Stars
 
หลักการสงคราม
หลักการสงครามหลักการสงคราม
หลักการสงครามminiindy
 
ภารกิจ+กา..
ภารกิจ+กา..ภารกิจ+กา..
ภารกิจ+กา..miniindy
 
ทบทวนวิชา..
ทบทวนวิชา..ทบทวนวิชา..
ทบทวนวิชา..miniindy
 
สรุปเนื้อหาวิชาการทหารกองทัพเรือ
สรุปเนื้อหาวิชาการทหารกองทัพเรือสรุปเนื้อหาวิชาการทหารกองทัพเรือ
สรุปเนื้อหาวิชาการทหารกองทัพเรือminiindy
 
HotelToWeb Catalogue
HotelToWeb CatalogueHotelToWeb Catalogue
HotelToWeb Cataloguedidemc
 
WHY gowellgo
WHY gowellgoWHY gowellgo
WHY gowellgodidemc
 
ABOUT gowellgo
ABOUT gowellgoABOUT gowellgo
ABOUT gowellgodidemc
 
HotelToWeb
HotelToWebHotelToWeb
HotelToWebdidemc
 
ความสัมพันธ์ ผบ.
ความสัมพันธ์ ผบ.ความสัมพันธ์ ผบ.
ความสัมพันธ์ ผบ.miniindy
 
ทบทวนวิชาวิทยาการทหาร51
ทบทวนวิชาวิทยาการทหาร51ทบทวนวิชาวิทยาการทหาร51
ทบทวนวิชาวิทยาการทหาร51miniindy
 

Andere mochten auch (20)

Grace Photo Show
Grace  Photo ShowGrace  Photo Show
Grace Photo Show
 
HotelToWeb
HotelToWebHotelToWeb
HotelToWeb
 
CSC Screeding
CSC ScreedingCSC Screeding
CSC Screeding
 
HTWRateHunter
HTWRateHunterHTWRateHunter
HTWRateHunter
 
Hotel To Web Katalog
Hotel To Web KatalogHotel To Web Katalog
Hotel To Web Katalog
 
Vœux 2010 de la Mairie
Vœux 2010 de la MairieVœux 2010 de la Mairie
Vœux 2010 de la Mairie
 
Nj 09 Q4 Paul Kadzielawa
Nj 09 Q4 Paul KadzielawaNj 09 Q4 Paul Kadzielawa
Nj 09 Q4 Paul Kadzielawa
 
ภารกิจ การจัด และการดำเนินงานทางทหาร สำหรับบรรยายมหาลัย
ภารกิจ การจัด และการดำเนินงานทางทหาร สำหรับบรรยายมหาลัยภารกิจ การจัด และการดำเนินงานทางทหาร สำหรับบรรยายมหาลัย
ภารกิจ การจัด และการดำเนินงานทางทหาร สำหรับบรรยายมหาลัย
 
GeoDjango in a nutshell
GeoDjango in a nutshellGeoDjango in a nutshell
GeoDjango in a nutshell
 
I P I A L E S
I P I A L E SI P I A L E S
I P I A L E S
 
หลักการสงคราม
หลักการสงครามหลักการสงคราม
หลักการสงคราม
 
ภารกิจ+กา..
ภารกิจ+กา..ภารกิจ+กา..
ภารกิจ+กา..
 
ทบทวนวิชา..
ทบทวนวิชา..ทบทวนวิชา..
ทบทวนวิชา..
 
สรุปเนื้อหาวิชาการทหารกองทัพเรือ
สรุปเนื้อหาวิชาการทหารกองทัพเรือสรุปเนื้อหาวิชาการทหารกองทัพเรือ
สรุปเนื้อหาวิชาการทหารกองทัพเรือ
 
HotelToWeb Catalogue
HotelToWeb CatalogueHotelToWeb Catalogue
HotelToWeb Catalogue
 
WHY gowellgo
WHY gowellgoWHY gowellgo
WHY gowellgo
 
ABOUT gowellgo
ABOUT gowellgoABOUT gowellgo
ABOUT gowellgo
 
HotelToWeb
HotelToWebHotelToWeb
HotelToWeb
 
ความสัมพันธ์ ผบ.
ความสัมพันธ์ ผบ.ความสัมพันธ์ ผบ.
ความสัมพันธ์ ผบ.
 
ทบทวนวิชาวิทยาการทหาร51
ทบทวนวิชาวิทยาการทหาร51ทบทวนวิชาวิทยาการทหาร51
ทบทวนวิชาวิทยาการทหาร51
 

Ähnlich wie Pycon2011

Python en la Plataforma ArcGIS
Python en la Plataforma ArcGISPython en la Plataforma ArcGIS
Python en la Plataforma ArcGISXander Bakker
 
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
 
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...Chester Chen
 
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRasterFOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRasterJorge Arevalo
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locatorAlberto Paro
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locatorAlberto Paro
 
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
 
How to separate frontend from a highload python project with no problems - Py...
How to separate frontend from a highload python project with no problems - Py...How to separate frontend from a highload python project with no problems - Py...
How to separate frontend from a highload python project with no problems - Py...Oleksandr Tarasenko
 
Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands Oncodebits
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-Oncodebits
 
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
 
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece CoLab Athens
 
R getting spatial
R getting spatialR getting spatial
R getting spatialFAO
 
Geo script opengeo spring 2013
Geo script opengeo spring 2013Geo script opengeo spring 2013
Geo script opengeo spring 2013Ilya Rosenfeld
 
D3 Mapping Visualization
D3 Mapping VisualizationD3 Mapping Visualization
D3 Mapping VisualizationSudhir Chowbina
 
How to Hack a Road Trip with a Webcam, a GSP and Some Fun with Node
How to Hack a Road Trip  with a Webcam, a GSP and Some Fun with NodeHow to Hack a Road Trip  with a Webcam, a GSP and Some Fun with Node
How to Hack a Road Trip with a Webcam, a GSP and Some Fun with Nodepdeschen
 
Graph computation
Graph computationGraph computation
Graph computationSigmoid
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs偉格 高
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseSages
 

Ähnlich wie Pycon2011 (20)

Python en la Plataforma ArcGIS
Python en la Plataforma ArcGISPython en la Plataforma ArcGIS
Python en la Plataforma ArcGIS
 
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
 
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
SF Big Analytics 20191112: How to performance-tune Spark applications in larg...
 
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRasterFOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
FOSS4G 2010 PostGIS Raster: an Open Source alternative to Oracle GeoRaster
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator
 
2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator2017 02-07 - elastic & spark. building a search geo locator
2017 02-07 - elastic & spark. building a search geo locator
 
10. R getting spatial
10.  R getting spatial10.  R getting spatial
10. R getting spatial
 
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
 
How to separate frontend from a highload python project with no problems - Py...
How to separate frontend from a highload python project with no problems - Py...How to separate frontend from a highload python project with no problems - Py...
How to separate frontend from a highload python project with no problems - Py...
 
Gis SAPO Hands On
Gis SAPO Hands OnGis SAPO Hands On
Gis SAPO Hands On
 
Sapo GIS Hands-On
Sapo GIS Hands-OnSapo GIS Hands-On
Sapo GIS Hands-On
 
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
 
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
 
R getting spatial
R getting spatialR getting spatial
R getting spatial
 
Geo script opengeo spring 2013
Geo script opengeo spring 2013Geo script opengeo spring 2013
Geo script opengeo spring 2013
 
D3 Mapping Visualization
D3 Mapping VisualizationD3 Mapping Visualization
D3 Mapping Visualization
 
How to Hack a Road Trip with a Webcam, a GSP and Some Fun with Node
How to Hack a Road Trip  with a Webcam, a GSP and Some Fun with NodeHow to Hack a Road Trip  with a Webcam, a GSP and Some Fun with Node
How to Hack a Road Trip with a Webcam, a GSP and Some Fun with Node
 
Graph computation
Graph computationGraph computation
Graph computation
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash courseCodepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
Codepot - Pig i Hive: szybkie wprowadzenie / Pig and Hive crash course
 

Kürzlich hochgeladen

Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementNuwan Dias
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5DianaGray10
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimizationarrow10202532yuvraj
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...Daniel Zivkovic
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 

Kürzlich hochgeladen (20)

Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API Management
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
All in AI: LLM Landscape & RAG in 2024 with Mark Ryan (Google) & Jerry Liu (L...
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 

Pycon2011

  • 1. GIS, Python and company Igor Pochechuev 22-23 October, 2011 Kyiv, Ukraine
  • 3. Content ● What is geometry? geometry formats ● How to store geo data? spatial databases ● Where we can get geo data? ● Render it! ● Demo
  • 4. General provisions what we got
  • 5. Geometry formats ● WKT, WKB ● KML, GML (xml based) ● GeoJSON (json based) ● Shapefile (ESRI open specification) ● etc.
  • 6. Geometry common types ● Point (x, y) ● Line (<point>, <point1>, <point2>, …) ● Polygon (<line>, <line1>, <line2>, …)
  • 7. MultiGeometry additional types of geometry ● MultiPoint (<point>, <point1>, <point2>, ...) ● MultiLine (<line>, <line1>, <line2>, ...) ● MultiPolygon (<polygon>, <polygon1>, <polygon2>, ...)
  • 8. Database layer storing spatial data
  • 9. Storing data spatial databases ● SpatiaLite (SQLite) ● MySQL ● Oracle ● PostGIS (PostgreSQL)
  • 10. Storing data right choice PostGIS
  • 11. How to get geo data? vector data
  • 12. Getting data vector data OpenStreetMap
  • 13. OpenStreetMap stats ● < 400 000 registered users ● ~ 1 100 000 000 nodes (points) ● 100 000 000 ways ● ~ 800 — 3 000 nodes added each day ● ~ 100 000 — 300 000 ways added each day ● More statistics: http://wiki.openstreetmap.org/wiki/Stats
  • 14. OpenStreetMap downloading ... ● Download planet.osm http://wiki.openstreetmap.org/wiki/Planet.osm ● OSM API http://api.openstreetmap.org/api/0.6/map?bbox=11.54,48.14,11.543,48.145 ● JOSM (download through desktop app) http://wiki.openstreetmap.org/wiki/JOSM ● Third part services (GIS LAB) http://gis-lab.info/projects/osm-export.html
  • 15. Loading data to database
  • 17. OSM2PgSQL loading data ● osm2pgsql -d <db_name> -H <db_host> -U <db_user> -P <db_port> -c # create tables if needed -s # store tmp data in database -S osm.import.style # mapping style -k # add tags without column to an additional hstore -z extra_data # hstore column containing all tags that start with 'extra_data' RU-KRS.osm # path to OSM data file
  • 19. Rendering tool choosing MapServer Mapnik
  • 20. Mapnik description ● Written in C++ ● Python interface ● OpenStreetMap, Flickr, CloudMade use mapnik ● PostGIS, Shapefiles, GeoTIFF, OSM XML, ... ● PNG, JPG, SVG, PDF, ...
  • 23. Mapnik code example import mapnik m = mapnik.Map(600,300,"+proj=latlong +datum=WGS84") m.background = mapnik.Color('steelblue') r = mapnik.Rule() r.symbols.append(mapnik.PolygonSymbolizer(mapnik.Color('#f2eff9'))) r.symbols.append(mapnik.LineSymbolizer(mapnik.Color('rgb(50%,50%,50%)'),0.1)) s = mapnik.Style() s.rules.append(r) m.append_style('World Style',s)
  • 24. Mapnik code example import mapnik m = mapnik.Map(600, 300, "+proj=latlong +datum=WGS84") m.background = mapnik.Color('steelblue') r = mapnik.Rule() r.symbols.append(mapnik.PolygonSymbolizer(mapnik.Color('#f2eff9'))) r.symbols.append(mapnik.LineSymbolizer(mapnik.Color('rgb(50%,50%,50%)'),0.1)) s = mapnik.Style() s.rules.append(r) m.append_style('World Style',s)
  • 25. Mapnik code example import mapnik m = mapnik.Map(600, 300, "+proj=latlong +datum=WGS84") m.background = mapnik.Color('steelblue') r = mapnik.Rule() r.symbols.append(mapnik.PolygonSymbolizer(mapnik.Color('#f2eff9'))) r.symbols.append(mapnik.LineSymbolizer(mapnik.Color('rgb(50%,50%,50%)'), 0.1)) s = mapnik.Style() s.rules.append(r) m.append_style('World Style',s)
  • 26. Mapnik code example import mapnik m = mapnik.Map(600, 300, "+proj=latlong +datum=WGS84") m.background = mapnik.Color('steelblue') r = mapnik.Rule() r.symbols.append(mapnik.PolygonSymbolizer(mapnik.Color('#f2eff9'))) r.symbols.append(mapnik.LineSymbolizer(mapnik.Color('rgb(50%,50%,50%)'), 0.1)) s = mapnik.Style() s.rules.append(r) m.append_style('World Style',s)
  • 27. Mapnik code example 2 lyr = mapnik.Layer('world', "+proj=latlong +datum=WGS84") lyr.datasource = mapnik.Shapefile(file='world_borders.shp') lyr.styles.append('World Style') m.layers.append(lyr) m.zoom_to_box(lyr.envelope()) mapnik.render_to_file(m,'world.png', 'png')
  • 28. Mapnik code example 2 lyr = mapnik.Layer('world', "+proj=latlong +datum=WGS84") lyr.datasource = mapnik.Shapefile(file='world_borders.shp') lyr.styles.append('World Style') m.layers.append(lyr) m.zoom_to_box(lyr.envelope()) mapnik.render_to_file(m,'world.png', 'png')
  • 29. Mapnik code example 2 lyr = mapnik.Layer('world', "+proj=latlong +datum=WGS84") lyr.datasource = mapnik.Shapefile(file='world_borders.shp') lyr.styles.append('World Style') m.layers.append(lyr) m.zoom_to_box(lyr.envelope()) mapnik.render_to_file(m,'world.png', 'png')
  • 32. Mapnik map services ● Tile Map Service ● Web Map Service
  • 33. Mapnik TMS http: //website.com/<zoom>/<x>/<y>.png ../tiles/12/2451/1360.png
  • 34. Mapnik using osm scripts ● svn export http://svn.openstreetmap.org/applications/rendering/... ● ./generate_xml.py --password 'value' --host 'value' --port 'value' --user 'value' --dbname 'value' ● MAPNIK_MAP_FILE='osm.xml' MAPNIK_TILE_DIR='tiles/' ./generate_tiles.py
  • 35. Mapnik XML <Map bgcolor="#b5d0d0"> <Style name="map_style"> <Rule> <MaxScaleDenominator>[scale]</MaxScaleDenominator> <MinScaleDenominator>[scale]</MinScaleDenominator> <Filter>[field]='value'</Filter> <PointSymbolizer/> <LineSymbolizer/> <PolygonSymbolizer/> … </Rule> </Style>
  • 36. Mapnik XML <Layer name="misc_boundaries"> <StyleName>map_style</StyleName> <Datasource> <Parameter name="table"> (select way,way_area,name,boundary from polygon where boundary='national_park') as boundary </Parameter> <Parameter name='dbname'>[dbname]</Parameter> <Parameter name='host'>[host]</Parameter> <Parameter name='user'>[user]</Parameter> … </Datasource> </Layer>
  • 39. Frontend maps choosing tool ● OpenLayers ● GeoExt ● Leaflet
  • 40. OpenLayers ● Most powerfull ● Most used ● Large community ● OSM supported ● OSM, Google, Yahoo maps in one string ● TMS, WMS, WFS ● GML, GeoJSON, GeoRSS