GeoAlchemy

SQLAlchemy with Spatial Databases

Home

GEO ALCHEMY

Using SQLAlchemy with Spatial Databases

server, cloud, development-1235959.jpg
woman, program, programming-3597095.jpg
WHAT OUR HAPPY PROGRAMMER SAY

GeoAlchemy 2 provides extensions to SQLAlchemy for working with spatial databases.

GeoAlchemy 2 focuses on PostGIS. PostGIS 1.5 and PostGIS 2 are supported.

SpatiaLite is also supported, but using GeoAlchemy 2 with SpatiaLite requires some specific configuration on the application side. GeoAlchemy 2 works with SpatiaLite 4.3.0 and higher.

GeoAlchemy 2 aims to be simpler than its predecessor, GeoAlchemy. Simpler to use, and simpler to maintain.

Elena Miles

Latest Posts

FEATURED COURSE

What’s New in GeoAlchemy

  • GeoAlchemy 2 supports PostGIS’ geometry type, as well as the geography and raster types.
  • The first series had its own namespace for spatial functions. With GeoAlchemy 2, spatial functions are called like any other SQLAlchemy function, using func, which is SQLAlchemy’s standard way of calling SQL functions.
  • GeoAlchemy 2 works with SQLAlchemy’s ORM, as well as with SQLAlchemy’s SQL Expression Language (a.k.a the SQLAlchemy Core). (This is thanks to SQLAlchemy’s new type-level comparator system.)
  • GeoAlchemy 2 supports reflection of geometry and geography columns.
  • GeoAlchemy 2 adds to_shapefrom_shape functions for a better integration with Shapely.

See the Migrate to GeoAlchemy 2 page for details on how to migrate a GeoAlchemy application to GeoAlchemy 2.

FRONT END
Requirements

GeoAlchemy 2 requires SQLAlchemy 0.8. GeoAlchemy 2 does not work with SQLAlchemy 0.7 and lower.

FRONT END
Installation

GeoAlchemy 2 is available on the Python Package Index. So it can be installed with the standard pip or easy_install tools.

TESTIMONIAL

Trusted by Thousands of Students and Tutors

EMMA HART
EDDIE JOHNSON
JONATHAN DOE
MIKE EDWARD
SUBSCRIBE

All Access