<div dir="ltr"><div><div><div>Hi Regina,<br><br></div>I noticed the mention of record, but I was at a loss of how to solve it. Now that you told me, I'd say: of course! Why didn't I think of that?<br>It shows that I don't know all that much about databases... I'm glad though the combination of PostgreSQL and PostGIS is available for amateurs like myself to experiment with and to learn from.<br>
Before JOSM was all I needed to be 'productive' with geodata in the context of Openstreetmap, but since I have this dataset of public transportation I'm trying to integrate into it, I'm going into new and unexplored waters little by little.<br>
<br></div>Many thanks for your help!<br><br></div>Jo<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/24 Paragon Corporation <span dir="ltr"><<a href="mailto:lr@pcorp.us" target="_blank">lr@pcorp.us</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>



<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">Jo,</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">ST_ConcaveHull and ST_Collect work on a geometry and you are 
trying to apply it to a record as the error says :)   <font color="#000000" face="Times New Roman" size="3">ERROR:  function 
st_collect(record) does not exist</font></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">PostgreSQL is funny as it allows you to pass around whole 
records to functions so since you did</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span>ST_Collect(surroundingstops)</span></div>
<div dir="ltr" align="left"><span></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial">you are passing the record not the geometry.  Try 
changing to</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><span>ST_Collect(surroundingstops.geomdl)</span></span></div>
<div dir="ltr" align="left"><span><span></span></span> </div>
<div dir="ltr" align="left"><span><span><font color="#0000ff" face="Arial">Hope that 
helps,</font></span></span></div>
<div dir="ltr" align="left"><span><span><font color="#0000ff" face="Arial">Regina</font></span></span></div>
<div dir="ltr" align="left"><span><span><font color="#0000ff" face="Arial"><a href="http://www.postgis.us" target="_blank">http://www.postgis.us</a></font></span></span></div>
<div dir="ltr" align="left"><span><span><font color="#0000ff" face="Arial"><a href="http://postgis.net" target="_blank">http://postgis.net</a></font></span></span></div>
<div dir="ltr" align="left"><span><span></span></span> </div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma"><b>From:</b> <a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a> 
[mailto:<a href="mailto:postgis-users-bounces@lists.osgeo.org" target="_blank">postgis-users-bounces@lists.osgeo.org</a>] <b>On Behalf Of 
</b>Jo<br><b>Sent:</b> Tuesday, April 23, 2013 5:54 AM<br><b>To:</b> PostGIS 
Users Discussion<br><b>Subject:</b> [postgis-users] Query to find all stops 
surrounding 1 stop and turn it into a concave hull polygon 
geometry<br></font><br></div><div><div class="h5">
<div></div>
<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" target="_blank">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></div></div></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br></div>