That is so cool<br><br><div class="gmail_quote">On Sat, May 8, 2010 at 11:30 PM, Jan Hartmann <span dir="ltr"><<a href="mailto:j.l.h.hartmann@uva.nl">j.l.h.hartmann@uva.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
How about this site?<br>
<br>
<a href="http://www.johndcook.com/blog/2009/03/16/quasi-random-sequences-in-art-and-integration/" target="_blank">http://www.johndcook.com/blog/2009/03/16/quasi-random-sequences-in-art-and-integration/</a><br><font color="#888888">
<br>
Jan</font><div><div></div><div class="h5"><br>
<br>
On 05/07/10 03:59, Ben Madin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Martin,<br>
<br>
Assuming you wanted feedback - from an epidemiologists perspective, I like the first one - Complete Spatial Randomness is an important concept to avoid engendering a perception of order or clustering, and I'm thinking as long as the relative 'dot-density' is correct for each polygon, the CSR approach is less like to lead people to think the dots are located on significant points - in the context of obscuring actual locations etc this is important.<br>

<br>
If you want it more regular, then maybe you don't need to randomise it - or maybe this just means the function needs a user parameter to be able to set the level of randomisation - From 0 (completely ordered) to 1 (completely Random) (... to 2.5 completely clustered?)<br>

<br>
Just my thoughts - also for my money, I wouldn't change dot sizes. very confusing.<br>
<br>
cheers<br>
<br>
Ben<br>
<br>
<br>
<br>
On 07/05/2010, at 6:11 , Martin Davis wrote:<br>
<br>
   <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Check out this blog post for some images of different kinds of random point fields:<br>
<br>
<a href="http://lin-ear-th-inking.blogspot.com/2010/05/more-random-points-in-jts.html" target="_blank">http://lin-ear-th-inking.blogspot.com/2010/05/more-random-points-in-jts.html</a><br>
<br>
Martin Davis wrote:<br>
     <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sounds like it could work - with maybe a bit of fiddling to deal with cases where the grid cells overlapped the polygon only slightly?<br>
Random perturbation by cell radius can still result in some points being very close together.  (And I think this would also be an issue where only a small part of each grid cell overlapped the polygon).  This may or may not be desirable.  Perhaps a further check could be made to reduce the radius for points where this occurs.   Or maybe some sort of simulated annealing process could be use to push the points into a more even distribution.<br>

<br>
M<br>
<br>
Paul Ramsey wrote:<br>
       <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Even-yet-random :) nice requirement. How about just starting with a<br>
regular grid and then perturbing the elements randomly with a radius<br>
of a cell size? You can use the area of the polygon and number of<br>
needed points to calculate the appropriate cell size and go from<br>
there.<br>
<br>
P<br>
<br>
On Thu, May 6, 2010 at 10:28 AM, Martin Davis<<a href="mailto:mbdavis@refractions.net" target="_blank">mbdavis@refractions.net</a>>  wrote:<br>
<br>
         <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Good point about the need for even distribution of the points. That seems<br>
like a whole lot harder to code than simply randomly placing points in a<br>
polygon.  Does anyone have any pointers to algorithms for producing this<br>
effect?<br>
<br>
George Silva wrote:<br>
<br>
           <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The really big problem with dot density is that dots can overlap<br>
themselves,<br>
masking the real number, so if anything will be developed in this area,<br>
the<br>
points should be<br>
<br>
A) evenly distributed<br>
or<br>
B) randomly distributed, but with some sort of "colision" tests, so there<br>
is<br>
no or little overlap.<br>
<br>
This is a interesting idea, especially if we could make a materialized<br>
view<br>
with those points, which could be added to GIS software for presentation.<br>
<br>
George<br>
<br>
On Thu, May 6, 2010 at 1:53 PM, Sufficool, Stanley<<br>
<a href="mailto:ssufficool@rov.sbcounty.gov" target="_blank">ssufficool@rov.sbcounty.gov</a>>  wrote:<br>
<br>
<br>
<br>
             <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Looks nasty, but it might work:<br>
<br>
select<br>
st_line_interpolate_point(<br>
      st_intersection(<br>
              the_geom,<br>
              st_makeline(<br>
                      st_pointn(st_exteriorring(the_geom), (rand1.rand *<br>
st_npoints(st_exteriorring(the_geom)))::int),<br>
                      st_pointn(st_exteriorring(the_geom), (rand2.rand *<br>
st_npoints(st_exteriorring(the_geom)))::int)<br>
              )<br>
      )<br>
      ,rand3.rand<br>
)<br>
from insert_your_table_name_here,<br>
(select random() as rand, generate_series(1,1000) as point_number) as<br>
rand1<br>
JOIN (select random() as rand, generate_series(1,1000) as point_number)<br>
as<br>
rand2<br>
      ON rand1.point_number = rand2.point_number<br>
