<div>To eliminate the problemas presented by Paul, create a regular grid of 1x1 degrees and populate it randomly with points. Then make your test. All square polygons will have 4 vertexes and the test is "less biased".</div>
<div> </div>
<div>George<br><br></div>
<div class="gmail_quote">On Thu, Nov 25, 2010 at 3:22 PM, Paul Ramsey <span dir="ltr"><<a href="mailto:pramsey@opengeo.org">pramsey@opengeo.org</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Depends on who you think the results will be valid for. The<br>countries-of-the-world is a somewhat non-standard GIS collection given<br>
the wide variation in polygon sizes, the large numbers of vertices in<br>the larger polygons, and the extreme coverage of the overall area that<br>the bounding boxes of the larger polygons command. In many ways your<br>test of "against the whole world" will be largely a test of "against<br>
Russia, Canada, Brazil, and the USA"<br><br>Data matters,<br><font color="#888888"><br>P<br></font>
<div>
<div></div>
<div class="h5"><br><br>On Thu, Nov 25, 2010 at 9:16 AM, Arnaud Vandecasteele<br><<a href="mailto:arnaud.sig@gmail.com">arnaud.sig@gmail.com</a>> wrote:<br> Hi all,<br>><br>> I've to do a quick benchmark of postgis. The case is to check if a<br>
> point is inside (or not) a polygon.<br>> To do so, I've uploaded in my database a big shapefile which contains<br>> all the world's countries.<br>> After that I've made a simple stored function [1]. This one, take two<br>
> arguments :<br>> 1 - The number of points to check<br>> 2 - The number of polygon to check<br>><br>> Then I run the query and i change the number of iterations or the<br>> number of feature.<br>><br>
> Do you think it's a good way to have some pertinents results ?<br>><br>><br>> Best regards<br>><br>> Arnaud<br>><br>><br>> [1]<br>> -- Function: random_poi(integer, integer)<br>><br>
> -- DROP FUNCTION random_poi(integer, integer);<br>><br>> CREATE OR REPLACE FUNCTION random_poi(integer, integer)<br>> RETURNS void AS<br>> $BODY$<br>> DECLARE<br>> iteration alias for $1;<br>
> nb_feat alias for $2;<br>> pt_x numeric;<br>> pt_y numeric;<br>> geom_poi geometry;<br>> i int := 0;<br>> BEGIN<br>> WHILE i < iteration LOOP<br>> i := i + 1;<br>
> -- CREATE RANDOM POSITION<br>> pt_x := random()*100;<br>> pt_y := random()*100;<br>> -- CREATE RANDOM GEOM POI<br>> geom_poi := ST_GeometryFromText(text 'POINT('||pt_x||' '||pt_y||')');<br>
> PERFORM ST_CONTAINS(geom_poi, the_geom) FROM world_poly LIMIT nb_feat;<br>> END LOOP;<br>> return;<br>> END;<br>> $BODY$<br>> LANGUAGE 'plpgsql' IMMUTABLE STRICT<br>
> COST 100;<br>> ALTER FUNCTION random_poi(integer, integer) OWNER TO postgres;<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>