<div dir="ltr"><div><div><div>After a lot of trial and error I came up with this query:<br><br>SELECT ST_ConcaveHull(ST_Collect(surroundingstops),0.98)<br> FROM (SELECT st1.geomdl <br>        FROM stops st1<br>        WHERE ST_DWithin(st1.geomdl::geography, <br>
                         (SELECT st2.geomdl<br>                           FROM stops st2<br>                           WHERE st2.stopidentifier=203896<br>                            AND st1.osm_zone IS NOT NULL)::geography,<br>
                          1000)) surroundingstops;<br><br></div>Unfortunately I get this error message:<br><br>ERROR:  function st_collect(record) does not exist<br>LINE 1: SELECT ST_ConcaveHull(ST_Collect(surroundingstops),0.98)<br>
                              ^<br>HINT:  No function matches the given name and argument types. You might need to add explicit type casts.<br><br><br></div>The subquery results in 1 column of geometry values. When looking at the examples on<br>
<br><a href="http://www.bostongis.com/postgis_concavehull.snippet">http://www.bostongis.com/postgis_concavehull.snippet</a><br><br>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.<br>
<br>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.<br><br></div><div>Jo<br></div></div>