Paul Ramsey | 1 Sep 2008 07:38
Picon
Gravatar

Re: optimizing intersection of two large feature classes

In general, overlays are going to be slow in PostGIS, until we have
prepared geometries for intersection as well as predicates.

However, since one side of your overlay is a grid, perhaps you can use
the grid property to cut your problem down in size.  Try testing the
containment of the envelope of your complex polygons by the grid
squares, and anything which passes that test, add to your resultant
table without change.  I think there is even an index operator for
it...

"A  <at>  B
The " <at> " operator returns true if A's bounding box is completely
contained by B's"

So you could use that index op to remove all the complete containment
cases from your workload, leaving only the cases that actually cross
lines to be computed.

Paul

On Mon, Aug 25, 2008 at 12:43 AM, andreas_bfw <Andreas.Schild <at> bfw.gv.at> wrote:
>
> Dear List,
>
> I'm a newby to Postgres/Postgis.
> I have 2 feature classes, #)soilunits of austria 500000+ polygons which I
> reduced to about 13000 multipolygons,
> #)statistic units of austria 1300000 polygons (regular grid )
> I have to do an intersection on those feature classes.
>
(Continue reading)

andreas_bfw | 1 Sep 2008 10:52
Picon

Re: optimizing intersection of two large feature classes


Dear Paul,

Thanks a lot for Your suggestion.
However, I have allready done the intersection and it worked fine at the end
(about 10 hours computing time, Number of Intersections ~ 40Mio) .
There have been some obstacles (maybe degenerations) in the output dataset.
I will give a summary after I have completely controlled and cleaned the
output dataset.

Thanks again!

Andi

Paul Ramsey-3 wrote:
> 
> In general, overlays are going to be slow in PostGIS, until we have
> prepared geometries for intersection as well as predicates.
> 
> However, since one side of your overlay is a grid, perhaps you can use
> the grid property to cut your problem down in size.  Try testing the
> containment of the envelope of your complex polygons by the grid
> squares, and anything which passes that test, add to your resultant
> table without change.  I think there is even an index operator for
> it...
> 
> "A  <at>  B
> The " <at> " operator returns true if A's bounding box is completely
> contained by B's"
> 
(Continue reading)

Ricardo Pinho | 1 Sep 2008 20:14
Picon
Favicon

GISVM - Free GIS Virtual Machine Pre-release


Dear all,

A pre-release version of "GIS Virtual Machine" is available at : www.gisvm.com
GISVM is intended to be a full-feature GIS Workstation based exclusively on free GIS software, including PostgreSQL/PostGIS.

Please feel free to download it and enjoy!!!

Regards,
--
Ricardo Pinho

      Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara  <at> ymail.com ou  <at> rocketmail.com.
http://br.new.mail.yahoo.com/addresses
davyd | 1 Sep 2008 20:32
Picon

Re: GISVM - Free GIS Virtual Machine Pre-release

Hi Ricardo...
Wow!! I was waiting for that!!
 
Thanks..!
 
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Fred Lehodey | 2 Sep 2008 01:47
Picon

Re: GISVM - Free GIS Virtual Machine Pre-release

Wow também ....
Abraço, Fred.   ;-)
 


 
On 9/1/08, Ricardo Pinho <rpinho_eng <at> yahoo.com.br> wrote:

Dear all,

A pre-release version of "GIS Virtual Machine" is available at : www.gisvm.com
GISVM is intended to be a full-feature GIS Workstation based exclusively on free GIS software, including PostgreSQL/PostGIS.

Please feel free to download it and enjoy!!!

Regards,
--
Ricardo Pinho


     Novos endereços, o Yahoo! que você conhece. Crie um email novo com a sua cara <at> ymail.com ou <at> rocketmail.com.
http://br.new.mail.yahoo.com/addresses
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Chris Puttick | 2 Sep 2008 08:51
Picon
Favicon

Re: GISVM - Free GIS Virtual Machine Pre-release


