[postgis-users] A faster way to find "adjacent" polygons

2012-01-03 Thread Evan Martin
I have a table of polygons covering most of the world and for a given polygon I need to find all polygons adjacent to it. In theory, two adjacent polygons should have a part of their border in common, but in practice the data is not that precise - sometimes there's a slight overlap and sometime

[postgis-users] Normalise geometry for conversion to geography

2012-01-03 Thread Evan Martin
Is there any built-in function or other simple way to normalise a geometry to the (-180-180, -90-90) range required by geography? I've written my own function for this, but it's quite slow, because I need to handle MultiPolygons so if even a single point needs to be changed it has to re-create

Re: [postgis-users] Insert a point value : ST_GeometryFromText unknown function [resolved]

2012-01-03 Thread efusien
It works fine ! I did: $ sudo su postgres $ psql -d test -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql -v ON_ERROR_STOP=1 $ psql -d test -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql $ psql -d test -f /usr/share/postgresql/9.1/contrib/postgis_comments.sql O

Re: [postgis-users] Insert a point value : ST_GeometryFromText unknown function

2012-01-03 Thread Sandro Santilli
On Tue, Jan 03, 2012 at 01:22:11PM -0800, efusien wrote: > $ sudo psql -d test -f > /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql -v ON_ERROR_STOP=1 > => SET > BEGIN > psql:/usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql:59: ERROR: > permission denied for language c > > ...

Re: [postgis-users] Insert a point value : ST_GeometryFromText unknown function

2012-01-03 Thread efusien
Thank's to help :-) So I did these tasks in a Ubuntu shell: $ sudo createdb test => $ sudo createlang plpgsql test => createlang: language "plpgsql" is already installed in database "test" $ sudo psql -d test -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql -v ON_ERROR_STOP=1 => SET

Re: [postgis-users] Insert a point value : ST_GeometryFromText unknown function

2012-01-03 Thread Sandro Santilli
On Tue, Jan 03, 2012 at 11:54:34AM -0800, efusien wrote: > I have this error : > ERROR: function postgis_full_version() does not exist > > Does it mean I have to install some other features ? See instructions about how to spatially-enable a database here: http://postgis.refractions.net/document

Re: [postgis-users] The correct way to restore is?

2012-01-03 Thread Sandro Santilli
On Tue, Jan 03, 2012 at 08:53:18AM -0800, DrYSG wrote: > I would like to cut out these 1,000 or so error messages so I can see what > is actually not working, if anythng. http://postgis.refractions.net/documentation/manual-svn/postgis_installation.html#hard_upgrade The instructions refer to rest

Re: [postgis-users] Insert a point value : ST_GeometryFromText unknown function

2012-01-03 Thread efusien
Thank you Edward, With the query : "SELECT PostGIS_Full_Version();" I have this error : ERROR: function postgis_full_version() does not exist Does it mean I have to install some other features ? Edward Mac Gillavry wrote: > > > > Just to see what version of postgis and libraries you have

Re: [postgis-users] Insert a point value : ST_GeometryFromText unknown function

2012-01-03 Thread Edward Mac Gillavry
Just to see what version of postgis and libraries you have available, execute the following query SELECT PostGIS_Full_Version(); see http://www.postgis.org/docs/PostGIS_Full_Version.html > Date: Tue, 3 Jan 2012 10:25:31 -0800 > From: jeremie.br...@efusia.net > To: postgis-users@postgis.refracti

Re: [postgis-users] The correct way to restore is?

2012-01-03 Thread DrYSG
Here is a little look at the database I am trying to restore: C:\Program Files (x86)\PostgreSQL\9.1\bin\pg_restore.exe --host localhost --port 5432 --username "postgres" --dbname "GPL" --no-password --list "\\csdlnet\services\FS5-Projects\EGPL\FalconGPL\gpl_database_backups\12-28-2011\12-28-2011

Re: [postgis-users] The correct way to restore is?

2012-01-03 Thread MarkW
The way I do it (learned from others on this list) is to backup the schema(s) with my data in them; I store my data outside the public schema to accommodate this. Works great, especially at upgrade time (not overwriting newer functions). I used PgAdmin to backup a few items from public schema, e.g

[postgis-users] Insert a point value : ST_GeometryFromText unknown function

2012-01-03 Thread efusien
Hello, I have a table "test" with 2 columns: nom: text localisation:point NULL I make this query: INSERT INTO "test" ("nom", "localisation") VALUES ('myName', 'ST_GeometryFromText(POINT(2.5 49.0), 4326)'); But I have this error message: Error in query: ERROR: invalid input syntax for type

