Reflection on existing PostGIS table

125 views
Skip to first unread message

Sean Gillies

unread,
Nov 14, 2009, 9:16:07 PM11/14/09
to geoal...@googlegroups.com
I'd like to demonstrate GeoAlchemy to some PostGIS users next week,
but reflection (with autoload, like http://www.sqlalchemy.org/docs/05/metadata.html#reflecting-tables)
on existing tables isn't working for me. Do you think we can get
autoloading to work? Does the existence of the declarative extension
in SQLAlchemy hint that autoloading isn't very useful?

--
Sean Gillies
Programmer
Institute for the Study of the Ancient World
New York University

Sanjiv Singh

unread,
Nov 15, 2009, 2:48:17 AM11/15/09
to geoal...@googlegroups.com
Hi Sean,

As of now the Geometry Column needs to be defined declaratively so a
full autoload is not possible.
However, for the time being we could use autoload and just declare the
geometry column declaratively
to make it work. This would mean, we need to have prior knowledge of
the geometry column name and type
but that should be acceptable.

I have added an example for this in the repo[1] and it seems to work fine.
To try this, first run the examples/tutorial.py. This would create the
necessary tables.
Then run the reflection example on it.

regards
Sanjiv

[1] http://bitbucket.org/sanjiv/geoalchemy/src/tip/examples/reflection.py

Sean Gillies

unread,
Nov 15, 2009, 9:33:55 AM11/15/09
to geoal...@googlegroups.com
Thanks, Sanjiv, that works like a charm.
--
Sean

Reply all
Reply to author
Forward
0 new messages