> ----------------------------------------------------------------------
> Date: Mon, 1 Sep 2008 11:14:24 -0700 (PDT)
> From: Ricardo Pinho <rpinho_eng <at> yahoo.com.br>
> Subject: [postgis-users] GISVM - Free GIS Virtual Machine Pre-release
> To: postgis-users <at> postgis.refractions.net
> Message-ID: <940114.19666.qm <at> web65701.mail.ac4.yahoo.com>
> Content-Type: text/plain; charset=iso-8859-1
> 
> 
> Dear all,
> 
> A pre-release version of "GIS Virtual Machine" is available at :
> www.gisvm.com
> GISVM is intended to be a full-feature GIS Workstation based
> exclusively on free GIS software, including PostgreSQL/PostGIS.
> 
> Please feel free to download it and enjoy!!!
> 
> Regards,
> --
> Ricardo Pinho

Any chance of a kvm version? There is a conversion tool that I'm led to believe is mostly effective. Also, has
the VM been tested on VirtualBox? Just seems ironic to build an free software GIS Workstation and then
require a non-free (in speech) software package to make it work...

Chris

------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty
opening them, please visit http://iso26300.info for more information.
Stüwe Rolf | 2 Sep 2008 11:37
Picon

problem "st_equals".

Hallo all,
 
we have a problem concerning the function "st_equals" under PostgreSQL 8.2.3 , PostGIS1.2.1.
 
We duplicated a geometry having a Self-intersection. The two geometries are not st_equals(the original geometry, the duplicated geometry). Why?????
Many thanks for help us!
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Pedro Doria Meunier | 2 Sep 2008 14:29
Favicon

RE: st_within too slow? -- room for development improvement?

Dear Regina,

Thanks for your suggestion :)
The thing is that using st_intersects doesn't help. :-(
The performance is exactly the same which actually puzzles me for
functions (namely ST_Within) that should return almost instantly ...
Problem being that as far as I can see there's no other function that
replaces these for the same effect...

(Call to developers)
This leads me to asking: isn't there room for improvement in these
functions?

The above functions are suitable for very small scale implementations
(like for fleets < 50 vehicles) but when it comes to real-world
implementations with fleets >200 vehicles using these functions almost
grinds the location implementation to a screeching halt...

All the best,
Pedro.

On Sat, 2008-08-30 at 08:59 -0400, Obe, Regina wrote:
> Pedro,
> 
> Try using st_intersects instead of ST_within.  In general I think it
> performs better than within and for point in poly will be just as
> good.
> 
> Yah Guido's suggestion would be at best give same timing since
> ST_Within, ST_Intersects have an implicit && call in them so they can
> limit the number of more painful _ST_Within, _ST_Intersects checks
> they actually need to do.
> 
> Hope that helps,
> Regina
> 
> 
> 
> -----Original Message-----
> From: postgis-users-bounces <at> postgis.refractions.net on behalf of Pedro
> Doria Meunier
> Sent: Sat 8/30/2008 8:16 AM
> To: PostGIS Users Discussion
> Subject: RE: [postgis-users] st_within too slow?
> 
> Dear Guido,
> 
> Thanks for replying.
> Your suggested mod actually worsens the performance by another
> ~15-20ms
> 
> Best regards,
> --
> Pedro Doria Meunier <pdoria <at> netmadeira.com>
> 
> > Pedro,
> >
> > Try this instead:
> >
> > SELECT road_network, toponymy FROM maps AS m WHERE m.b_box &&
> > geomfromtext('POINT($lon $lat)',4326) and
> > st_within(geomfromtext('POINT($lon $lat)',4326), m.b_box)
> >
> > of course, if you already know that the point is in Portugal,
> > you could do:
> >
> > SELECT road_network, toponymy FROM maps AS m WHERE
> > m.country = 'PT' and
> > m.b_box && geomfromtext('POINT($lon $lat)',4326)
> >
> > (assuming that the maps table has the 'country' column with
> > country names).
> >
> > GL
> 
> 
> 
> 
> 
> ______________________________________________________________________
> 
> The substance of this message, including any attachments, may be
> confidential, legally privileged and/or exempt from disclosure
> pursuant to Massachusetts law. It is intended solely for the
> addressee. If you received this in error, please contact the sender
> and delete the material from any computer.
> 
> 
> ______________________________________________________________________
> 
> Help make the earth a greener place. If at all possible resist
> printing this email and join us in saving paper. 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users <at> postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Obe, Regina | 2 Sep 2008 14:51
Favicon

