Pierre, * Pierre Mauduit <[email protected]> [2010-08-05 00:46:55]:
> - cursor.execute("""select osm_id, admin_level, way_area
> + cursor.execute("""select osm_id, admin_level, way_area,
> +
> ST_AsGeoJSON(ST_Envelope(ST_Transform(way,
> + 4326))) AS JsonBBox
Please use st_astext(st_envelope(st_transform(way, 4002))) (mind the
text case and the projection).
> from planet_osm_%s
> where osm_id = -%s""" \
> % (table_name,entry["osm_id"]))
> result = tuple(set(cursor.fetchall()))
> if len(result) == 1:
> - osm_id, admin_level, way_area = result[0]
> + osm_id, admin_level, way_area, geojsonbbox =
> result[0]
> + bbox = json.loads(geojsonbbox)
Use coords.BoundingBox.parse_wkt().
- Maxime
--
Maxime Petazzoni <http://www.bulix.org>
``One by one, the penguins took away my sanity.''
Linux kernel and software developer at MontaVista Software
signature.asc
Description: Digital signature
