[postgis-users] custom svg function
christomec
christo at mecola.com
Tue Oct 11 15:12:32 PDT 2005
Hello,
I'm trying to write a custom function to generate svg paths. My function
takes a point/geometry and a radius/float8, used with the expand and
distance functions. So far it does the job. If I'm doing it right is
another question. Comments will be appreciated especially on speed related
issues, doing it this way.
My actual question is... I would also like to include the intersection
function, to eliminate unnecessary data outside my svg viewbox. How can I
construct a box, (almost like the expand function) from the propertypoint
parameter I pass it?
Here is my function so far.
CREATE FUNCTION getcadastresvg(propertypoint geometry, radius float8)
RETURNS SETOF text AS
$BODY$SELECT ((('<path d="'::text) || assvg(cadastre.the_geom, 0, 6)) ||
'z"/>'::text AS svgpath
FROM cadastre
WHERE the_geom && Expand($1,$2)
AND Distance($1,the_geom) < $2;$BODY$
LANGUAGE 'sql' IMMUTABLE STRICT;
More information about the postgis-users
mailing list