RE: st_within too slow? -- room for developmentimprovement?


Dear Regina,

> Thanks for your suggestion :)
> The thing is that using st_intersects doesn't help. :-(
> The performance is exactly the same which actually puzzles me for
> functions (namely ST_Within) that should return almost instantly ...
> Problem being that as far as I can see there's no other function that
> replaces these for the same effect...

Pedro,
You could try ST_DWithin.  It could be that since your geometries are so
big and possibly complex - the penalty of crossing the Geos barrier is
very high. 

ST_DWithin as I recall doesn't use Geos so may just perform better in
this case.

Try

SELECT road_network, toponymy FROM maps AS m WHERE
st_dwithin(ST_geomfromtext('POINT($lon $lat)',4326), m.b_box, 0.001)

Note - I had to do a 0.001 proximity since ST_Dwithin does an internal
distance < whatever you put in.  You can make this even smaller.
Why is it called b_box (is it really a bbox or a complex geometry? If it
is a bbox not sure the point of not just doing a &&)


>(Call to developers)
>This leads me to asking: isn't there room for improvement in these
>functions?

Yap room for lots of improvement in GEOS and don't worry we are working
on it.
As Paul Ramsey mentioned there is the PreparedGeometry which is in the
works which should help large geometries.  There is also cleanup going
on with other inefficiencies.

Thanks,
Regina

-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.

Pedro Doria Meunier | 2 Sep 2008 15:27
Favicon

RE: SOLVED - st_within too slow? -- room for developmentimprovement?

Dear Regina,

You are still my personal PostGIS heroine! :)
That *surely* helped! The revised query ran  <at> ~75ms against the former
which ran  <at> ~200ms !

About the b_box field... you're right... it's a stupid field name for
the *complex* geometries it contains (like mpolys for Portugal, Spain,
etc..) (blush)

Now that PreparedGeometry seems very promising... :P

Again I'm in your debt. Many, many thanks!

All the best,
Pedro.

On Tue, 2008-09-02 at 08:51 -0400, Obe, Regina wrote:
> Dear Regina,
> 
> > Thanks for your suggestion :)
> > The thing is that using st_intersects doesn't help. :-(
> > The performance is exactly the same which actually puzzles me for
> > functions (namely ST_Within) that should return almost instantly ...
> > Problem being that as far as I can see there's no other function that
> > replaces these for the same effect...
> 
> Pedro,
> You could try ST_DWithin.  It could be that since your geometries are so
> big and possibly complex - the penalty of crossing the Geos barrier is
> very high. 
> 
> ST_DWithin as I recall doesn't use Geos so may just perform better in
> this case.
> 
> Try
> 
> SELECT road_network, toponymy FROM maps AS m WHERE
> st_dwithin(ST_geomfromtext('POINT($lon $lat)',4326), m.b_box, 0.001)
> 
> Note - I had to do a 0.001 proximity since ST_Dwithin does an internal
> distance < whatever you put in.  You can make this even smaller.
> Why is it called b_box (is it really a bbox or a complex geometry? If it
> is a bbox not sure the point of not just doing a &&)
> 
> 
> >(Call to developers)
> >This leads me to asking: isn't there room for improvement in these
> >functions?
> 
> Yap room for lots of improvement in GEOS and don't worry we are working
> on it.
> As Paul Ramsey mentioned there is the PreparedGeometry which is in the
> works which should help large geometries.  There is also cleanup going
> on with other inefficiencies.
> 
> Thanks,
> Regina
> 
> -----------------------------------------
> The substance of this message, including any attachments, may be
> confidential, legally privileged and/or exempt from disclosure
> pursuant to Massachusetts law. It is intended
> solely for the addressee. If you received this in error, please
> contact the sender and delete the material from any computer.
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users <at> postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Gmane