Patience with someone who is trying to teach herself Geoalchemy.
I am moving to QGIS with PostGIS, coming from an ArcGIS background (all the way back to when it ran on Primes).
I am getting geojson from a rest query, and I need to import the polygon into PostGIS using GeoAlchemy. I really like the ORM, and I am trying to do it that way.
This works, but I suspect is a kludge, and there is an elegant way.
qString = "ST_AsText(ST_GeomFromGeoJSON('{\"type\":\"Polygon\", \"coordinates\":[[[-122.7606046, 47.2759964], [-122.7610586, 47.2755668], [-122.7616634, 47.2758681], [-122.7612063, 47.2762963], [-122.7606046, 47.2759964]]]}, 4326')) As wkt;"
query = session.query(qString)
rp = session.execute(query)
myGeom = rp.scalar()
myGeom is the geojson geometry to add to the polygon (there are many attributes, some of which I am editing prior to adding to PostGIS. So I also do a session.add(record).
Since I am sure there is a better way, I am open to suggestions. I don't like the two-transaction model.
Celeste