GeoAlchemy 2文档¶
对空间数据库使用SQLAlchemy。
GeoAlchemy 2提供了 SQLAlchemy 用于处理空间数据库。
GeoAlchemy 2着重于 PostGIS . 支持PostGIS 1.5和PostGIS 2。
SpatiaLite也受支持,但是将GeoAlchemy 2与SpatiaLite结合使用需要在应用程序端进行一些特定配置。GeoAlchemy 2适用于SpatiaLite 4.3.0及更高版本。
GeoAlchemy 2的目标是比它的前身简单, GeoAlchemy . 使用更简单,维护更简单。
本文档的当前版本适用于 UNKNOWN VERSION GeoAlchemy 2。
要求¶
GeoAlchemy 2需要SQLAlchemy 0.8。GeoAlchemy 2不适用于SQLAlchemy 0.7及更低版本。
安装¶
GeoAlchemy 2是 available on the Python Package Index . 所以可以按照标准安装 pip 或 easy_install 工具。
GeoAlchemy 2的新进展¶
GeoAlchemy 2支持PostGIS'
geometry
类型,以及geography
和raster
类型。第一个系列有自己的空间函数名称空间。使用GeoAlchemy 2,空间函数与任何其他SQLAlchemy函数一样被调用,使用
func
,这是SQLAlchemy的 standard way 调用SQL函数。GeoAlchemy 2与SQLAlchemy的ORM以及SQLAlchemy的ORM一起工作 SQL表达式语言 (又名SQLAlchemy核心)。(这要感谢SQLAlchemy的新功能 type-level comparator system )
GeoAlchemy 2支持 reflection 几何和地理列。
GeoAlchemy 2增加
to_shape
,from_shape
更好地与 Shapely .
见 迁移到GeoAlchemy 2 有关如何将GeoAlchemy应用程序迁移到GeoAlchemy 2的详细信息,请参见第页。
教程¶
GeoAlchemy 2与SQLAlchemy的 对象关系映射 (ORM)和 SQL表达式语言 . 本文档为每个系统提供了一个教程。如果你是GeoAlchemy 2的新手,从这个开始。
绘图示例¶
这个 画廊 页面显示了GeoAlchemy 2的功能示例。
参考文件¶
开发¶
该代码在GitHub上可用:https://github.com/geoalchemy/geoalchemy2。
贡献者:
Adrien Berchet (https://github.com/adrien-berchet)
Éric Lemoine (https://github.com/elemoine)
Dolf Andringa (https://github.com/dolfandringa)
Frédéric Junod, Camptocamp SA (https://github.com/fredj)
ijl (https://github.com/ijl)
Loïc Gasser (https://github.com/loicgasser)
Marcel Radischat (https://github.com/quiqua)
rapto (https://github.com/rapto)
Serge Bouchut (https://github.com/SergeBouchut)
Tobias Bieniek (https://github.com/Turbo87)
Tom Payne (https://github.com/twpayne)
非常感谢 Mike Bayer 的指导和支持!他也 fostered GeoAlchemy 2的诞生。