maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Maposmatic-dev] [PATCH] Adding bounding box coords (SRS 4326)


From: Maxime Petazzoni
Subject: Re: [Maposmatic-dev] [PATCH] Adding bounding box coords (SRS 4326)
Date: Thu, 5 Aug 2010 00:54:11 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Pierre,

* Pierre Mauduit <address@hidden> [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

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]