You could also make it faster by cutting your boundary line up into about 200 smaller lines. That way your indexes would be useful and most of the candidates would be rejected right away on bounding box criteria, instead of falling through to full geometry tests.
P On Wed, Apr 1, 2009 at 12:03 PM, Paul Ramsey <[email protected]> wrote: > OK, so the operation is spending all its time in GEOS, running the > Touches test. You have a since 2848-vertex linestring and 6361 > candidate features. And you get back 285 touches. Fortunately, because > you are testing against a linestring, you have an alternative test, > since the interaction of a polygon boundary and linestring interior > counts as an intersection. > > SELECT count(obce.gid) FROM obce,cr WHERE ST_Intersects(obce.the_geom, > cr.the_geom); > > I found this to run 10 times as fast, because it can use the prepared > geometry optimization. It still returns 285 resultants. > > Paul > > > On Wed, Apr 1, 2009 at 11:06 AM, Martin Landa <[email protected]> wrote: >> Hi, >> >> 2009/4/1 Paul Ramsey <[email protected]>: >>> Can you share your data with me? I'm interested to profile and see >>> where the bottleneck actually is. >> >> data are available at >> >> http://josef.fsv.cvut.cz/~landa/postgis/obce_cr.sql.gz >> >> before import define also local SRS >> >> INSERT INTO spatial_ref_sys VALUES (102067, 'local', 102067, >> 'PROJCS["Krovak",GEOGCS["bessel",DATUM["unknown", >> SPHEROID["Bessel_1841",6377397.155,299.1528128], >> TOWGS84[570.8,85.7,462.8,4.998,1.587,5.261,3.56]], >> PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]], >> PROJECTION["Krovak"],PARAMETER["latitude_of_center",0], >> PARAMETER["longitude_of_center",0],PARAMETER["azimuth",0], >> PARAMETER["pseudo_standard_parallel_1",0],PARAMETER["scale_factor",1], >> PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["meter",1]]', >> '+proj=krovak +a=6377397.155 +rf=299.1528128 +no_defs >> +towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56 +to_meter=1.0'); >> >> Thanks in advance, Martin >> >> -- >> Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> http://postgis.refractions.net/mailman/listinfo/postgis-users >> > _______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
