Just wanted to again say thanks for this help from last May.<div><br></div><div>It turns out that my problem was that I was inadvertently geocoding some state highway mile markers to US highways and vice versa. The dataset that identified the events didn't well-distinguish between them...until I found a field named "str1" (what a descriptive name!!) that provided the highway designation more clearly.<br>
</div><div><br></div><div>After getting that fixed, the upper end of the variance on my geocoding dropped sharply.</div><div><br></div><div>Aren</div><br><div class="gmail_quote">On Sat, May 28, 2011 at 8:09 AM, Aren Cambre <span dir="ltr"><<a href="mailto:aren@arencambre.com">aren@arencambre.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thank you!<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Fri, May 27, 2011 at 9:33 PM, Stephen Woodbridge <span dir="ltr"><<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Aren,<br>
<br>
Your purposed approach sounds reasonable to me. You can do it all in one query like:<br>
<br>
select c.gid, sum(c.dist*c.dist)/count(*) as variance<br>
from (<br>
select b.gid, b.cent, st_distance(b.geom, b.cent) as dist<br>
from (<br>
select a.gid, (st_dump(a.the_geom)).geom as geom, centroid(a.the_geom) as cent<br>
from (<br>
select 99 as gid, 'MULTIPOINT(1 2,2 3,3 4,4 5)'::geometry as the_geom<br>
union all<br>
select 88 as gid, 'MULTIPOINT(1 2,2 3,3 4,4 5,3 5,9 9)'::geometry as the_geom<br>
) as a<br>
) as b<br>
) as c<br>
group by gid order by variance desc;<br>
<br>
You should be able to replace the select...union all select ... with your table of multipoints.<br>
<br>
-Steve W<div><br>
<br>
On 5/27/2011 6:19 PM, Aren Cambre wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Did anyone have thoughts on this? :-)<br>
<br>
Aren<br>
<br>
On Wed, May 4, 2011 at 2:12 PM, Aren Cambre <<a href="mailto:aren@arencambre.com" target="_blank">aren@arencambre.com</a><br></div><div>
<mailto:<a href="mailto:aren@arencambre.com" target="_blank">aren@arencambre.com</a>>> wrote:<br>
<br>
The more I think about it, is this a job for R? I know I need to<br>
start using R at some point, just haven't begun yet.<br>
<br>
Aren<br>
<br>
<br>
On Wed, May 4, 2011 at 1:42 PM, Aren Cambre <<a href="mailto:aren@arencambre.com" target="_blank">aren@arencambre.com</a><br></div><div>
<mailto:<a href="mailto:aren@arencambre.com" target="_blank">aren@arencambre.com</a>>> wrote:<br>
<br>
Suppose you have a geometry type with a multipoint. How would<br>
you calculate the variance of the points in that multipoint?<br>
<br>
I looked through the PostGIS 1.5 function reference and am not<br>
coming up with any easy way.<br>
<br>
A hard way seems to be using st_centroid(multipoint) to find the<br>
multipoint's center. From there, I can calculate the distance<br>
of each point from its center, and use that towards calculating<br>
the variance (each distance is squared, all squared distances<br>
are added together, then divide by number of points).<br>
<br>
I guess my ultimate need is to measure relative dispersion of<br>
multipoints. The multipoints that have the most dispersion are<br>
suspect, but I need a way of identifying which ones are like this.<br>
<br>
Aren<br>
<br>
<br>
<br>
<br>
<br></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>