SlideShare a Scribd company logo
1 of 21
Download to read offline
GEOALCHEMYhttp://erilem.net/talks/foss4g2013/geoalchemy.html
USE SQL SPATIAL DATABASES
FROM PYTHON
We have PostGIS. Hooray!
We have Python. Horray!
We need good ways/tools to
use PostGIS from Python.
That's the reason we're
developing GeoAlchemy
Wait! There's Django, and
GeoDjango!
YES (it's great), BUT...
There's a life outside Web and
Django!
Has anyone heard about Flask,
Bottle, Pyramid?
They're great frameworks, with lots of users.
They all love the SQLAlchemy
toolkit.
For good reasons!
SQLALCHEMY
The Database Toolkit for Python
SQLALCHEMY PHILOSOPHY
It's not about abstracting the DB
Abstracting is Hiding
It's about Automation
Instruct SQLA to do the grunt work we give it
Relational form of data is preserved
SQLA provides a rich vocabulary to express decisions
made by the developer
SQLALCHEMY CORE / ORM
SQLAlchemy has two distinct areas:
Core (SQL expression system)
Object Relational Mapper (ORM)
SQLALCHEMY QUERY EXAMPLE
The user whose email address is jack@google.com.
user = session.query(User).join(Address).
filter(Address.email_address=='jack@google.com').
one()
GEOALCHEMY
Thin layer above SQLAlchemy
With the same philosophy
GEOALCHEMY QUERY EXAMPLE
The lakes whose buffers have areas greater than 33.
It looks like SQLA!
It looks like PostGIS SQL!
lakes = session.query(Lake).filter(
Lake.geom.ST_Buffer(2).ST_Area() > 33).all()
SHAPELY INTEGRATION
to_shapeand from_shapefunctions
lake = session.query(Lake).filter(
Lake.geom.ST_Buffer(2).ST_Area() > 33).first()
lake_shape = to_shape(lake.geom)
lake_shape.representative_point().wkt
STATUS
Version 2 released 6 months ago (03/17/2013)
Benefits from SQLALchemy's latest advances
Improved API
Works both with SQLA Core and ORM
PostGIS 2 support (Raster included)
Fully documented and tested
https://geoalchemy-2.readthedocs.org
EXPOSURE
Used in production
Many client projects by Camptocamp
The SkyLines project ( )
By Tobias Bieniek (@Turbo87)
https://www.skylines-project.org)
THANKS!

More Related Content

Similar to Geoalchemy

Creating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPCreating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTP
nsandonato
 

Similar to Geoalchemy (20)

2015 Data Science Summit @ dato Review
2015 Data Science Summit @ dato Review2015 Data Science Summit @ dato Review
2015 Data Science Summit @ dato Review
 
Creating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTPCreating Custom Dojo Widgets Using WTP
Creating Custom Dojo Widgets Using WTP
 
Deep Learning for Java Developer - Getting Started
Deep Learning for Java Developer - Getting StartedDeep Learning for Java Developer - Getting Started
Deep Learning for Java Developer - Getting Started
 
State of the Union by Dan Bode Puppet Labs
State of the Union by Dan Bode Puppet LabsState of the Union by Dan Bode Puppet Labs
State of the Union by Dan Bode Puppet Labs
 
Sharing (or stealing) the jewels of python with big data & the jvm (1)
Sharing (or stealing) the jewels of python with big data & the jvm (1)Sharing (or stealing) the jewels of python with big data & the jvm (1)
Sharing (or stealing) the jewels of python with big data & the jvm (1)
 
SQLite and object-relational mapping in Java
SQLite and object-relational mapping in JavaSQLite and object-relational mapping in Java
SQLite and object-relational mapping in Java
 
Apache pig
Apache pigApache pig
Apache pig
 
Sparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With SparkSparklife - Life In The Trenches With Spark
Sparklife - Life In The Trenches With Spark
 
Suneel Marthi - Deep Learning with Apache Flink and DL4J
Suneel Marthi - Deep Learning with Apache Flink and DL4JSuneel Marthi - Deep Learning with Apache Flink and DL4J
Suneel Marthi - Deep Learning with Apache Flink and DL4J
 
PGDAY FR 2014 : presentation de Postgresql chez leboncoin.fr
PGDAY FR 2014 : presentation de Postgresql chez leboncoin.frPGDAY FR 2014 : presentation de Postgresql chez leboncoin.fr
PGDAY FR 2014 : presentation de Postgresql chez leboncoin.fr
 
dJango
dJangodJango
dJango
 
Drools Workshop 2015 - LATAM
Drools Workshop 2015 - LATAMDrools Workshop 2015 - LATAM
Drools Workshop 2015 - LATAM
 
Machine learning in Apache Zeppelin
Machine learning in Apache ZeppelinMachine learning in Apache Zeppelin
Machine learning in Apache Zeppelin
 
Why and How to integrate Hadoop and NoSQL?
Why and How to integrate Hadoop and NoSQL?Why and How to integrate Hadoop and NoSQL?
Why and How to integrate Hadoop and NoSQL?
 
Overview of Java
Overview of JavaOverview of Java
Overview of Java
 
SemTech 2010: Pelorus Platform
SemTech 2010: Pelorus PlatformSemTech 2010: Pelorus Platform
SemTech 2010: Pelorus Platform
 
Apache Persistence Layers
Apache Persistence LayersApache Persistence Layers
Apache Persistence Layers
 
java slides
java slidesjava slides
java slides
 
Pg nordic-day-2014-2 tb-enough
Pg nordic-day-2014-2 tb-enoughPg nordic-day-2014-2 tb-enough
Pg nordic-day-2014-2 tb-enough
 
Dean4j@Njug5
Dean4j@Njug5Dean4j@Njug5
Dean4j@Njug5
 

More from Camptocamp

GeoMapFish, the Open Source WebGIS
GeoMapFish, the Open Source WebGISGeoMapFish, the Open Source WebGIS
GeoMapFish, the Open Source WebGIS
Camptocamp
 
NGEO – OpenLayers meets Angular
NGEO – OpenLayers meets AngularNGEO – OpenLayers meets Angular
NGEO – OpenLayers meets Angular
Camptocamp
 
OpenLayers 3 & Google Closure Compiler
OpenLayers 3 & Google Closure CompilerOpenLayers 3 & Google Closure Compiler
OpenLayers 3 & Google Closure Compiler
Camptocamp
 

More from Camptocamp (20)

ERP et customisation : comment éviter l’usine à gaz ?
ERP et customisation : comment éviter l’usine à gaz ?ERP et customisation : comment éviter l’usine à gaz ?
ERP et customisation : comment éviter l’usine à gaz ?
 
10 points-clés incontournables pour réussir votre projet ERP
10 points-clés incontournables pour réussir votre projet ERP10 points-clés incontournables pour réussir votre projet ERP
10 points-clés incontournables pour réussir votre projet ERP
 
Topsoft 2017: Praxisbericht: Welche Fehler bei der Implementierung eines ERP-...
Topsoft 2017: Praxisbericht: Welche Fehler bei der Implementierung eines ERP-...Topsoft 2017: Praxisbericht: Welche Fehler bei der Implementierung eines ERP-...
Topsoft 2017: Praxisbericht: Welche Fehler bei der Implementierung eines ERP-...
 
Geo mapfish 2_foss4g-eu_2017
Geo mapfish 2_foss4g-eu_2017Geo mapfish 2_foss4g-eu_2017
Geo mapfish 2_foss4g-eu_2017
 
Ge orchestra open_source_inspire_sdi-project_status_foss4g-eu_2017
Ge orchestra open_source_inspire_sdi-project_status_foss4g-eu_2017Ge orchestra open_source_inspire_sdi-project_status_foss4g-eu_2017
Ge orchestra open_source_inspire_sdi-project_status_foss4g-eu_2017
 
Data processing qgis3_foss4g-eu_2017
Data processing qgis3_foss4g-eu_2017Data processing qgis3_foss4g-eu_2017
Data processing qgis3_foss4g-eu_2017
 
AGIT 2017: GeoMapFish_2.2, the open source WebGIS
AGIT 2017: GeoMapFish_2.2, the open source WebGISAGIT 2017: GeoMapFish_2.2, the open source WebGIS
AGIT 2017: GeoMapFish_2.2, the open source WebGIS
 
AGIT 2017: Cesium 1.35, WebGL Virtual Globe and Map Engine
AGIT 2017: Cesium 1.35, WebGL Virtual Globe and Map EngineAGIT 2017: Cesium 1.35, WebGL Virtual Globe and Map Engine
AGIT 2017: Cesium 1.35, WebGL Virtual Globe and Map Engine
 
AGIT 2017: geOrchestra 16.12, the open source INSPIRE SDI
AGIT 2017: geOrchestra 16.12, the open source INSPIRE SDIAGIT 2017: geOrchestra 16.12, the open source INSPIRE SDI
AGIT 2017: geOrchestra 16.12, the open source INSPIRE SDI
 
[Geocom2017] geOrchestra and ngeo
[Geocom2017] geOrchestra and ngeo[Geocom2017] geOrchestra and ngeo
[Geocom2017] geOrchestra and ngeo
 
[Geocom2017] Georchestra & monitoring
[Geocom2017] Georchestra & monitoring[Geocom2017] Georchestra & monitoring
[Geocom2017] Georchestra & monitoring
 
GeoMapFish, the Open Source WebGIS
GeoMapFish, the Open Source WebGISGeoMapFish, the Open Source WebGIS
GeoMapFish, the Open Source WebGIS
 
NGEO – OpenLayers meets Angular
NGEO – OpenLayers meets AngularNGEO – OpenLayers meets Angular
NGEO – OpenLayers meets Angular
 
OpenLayers 3 & Google Closure Compiler
OpenLayers 3 & Google Closure CompilerOpenLayers 3 & Google Closure Compiler
OpenLayers 3 & Google Closure Compiler
 
MapFish Print 3
MapFish Print 3MapFish Print 3
MapFish Print 3
 
georchestra SDI: Project Status Report
georchestra SDI: Project Status Reportgeorchestra SDI: Project Status Report
georchestra SDI: Project Status Report
 
GeoMapFish, the Open Source WebGIS
GeoMapFish, the Open Source WebGISGeoMapFish, the Open Source WebGIS
GeoMapFish, the Open Source WebGIS
 
Présentation GeoMapFish
Présentation GeoMapFishPrésentation GeoMapFish
Présentation GeoMapFish
 
OpenLayers 3
OpenLayers 3OpenLayers 3
OpenLayers 3
 
Une IDS scalable et résiliente avec geOrchestra & Docker
Une IDS scalable et résiliente avec geOrchestra & DockerUne IDS scalable et résiliente avec geOrchestra & Docker
Une IDS scalable et résiliente avec geOrchestra & Docker
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
"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 ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
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...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
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...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Geoalchemy