The really big problem with dot density is that dots can overlap themselves, masking the real number, so if anything will be developed in this area, the points should be <br><br>A) evenly distributed<br>or<br>B) randomly distributed, but with some sort of "colision" tests, so there is no or little overlap.<br>

<br>This is a interesting idea, especially if we could make a materialized view with those points, which could be added to GIS software for presentation.<br><br>George<br><br><div class="gmail_quote">On Thu, May 6, 2010 at 1:53 PM, Sufficool, Stanley <span dir="ltr"><<a href="mailto:ssufficool@rov.sbcounty.gov">ssufficool@rov.sbcounty.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); 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 * st_npoints(st_exteriorring(the_geom)))::int),<br>
                        st_pointn(st_exteriorring(the_geom), (rand2.rand * 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 rand1<br>
JOIN (select random() as rand, generate_series(1,1000) as point_number) as rand2<br>
        ON rand1.point_number = rand2.point_number<br>
JOIN (select random() as rand, generate_series(1,1000) as point_number) as 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 * st_npoints(st_exteriorring(the_geom)))::int),<br>
                        st_pointn(st_exteriorring(the_geom), (rand2.rand * 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>
<div><div></div><div class="h5"><br>
<br>
<br>
>-----Original Message-----<br>
>From: <a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a><br>
>[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net">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">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>
>> 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>
>>> One of the things I miss about using ESRI's GIS is the<br>
>ability to do<br>
>>> dot-density maps.  Within a polygon, the number of dots is<br>
>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>
>>> I also find that it is a more intuitive way of scaling for<br>
>zone size<br>
>>> than dividing the value by the area of the zone.  That is,<br>
>the count<br>
>>> of the dots represents the actual number, but the density<br>
>of the dots<br>
>>> 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>
>easily visible.<br>
>>><br>
>>> Since my open-source GIS viewing systems (mostly QGIS and<br>
>Mapserver)<br>
>>> won't plot dot-density, I've done without.<br>
>>><br>
>>> But today I realized that I can build these on the server<br>
>instead.  I<br>
>>> 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">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>
>--<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">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>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">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><br clear="all"><br>-- <br>George R. C. Silva<br><br>Desenvolvimento em GIS<br><a href="http://blog.geoprocessamento.net">http://blog.geoprocessamento.net</a><br>