Gilles Bassière-2 wrote:
> 
> Hi Enzo,
> 
> I assume your set of points is stored in a table named "node" within 
> your PostGIS database. Such table would have at least:
> - a "geom" column containing point geometries,
> - a "radius" column containing the desired radius (type double).
> 
> If so your query will simply look like:
>    SELECT ST_Buffer(geom, radius)
>    FROM node
> 

My understanding is that PostGIS allows me to draw circles around points
stored in *Geography* columns, as well, by casting to Geometry. But, I can't
get this configured in Mapnik. I've tried various combinations, without
success.

Here is my latest dysfunctional config:

<Layer name="location_radii" srs="&srs4326;" status="on" >
        <StyleName>location_radii</StyleName>
        <Datasource>
            <Parameter name="dbname">osm_earth</Parameter>
            <Parameter name="estimate_extent">false</Parameter>
            <Parameter name="extent_from_subquery">false</Parameter>
            <Parameter name="st_prefix">true</Parameter>
            <Parameter name="geometry_field">geog</Parameter>
            <Parameter name="host">localhost</Parameter>
            <Parameter name="password">[...]</Parameter>
            <Parameter name="port">5432</Parameter>
            <Parameter name="srid">4326</Parameter>
            <Parameter name="table">(SELECT ST_Buffer(CAST(geog AS
geometry), radius_seed / 2 * 0.3) AS radius FROM iai_probe_locations) as
geog</Parameter>
            <Parameter name="type">postgis</Parameter>
            <Parameter name="user">postgres</Parameter>
            <Parameter name="extent">-180,-90,180,89.99</Parameter>
        </Datasource>
    </Layer>

Here is the table:

       Column        |         Type          | Modifiers 
---------------------+-----------------------+-----------
[... other columns]
 radius_seed              | integer               | 
[... more columns]
 geog                | geography(Point,4326) | 

Here's raw sample data:  147 |
0101000020E6100000000000000000000086C954C1A8D44740

(radius_seed / 2 * 0.3) = 22.05

I shouldn't have to cast as geometry explicitly... that's in there
superstitiously / randomly

The parameters I've included result in the SLQ being rewritten, but omitting
them hasn't resulted in joy.

Here's the error message I receive:

// --> :
ERROR:  function st_asbinary(record) does not exist
LINE 1: SELECT ST_AsBinary("geog") AS geom from (SELECT ST_Buffer(CA...
               ^
HINT:  No function matches the given name and argument types. You might need
to add explicit type casts.
Full sql was: 'SELECT ST_AsBinary("geog") AS geom from (SELECT
ST_Buffer(CAST(geog AS geometry), rttavg / 2 * 0.3) AS radius FROM
iai_probe_locations) as geog WHERE "geog" &&
SetSRID('BOX3D(-61.77721599999999 -2.900715999999989,76.86821599999999
89.98999999999999)'::box3d, 4326)'

-- 
View this message in context: 
http://old.nabble.com/Fwd%3A--OSM-dev--help%3A-drawing-circles-on-mapnik-tp21326542p32373943.html
Sent from the Mapnik - Users mailing list archive at Nabble.com.

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to