[postgis-users] Query to find all stops surrounding 1 stop and turn it into a concave hull polygon geometry
Jo
winfixit at gmail.com
Tue Apr 23 02:54:00 PDT 2013
After a lot of trial and error I came up with this query:
SELECT ST_ConcaveHull(ST_Collect(surroundingstops),0.98)
FROM (SELECT st1.geomdl
FROM stops st1
WHERE ST_DWithin(st1.geomdl::geography,
(SELECT st2.geomdl
FROM stops st2
WHERE st2.stopidentifier=203896
AND st1.osm_zone IS NOT NULL)::geography,
1000)) surroundingstops;
Unfortunately I get this error message:
ERROR: function st_collect(record) does not exist
LINE 1: SELECT ST_ConcaveHull(ST_Collect(surroundingstops),0.98)
^
HINT: No function matches the given name and argument types. You might
need to add explicit type casts.
The subquery results in 1 column of geometry values. When looking at the
examples on
http://www.bostongis.com/postgis_concavehull.snippet
they always seem to be working with all the values in the table, but I only
want to get the shape of some of the stops in the DB, not all 43000 of
them. Later on, I want to group them by zone. The intention is to determine
what zone this stop belongs to. If it's surround by stops which all have
the same zone information, it would be safe to conclude this one is part of
that zone. When on a border between 2 zones it is not.
Should I create a temporary table to accomplish this? I tought
ST_ConcaveHull would enable me to go from a collection of point geometries
to 1 polygon geometry.
Jo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130423/278ebfc0/attachment.html>
More information about the postgis-users
mailing list