[postgis-users] basic functionalities of PostGIS

Birgit Laggner birgit.laggner at vti.bund.de
Fri Feb 11 00:28:27 PST 2011


  Hi Apostolis,

sorry for not responding - I just didn't see your e-mail... Good, you 
reminded me!


On 02.02.2011 12:12, ΑΠΟΣΤΟΛΟΣ ΛΕΛΕΝΤΖΗΣ wrote:
> Birgit, thanks for your reply.
> Lately, i had no time...so now i deal with postgis!
> Before, i run the sql file, i had noticed that you define your SRID 
> code (31467). Here can i put the SRID code of my data??

Yes, that's right - at any instance where I am creating the geometry 
column you would have to change my SRID into the one of your data - If 
you don't want to do this, you also could change the function to 
automaticely recognize the SRID of your data:

Replace every 31467 in the functions with

st_srid('||schemaname||'.'||table_a||'

and then execute the changed functions again.

> Then, i execute the sql file, and i type the following command for 
> union two geometric tables:
>
> select _pgunion('test1', 'poly1', 'id poly1', 'poly2', 'id poly2');
>
> but, i got an error message:
>
> ERROR: syntax error at or near "integer"
> LINE 1: ...sec_poly1_poly2 (gid serial PRIMARY KEY, id poly1 integer, i...
> ^
> QUERY: CREATE TABLE test1.intsec_poly1_poly2 (gid serial PRIMARY KEY, 
> id poly1 integer, id poly2 integer );
> CONTEXT: PL/pgSQL function "_pgunion" line 34 at EXECUTE statement
>
> why?? from this message, i understand that the problem is the type of 
> column id of the table poly1, is it??

I would guess the function has problems with the id names because they 
contain a space - try to rename them to id_poly1 or something like that...
> could you help me for another time??
> I suppose that i don't build with the right manner my data, so would 
> be useful if you send me an example, namely, a backup file.
I will send you my test file in the next e-mail...
> So, i 'll see the indexes, and anything else is required.
>
> Thanks in advance
> Apostolis
>
I hope everything will work fine :-)

Regards,

Birgit




More information about the postgis-users mailing list