[postgis-users] ERD (Entity Relation Diagram) and reverse engineering tool.

2012-01-03 Thread DrYSG
Now that I have PostGreSQL, PostGIS, and a database installed, I wanted to try out some ERD tools to see what is happening inside of it (20M records, 20 tables). I stumbled on this open source tool: http://www.sqlpower.ca/page/architect which looks simple enough, and has lot of features, screensh

[postgis-users] ERD (Entity Relation Diagram) and reverse engineering tool.

2012-01-03 Thread DrYSG
Now that I have PostGreSQL, PostGIS, and my meta-database installed, I wanted to try out some ERD tools to see what is happening inside of it (20M records, 20 tables). I stumbled on this open source tool: http://www.sqlpower.ca/page/architect which looks simple enough, and has lot of features, s

[postgis-users] The correct way to restore is?

2012-01-03 Thread DrYSG
I am running PostGreSQL 9.1 and PostGIS 1.5.4. I backed up a PostGIS database with PgAdmin III. When I restore it I get a lot of error messages about redefinition of functions. (it backed up all the PostGIS functions and now is restoring them even though they are already defined, since I template

Re: [postgis-users] st_collect returning more geometries than I want

2012-01-03 Thread Richard Greenwood
Thanks Steve, that looks like what I need. Best regards, Rich On Tue, Jan 3, 2012 at 7:49 AM, Stephen Woodbridge wrote: > On 1/3/2012 9:19 AM, Richard Greenwood wrote: >> >> This seems so simple that I'm embarrassed to ask, but, putting my >> pride in my pocket... >> >> I want to aggregate two

Re: [postgis-users] st_collect returning more geometries than I want

2012-01-03 Thread Stephen Woodbridge
On 1/3/2012 9:19 AM, Richard Greenwood wrote: This seems so simple that I'm embarrassed to ask, but, putting my pride in my pocket... I want to aggregate two linestrings into one. The endpoint of the first linestring is coincident with the start point of the second. Using st_collect() or st_unio

[postgis-users] st_collect returning more geometries than I want

2012-01-03 Thread Richard Greenwood
This seems so simple that I'm embarrassed to ask, but, putting my pride in my pocket... I want to aggregate two linestrings into one. The endpoint of the first linestring is coincident with the start point of the second. Using st_collect() or st_union() I get a multiLineString with 2 geometries. H

[postgis-users] Postgis Version

2012-01-03 Thread jj.wag
Hi, I have problems with PostgreSQL 9.0 on a Windows 2008 R2 Server using Postgis 1.5.2. ( about 8 Months ago there was no 64bit Postgis version so I have installed as 32bit version). Is there already a new Postgis-Version running on a Windows 2008 R2 64 bit? Jo __

Re: [postgis-users] shp2pgsql - how to continue when error occurs

2012-01-03 Thread Muhammad Imran
Hi Lauri, This is becuase PG doesn't support INSERT IGNORE/REPLACE (as in MySQL or Oracle). -Imran --- On Tue, 1/3/12, Lauri Kajan wrote: > From: Lauri Kajan > Subject: Re: [postgis-users] shp2pgsql - how to continue when error occurs > To: "PostGIS Users Discussion" > Date: Tuesday, Jan

Re: [postgis-users] shp2pgsql - how to continue when error occurs

2012-01-03 Thread Lauri Kajan
Thanks Imran, That was also in my mind, but thought I could have less steps to complete the import. -Lauri On Tue, Jan 3, 2012 at 11:50 AM, Nithya lakshmi wrote: > how to use Rtree in postgis > > On 1/3/12, Muhammad Imran wrote: >> Hi Lauri, >> >> 1- Disable or remove unique key (UK) on tabl

Re: [postgis-users] shp2pgsql - how to continue when error occurs

2012-01-03 Thread Nithya lakshmi
how to use Rtree in postgis On 1/3/12, Muhammad Imran wrote: > Hi Lauri, > > 1- Disable or remove unique key (UK) on table. > 2- Import data using shp2pgsql > 3- remove duplicate rows using SQL > DELETE > FROM sometable > WHERE someuniquekey NOT IN > (SELECT MAX(dup.someuni

Re: [postgis-users] shp2pgsql - how to continue when error occurs

2012-01-03 Thread Muhammad Imran
Hi Lauri, 1- Disable or remove unique key (UK) on table. 2- Import data using shp2pgsql 3- remove duplicate rows using SQL DELETE FROMsometable WHERE someuniquekey NOT IN (SELECT MAX(dup.someuniquekey) FROMsometable As dup GROUP BYdup.dupco