[postgis-devel] Which intersection is faster?

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Sun Mar 24 05:10:45 PDT 2013


Jorge,

In GDAL you don't want to intersect with the raster, you want to intersect with the raster footprint: rast::geometry.

Pierre

> -----Original Message-----
> From: postgis-devel-bounces at lists.osgeo.org [mailto:postgis-devel-
> bounces at lists.osgeo.org] On Behalf Of Jorge Arévalo
> Sent: Saturday, March 23, 2013 2:13 PM
> To: PostGIS Development Discussion
> Subject: Re: [postgis-devel] Which intersection is faster?
> 
> Ok, understood.
> 
> The point is I'm trying to make the GDAL PostGIS Raster driver faster, and the
> main bottleneck is in the intersection between raster columns and user
> requested window (I construct a polygon from the user's request coords and
> instersect that polygon with the raster data).
> 
> Swapping raster - vector objects was my first (naive) approach. Any (for sure
> smarter) suggestions are welcome.
> 
> --
> Jorge Arevalo
> Freelance developer
> 
> http://www.krop.com/jorgearevalo
> http://about.me/jorgeas80
> 
> Enviado con Sparrow (http://www.sparrowmailapp.com/?sig)
> 
> 
> El sábado 23 de marzo de 2013 a las 18:53, Bborie Park escribió:
> 
> > There's not too much difference between 2.0 and 2.1. I think the
> > major change is ST_Intersects(raster, geometry) =
> > ST_Intersects(geometry, raster). Basically, if one of the arguments
> > is a geometry, the op is done in geometry space (raster is converted
> > to a set of geometries).
> >
> > -bborie
> >
> > On Sat, Mar 23, 2013 at 10:50 AM, Jorge Arévalo
> > <jorgearevalo at libregis.org (mailto:jorgearevalo at libregis.org)> wrote:
> > > Many thanks for the quick response. I can see is pretty fast. But, what about
> previous version of PostGIS? Say 2.0. Is there any significant difference between
> both versions?
> > >
> > > --
> > > Jorge Arevalo
> > > Freelance developer
> > >
> > > http://www.krop.com/jorgearevalo
> > > http://about.me/jorgeas80
> > >
> > > Enviado con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >
> > >
> > > El sábado 23 de marzo de 2013 a las 18:30, Bborie Park escribió:
> > >
> > > > I'd suggest using the variant that runs in raster space. If I
> > > > remember correctly, some changes have been made to this in 2.1.
> > > >
> > > > -bborie
> > > >
> > > > On Sat, Mar 23, 2013 at 10:20 AM, Jorge Arévalo
> > > > <jorgearevalo at libregis.org (mailto:jorgearevalo at libregis.org)> wrote:
> > > > > Hello,
> > > > >
> > > > > I don't know if this is a naive question, but in ST_Intersects description
> (http://postgis.net/docs/manual-2.0/RT_ST_Intersects.html) I read:
> > > > >
> > > > > "Depending on the order that the raster and geometry is passed to
> ST_Intersects(), the test will operate in either raster-space or geometry-space. If
> ST_Intersects(raster, ....), the test is in raster-space (the geometry is converted
> to a raster). If ST_Intersects(geometry, ...), the test is in geometry-space (the
> raster is converted to a set of pixel polygons)."
> > > > >
> > > > > My question: in equal conditions, which version should be faster?
> > > > >
> > > > > ST_Intersects(raster, vector) --> in raster space
> > > > > ST_Intersects(vector, raster) --> in vector space
> > > > >
> > > > > Many thanks in advance,
> > > > >
> > > > > --
> > > > > Jorge Arevalo
> > > > > Freelance developer
> > > > >
> > > > > http://www.krop.com/jorgearevalo
> > > > > http://about.me/jorgeas80
> > > > >
> > > > > Enviado con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > postgis-devel mailing list
> > > > > postgis-devel at lists.osgeo.org (mailto:postgis-devel at lists.osgeo.org)
> > > > > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> > > >
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > postgis-devel mailing list
> > > > postgis-devel at lists.osgeo.org (mailto:postgis-devel at lists.osgeo.org)
> > > > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > postgis-devel mailing list
> > > postgis-devel at lists.osgeo.org (mailto:postgis-devel at lists.osgeo.org)
> > > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> >
> >
> > _______________________________________________
> > postgis-devel mailing list
> > postgis-devel at lists.osgeo.org (mailto:postgis-devel at lists.osgeo.org)
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
> 
> 
> 
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel


More information about the postgis-devel mailing list