[postgis-users] Point in Polygon Problem

2010-10-21 Thread Marcos Paul
Hi Folks, I am trying to solve a simple problem: the point in polygon. First of all, I have a CSV file with the polygons in list similar to the WKT Format, that is something like: BUILT_UP_AREA_ID VERTEX_SEQ LATITUDE LONGITUDE 1081 0 152.6657 -25.5206 1081 1 152.6662 -25.5211 1081 2 152. -

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

2010-10-21 Thread Dharmendra Goyal
Hi Mark, I added one CFLAG /GS- and security cookie related warnings went away but following symbols still could not be found: c:/pginstaller.pune-repo/proj-4.7.0.staging/lib/proj.lib(pj_gridinfo.obj):(.text+0x6e7): undefined reference to `_ftol2_sse' c:/pginstaller.pune-repo/proj-4.7.0.staging/l

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 errors

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 en

[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 i

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 ___

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 th

Re: [postgis-users] Basic duplicating database question

2010-10-21 Thread Mike Toews
On 21 October 2010 07:24, lplateandy 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 reads that attem

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 04:38, lplateandy 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 only writes are bloc

[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] 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' c:/pginstaller.pu

[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' c:/pginstaller.pune-repo/proj-4.6.1.staging/lib

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 <= 2008 AND b.gweyear >= 2

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 i

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 <= 2008 AND b.gw

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 TABL

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