JOIN (select random() as rand, generate_series(1,1000) as point_number)<br>
as<br>
rand3<br>
      ON rand2.point_number = rand3.point_number<br>
WHERE st_geometrytype(<br>
      st_intersection(<br>
              the_geom,<br>
              st_makeline(<br>
                      st_pointn(st_exteriorring(the_geom), (rand1.rand *<br>
st_npoints(st_exteriorring(the_geom)))::int),<br>
                      st_pointn(st_exteriorring(the_geom), (rand2.rand *<br>
st_npoints(st_exteriorring(the_geom)))::int)<br>
              )<br>
      )<br>
) = 'ST_LineString'<br>
AND oid = 5030 /* Enter your own OID here */<br>
limit 100<br>
<br>
<br>
<br>
<br>
<br>
               <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-----Original Message-----<br>
From: <a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a><br>
[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a>] On<br>
Behalf Of Martin Davis<br>
Sent: Thursday, May 06, 2010 8:56 AM<br>
To: John Abraham; <a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a>; Martin Davis<br>
Subject: Re: [postgis-users] Dot Density idea<br>
<br>
<br>
I was thinking the same thing!<br>
<br>
strk wrote:<br>
<br>
<br>
                 <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
ST_RandomPoinsOnSurface(geometry, numpoints) would be an interesting<br>
function indeed. Sounds like a good job for GEOS/JTS.<br>
<br>
--strk;<br>
<br>
On Mon, May 03, 2010 at 10:49:32PM -0600, John Abraham wrote:<br>
<br>
<br>
<br>
                   <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
One of the things I miss about using ESRI's GIS is the<br>
<br>
<br>
                     <br>
</blockquote></blockquote>
ability to do<br>
<br>
<br>
                 <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
dot-density maps.  Within a polygon, the number of dots is<br>
<br>
<br>
                     <br>
</blockquote></blockquote>
proportional to a value, and the dots are randomly placed.  I<br>
find it useful to be able to present several data values at<br>
once (e.g. blue dots for population, red dots for employment).<br>
<br>
<br>
                 <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I also find that it is a more intuitive way of scaling for<br>
<br>
<br>
                     <br>
</blockquote></blockquote>
zone size<br>
<br>
<br>
                 <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
than dividing the value by the area of the zone.  That is,<br>
<br>
<br>
                     <br>
</blockquote></blockquote>
the count<br>
<br>
<br>
                 <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
of the dots represents the actual number, but the density<br>
<br>
<br>
                     <br>
</blockquote></blockquote>
of the dots<br>
<br>
<br>
                 <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
represents the density of the number.  So I don't have to decide<br>
whether to divide the value by the area of the polygon to plot<br>
density: both the absolute number and the density are<br>
<br>
<br>
                     <br>
</blockquote></blockquote>
easily visible.<br>
<br>
<br>
                 <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Since my open-source GIS viewing systems (mostly QGIS and<br>
<br>
<br>
                     <br>
</blockquote></blockquote>
Mapserver)<br>
<br>
<br>
                 <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
won't plot dot-density, I've done without.<br>
<br>
But today I realized that I can build these on the server<br>
<br>
<br>
                     <br>
</blockquote></blockquote>
instead.  I<br>
<br>
<br>
                 <br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
can generate random points within the bounding-box of the polygon,<br>
throwing out those that aren't contained within the polygon,<br>
repeating until I have enough.  Then I can save these points as a<br>
separate layer, and display this layer using almost any desktop or<br>
web based viewer!<br>
<br>
Has anyone done this?  Can I do it in SQL or do I need to write<br>
something in PL/pgsql?<br>
<br>
-- <br>
John Abraham<br>
<br>
PS I just bought the Postgis In Action book; enjoying it so far.<br>
_______________________________________________<br>
postgis-users mailing list <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>
<br>
<br>
<br>
                     <br>
</blockquote>
<br>
                   <br>
</blockquote>
-- <br>
Martin Davis<br>
Senior Technical Architect<br>
Refractions Research, Inc.<br>
(250) 383-3022<br>
<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>
<br>
<br>
<br>
                 <br>
</blockquote>
_______________________________________________<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>
<br>
<br>
<br>
               <br>
</blockquote>
------------------------------------------------------------------------<br>
<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>
<br>
<br>
             <br>
</blockquote>
-- <br>
Martin Davis<br>
Senior Technical Architect<br>
Refractions Research, Inc.<br>
(250) 383-3022<br>
<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>
<br>
<br>
           <br>
</blockquote>
_______________________________________________<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>
<br>
<br>
         <br>
</blockquote>
       <br>
</blockquote>
-- <br>
Martin Davis<br>
Senior Technical Architect<br>
Refractions Research, Inc.<br>
(250) 383-3022<br>
<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>
     <br>
</blockquote>
_______________________________________________<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>
   <br>
</blockquote>
_______________________________________________<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>
</div></div></blockquote></div><br>