Re: [postgis-users] How best to build a regular grid from points

2010-10-21 Thread Andreas Forø Tollefsen
I used the ST_Envelope function. Create a field with the X and Y column of your points, and add something like this: ST_MakeEnvelope(xcoord-+0.1+, ycoord-+0.1+, xcoord++0.1+, ycoord++0.1+, 4326)) The above is from my python and pygresql script so ignore the syntax. However, the idea is the same

Re: [postgis-users] Measure distance to nearest border

2010-10-21 Thread Andreas Forø Tollefsen
Thanks. I have found a way to do this calculation. However, since i gave 64818 cells and almost 200 countries, the distance from every cell to every country is calculated before the minimum distance is selected. This takes awful lot of time. Any ideas on how to increase the performance? DROP

Re: [postgis-users] Measure distance to nearest border

2010-10-21 Thread Nicklas Avén
hmm, I have to admit I don't really understand what you are trying to do, but there are some thingsI don't think you really mean. select a.gid, MIN(ST_Distance(a.centroid, b.the_geom)) AS distance FROM pgfinal2008 a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear lt;= 2008 AND

Re: [postgis-users] Measure distance to nearest border

2010-10-21 Thread Andreas Forø Tollefsen
Ok. I will try to explain more in detail. I have a vector grid consisting of 64818 grid cells. Each of these cells are stored in the pgfinal2008 table, with two geometries variables: centroid (point) and cell (polygon). Each grid cell have a gwcode variable which is the country code. In addition

Re: [postgis-users] Measure distance to nearest border

2010-10-21 Thread Nicklas Avén
Ok still don't get the second query. If I understand you right you could try this: CREATE TABLE borddisttest2 ASselect a.gid, a.cell, MIN(ST_Distance(a.centroid, b.the_geom)) AS distance FROM pgfinal2008 a, cshapes b, cshapes c WHERE a.gwcode != b.gwcode AND b.gwsyear lt;= 2008 AND b.gweyear =

[postgis-users] issue while building postgis-1.5.2 with pg-9

2010-10-21 Thread Dharmendra Goyal
Hi, I am trying to build postgis-1.5.2 with postgresql-9.0.1 and i am getting following error while building the sources: c:/pginstaller.pune-repo/proj-4.6.1.staging/lib/proj.lib(pj_utils.obj):(.text+0x47): undefined reference to `__security_cookie'

Re: [postgis-users] issue while building postgis-1.5.2 with pg-9

2010-10-21 Thread Mark Cave-Ayland
Dharmendra Goyal wrote: Hi, I am trying to build postgis-1.5.2 with postgresql-9.0.1 and i am getting following error while building the sources: c:/pginstaller.pune-repo/proj-4.6.1.staging/lib/proj.lib(pj_utils.obj):(.text+0x47): undefined reference to `__security_cookie'

[postgis-users] Basic duplicating database question

2010-10-21 Thread lplateandy
Hi, I realise this is probably a very basic question but if anyone could point me in the right direction i'd be very grateful. I have a database which is just my data table and geometry columns and spatial_ref_sys tables. The data is of a significant volume with periodic updates which take

Re: [postgis-users] Basic duplicating database question

2010-10-21 Thread Mike Toews
On 21 October 2010 04:38, lplateandy a...@centremaps.co.uk wrote: Of course, even better would be a way to reindex whilst a database is in use but i'm under the impression that this is not possible at the moment? If you DROP/CREATE your index then reads are blocked. But if you use REINDEX then

Re: [postgis-users] Basic duplicating database question

2010-10-21 Thread lplateandy
Hi Mike, OK - that's really useful. Does that only work for 9 or does it just happen you're pointing to the 9 document? The doc says It also takes an exclusive lock on the specific index being processed, which will block reads that attempt to use that index. Does that mean that i'm not really

Re: [postgis-users] Basic duplicating database question

2010-10-21 Thread Mike Toews
On 21 October 2010 07:24, lplateandy a...@centremaps.co.uk wrote: Hi Mike, OK - that's really useful. Does that only work for 9 or does it just happen you're pointing to the 9 document? The doc says It also takes an exclusive lock on the specific index being processed, which will block

Re: [postgis-users] Basic duplicating database question

2010-10-21 Thread Kevin Neufeld
On 10/21/2010 7:24 AM, lplateandy wrote: The doc says It also takes an exclusive lock on the specific index being processed, which will block reads that attempt to use that index. Does that mean that i'm not really any better off as the spatial index is really the critical means controlling the

Re: [postgis-users] Basic duplicating database question

2010-10-21 Thread lplateandy
Thanks Kevin, greatly appreciated. I think i'll make a lot of use of this... Andy === I know, it looks complicated, but in a production system, this will be fast with minimal downtime (only during the final locking swap). Cheers, Kevin

[postgis-users] ST_Simplify

2010-10-21 Thread lplateandy
Hi, I have, in the simplest example, a square polygon of 1 by 1 kilometer size with nodes every 25 meters. I can use ST_Simplify (the_geom,5) to remove most of the points. However, for some reason i end up with the four corner nodes and a fifth node 25m clockwise from the top left corner. In

Re: [postgis-users] ST_Simplify

2010-10-21 Thread Kevin Neufeld
Hi Andy, Can you post a small example? -- Kevin On 10/21/2010 10:02 AM, lplateandy wrote: Hi, I have, in the simplest example, a square polygon of 1 by 1 kilometer size with nodes every 25 meters. I can use ST_Simplify (the_geom,5) to remove most of the points. However, for some reason i

Re: [postgis-users] Database restore fails with missing liblwgeom

2010-10-21 Thread Lee Hughes
The databases were created by restoring the pg_dumpall backup, so I installed Postgis (psql -d [yourdatabase] -f postgis.sql) in all of them and tried the restore again, with the same errors. In addition to the liblwgeom errors (below), which presumably I can ignore, the restore also