Re: [postgis-users] Questions about using SRID not -1

2010-01-20 Thread ibrahim saricicek
Hi;

No you can change projection any time you want, the point on your table is;
You have objects in different projections but in one table. You have to find
which objects are 4326 projection, and which are not...

Another method may be;

Select st_xmin(the_geom), st_ymin(the_geom) from mypoints

if the coordinates differ from -->

Longitude
 180 W   = -180
 180 E   =  180

Latitude
  90 N   =   90
  90 S   =  -90

Namely your x not between -180 and 180 and y not between -90 and 90, the
objects are in an another projection.

I mean firstly try to differ different projected objects..

Regards,
IBO...



On Thu, Jan 21, 2010 at 2:01 AM, Oscar Zamudio  wrote:

> Hi,
> I tried:
>
> UPDATE  mypoints SET the_geom_4326=transform(the_geom,4326)
>
> But again I got:
>
> ERROR:  Input geometry has unknown (-1) SRID
>
> It seems that once the data is without explicit SRID, they cannot
> be processed later for asigning a proper SRID.
> It is strange at first sightbut I'm a newbie so I don't know much about
> this.
> Regards,
> Oscar
>
> On Tue, Jan 19, 2010 at 6:27 AM, ibrahim saricicek <
> ibrahimsarici...@gmail.com> wrote:
>
>> Hi,
>>
>> Your table include objects, more than one projection.. So if there is any
>> object in different projection you can't set your table projection to
>> 4326...
>>
>> can you try this!!
>>
>> Create a new geometry column "the_geom_4326"
>>
>> then run this
>>
>> UPDATE  table_name SET the_geom_4326=transform(the_geom,4326),
>>
>> then use ST_SetSRID for the new column...
>>
>> REgards,
>> ibo...
>>
>>
>> On Mon, Jan 18, 2010 at 7:23 PM, Oscar Zamudio  wrote:
>>
>>> Hi everybody.
>>> I had no success with any of the recipes received here.
>>> Could it be that a table with data loaded without SRID explicit value has
>>> no chance of being updated later to the right one?
>>> Regards,
>>> Oscar
>>>
>>>
>>> On Sun, Jan 17, 2010 at 1:08 PM, Oscar Zamudio  wrote:
>>>
 Ben,
 I tried your intruction:

 UPDATE mypoints SET the_geom = ST_SetSRID(the_geom,4326);

 But I got:

 ERROR:  Operation on two GEOMETRIES with different SRIDs

 Regards,
 Oscar

 On Sat, Jan 16, 2010 at 10:48 PM, Ben Madin <
 li...@remoteinformation.com.au> wrote:

> Oscar,
>
> you have a couple of options as I see it. In Postgres you could just
> update the geometries first.
>
> > UPDATE mytable SET the_geom = ST_SetSRID(the_geom,4326);
>
>
> And for next time, assuming your data originally had some sort of
> coordinate system (and it must have if it was spatial data), you can /
> should use the -s flag in shp2pgsql to provide 'SRID awareness'
>
> In your case, I would suggest -s 4326.
>
> ie (using -d to drop and replace existing table
>
> $ shp2pgsql -s 4326 -d myshapefile myoldtablename | psql mydatabase
>
>
> In geometry terms, I think it is unlikely that your data was stored
> (spatially) as sexagesimal degrees, although it may be displayed as such 
> in
> your GIS.
>
> cheers
>
> Ben
>
>
>
>
>
> On 17/01/2010, at 2:54 , Oscar Zamudio wrote:
>
> > Hi,
> > I'm have problems to transform my spatial data to UTM. First, this
> instruction works OK:
> >
> > SELECT ST_Transform(ST_GeomFromText('POINT(0.0 20)',4326),22171) from
> mypoints
> >
> > No matter if such a sentence has no meaning on what I tryin to do.
>  But when I did the same with my own points:
> >
> > SELECT ST_Transform(mypoints.the_geom,22171) from mypoints
> >
> > I get the following error:
> > ERROR: Input geometry has unknown (-1) SRID
> > SQL state: XX000
> >
> > Ok, when I insert my points in my spatial enabled database I used:
> >
> > INSERT INTO mydistance ( the_geom, the_name ) VALUES (
> ST_GeomFromText('POINT(-58.0 0.0)'), 'Punto 1-1');
> >
> > without no spatial reference system explicit so I guess the SRID is
> set to "unknown" i.e. -1.  Then naively I created a new column named srid
> for my table and put the right value of SRID for all my data which is 4326
> (WGS84, sexagesimal degrees lat lon) in that column but still I get the 
> same
> error. After that I created a constraint between this new srid column and
> the srid column from the spatial_ref_sys table but nothing happened, the
> error is still there.
> > It's important to me to solve this issue because all my spatial data
> was loaded from shapefiles without SRID awareness so they don't have any
> SRID column. I don't want to reload data changing this so I need a method 
> to
> alter the tables in such a way to add this new srid column to them that is
> well related to the spatial context.
> > Thanks and regards,
> > Oscar
>  > ___
> > postgis-users mailing list
> > postgis-user

Re: [postgis-users] Questions about using SRID not -1

2010-01-20 Thread Chris Hermansen

Have you tried UpdateGeometrySRID()

http://www.postgis.org/documentation/manual-1.4/UpdateGeometrySRID.html

Oscar Zamudio wrote:

Hi,
I tried:

UPDATE  mypoints SET the_geom_4326=transform(the_geom,4326)

But again I got:

ERROR:  Input geometry has unknown (-1) SRID

It seems that once the data is without explicit SRID, they cannot 
be processed later for asigning a proper SRID.
It is strange at first sightbut I'm a newbie so I don't know much 
about this.

Regards,
Oscar
 
On Tue, Jan 19, 2010 at 6:27 AM, ibrahim saricicek 
mailto:ibrahimsarici...@gmail.com>> wrote:


Hi,
 
Your table include objects, more than one projection.. So if there

is any object in different projection you can't set your table
projection to 4326...
 
can you try this!!
 
Create a new geometry column "the_geom_4326"
 
then run this
 
UPDATE  table_name SET the_geom_4326=transform(the_geom,4326),
 
then use ST_SetSRID for the new column...
 
REgards,

ibo...
 
 
On Mon, Jan 18, 2010 at 7:23 PM, Oscar Zamudio 
> wrote:

Hi everybody.
I had no success with any of the recipes received here.
Could it be that a table with data loaded without SRID
explicit value has no chance of being updated later to the
right one?
Regards,
Oscar


On Sun, Jan 17, 2010 at 1:08 PM, Oscar Zamudio
mailto:cmn...@gmail.com>> wrote:

Ben,
I tried your intruction:

UPDATE mypoints SET the_geom = ST_SetSRID(the_geom,4326);

But I got:

ERROR:  Operation on two GEOMETRIES with different SRIDs

Regards,
Oscar

On Sat, Jan 16, 2010 at 10:48 PM, Ben Madin
mailto:li...@remoteinformation.com.au>> wrote:

Oscar,

you have a couple of options as I see it. In Postgres
you could just update the geometries first.

> UPDATE mytable SET the_geom = ST_SetSRID(the_geom,4326);


And for next time, assuming your data originally had
some sort of coordinate system (and it must have if it
was spatial data), you can / should use the -s flag in
shp2pgsql to provide 'SRID awareness'

In your case, I would suggest -s 4326.

ie (using -d to drop and replace existing table

$ shp2pgsql -s 4326 -d myshapefile myoldtablename |
psql mydatabase


In geometry terms, I think it is unlikely that your
data was stored (spatially) as sexagesimal degrees,
although it may be displayed as such in your GIS.

cheers

Ben





On 17/01/2010, at 2:54 , Oscar Zamudio wrote:

> Hi,
> I'm have problems to transform my spatial data to
UTM. First, this instruction works OK:
>
> SELECT ST_Transform(ST_GeomFromText('POINT(0.0
20)',4326),22171) from mypoints
>
> No matter if such a sentence has no meaning on what
I tryin to do.  But when I did the same with my own
points:
>
> SELECT ST_Transform(mypoints.the_geom,22171) from
mypoints
>
> I get the following error:
> ERROR: Input geometry has unknown (-1) SRID
> SQL state: XX000
>
> Ok, when I insert my points in my spatial enabled
database I used:
>
> INSERT INTO mydistance ( the_geom, the_name ) VALUES
( ST_GeomFromText('POINT(-58.0 0.0)'), 'Punto 1-1');
>
> without no spatial reference system explicit so I
guess the SRID is set to "unknown" i.e. -1.  Then
naively I created a new column named srid for my table
and put the right value of SRID for all my data which
is 4326 (WGS84, sexagesimal degrees lat lon) in that
column but still I get the same error. After that I
created a constraint between this new srid column and
the srid column from the spatial_ref_sys table but
nothing happened, the error is still there.
> It's important to me to solve this issue because all
my spatial data was loaded from shapefiles without
SRID awareness so they don't have any SRID column. I
don't want to reload data changing this so I need a
method to alter the tables in such a way to add this
new srid column to them that is well related to the
spatial context.

Re: [postgis-users] Questions about using SRID not -1

2010-01-20 Thread Oscar Zamudio
Hi,
I tried:

UPDATE  mypoints SET the_geom_4326=transform(the_geom,4326)

But again I got:

ERROR:  Input geometry has unknown (-1) SRID

It seems that once the data is without explicit SRID, they cannot
be processed later for asigning a proper SRID.
It is strange at first sightbut I'm a newbie so I don't know much about
this.
Regards,
Oscar

On Tue, Jan 19, 2010 at 6:27 AM, ibrahim saricicek <
ibrahimsarici...@gmail.com> wrote:

> Hi,
>
> Your table include objects, more than one projection.. So if there is any
> object in different projection you can't set your table projection to
> 4326...
>
> can you try this!!
>
> Create a new geometry column "the_geom_4326"
>
> then run this
>
> UPDATE  table_name SET the_geom_4326=transform(the_geom,4326),
>
> then use ST_SetSRID for the new column...
>
> REgards,
> ibo...
>
>
> On Mon, Jan 18, 2010 at 7:23 PM, Oscar Zamudio  wrote:
>
>> Hi everybody.
>> I had no success with any of the recipes received here.
>> Could it be that a table with data loaded without SRID explicit value has
>> no chance of being updated later to the right one?
>> Regards,
>> Oscar
>>
>>
>> On Sun, Jan 17, 2010 at 1:08 PM, Oscar Zamudio  wrote:
>>
>>> Ben,
>>> I tried your intruction:
>>>
>>> UPDATE mypoints SET the_geom = ST_SetSRID(the_geom,4326);
>>>
>>> But I got:
>>>
>>> ERROR:  Operation on two GEOMETRIES with different SRIDs
>>>
>>> Regards,
>>> Oscar
>>>
>>> On Sat, Jan 16, 2010 at 10:48 PM, Ben Madin <
>>> li...@remoteinformation.com.au> wrote:
>>>
 Oscar,

 you have a couple of options as I see it. In Postgres you could just
 update the geometries first.

 > UPDATE mytable SET the_geom = ST_SetSRID(the_geom,4326);


 And for next time, assuming your data originally had some sort of
 coordinate system (and it must have if it was spatial data), you can /
 should use the -s flag in shp2pgsql to provide 'SRID awareness'

 In your case, I would suggest -s 4326.

 ie (using -d to drop and replace existing table

 $ shp2pgsql -s 4326 -d myshapefile myoldtablename | psql mydatabase


 In geometry terms, I think it is unlikely that your data was stored
 (spatially) as sexagesimal degrees, although it may be displayed as such in
 your GIS.

 cheers

 Ben





 On 17/01/2010, at 2:54 , Oscar Zamudio wrote:

 > Hi,
 > I'm have problems to transform my spatial data to UTM. First, this
 instruction works OK:
 >
 > SELECT ST_Transform(ST_GeomFromText('POINT(0.0 20)',4326),22171) from
 mypoints
 >
 > No matter if such a sentence has no meaning on what I tryin to do.
  But when I did the same with my own points:
 >
 > SELECT ST_Transform(mypoints.the_geom,22171) from mypoints
 >
 > I get the following error:
 > ERROR: Input geometry has unknown (-1) SRID
 > SQL state: XX000
 >
 > Ok, when I insert my points in my spatial enabled database I used:
 >
 > INSERT INTO mydistance ( the_geom, the_name ) VALUES (
 ST_GeomFromText('POINT(-58.0 0.0)'), 'Punto 1-1');
 >
 > without no spatial reference system explicit so I guess the SRID is
 set to "unknown" i.e. -1.  Then naively I created a new column named srid
 for my table and put the right value of SRID for all my data which is 4326
 (WGS84, sexagesimal degrees lat lon) in that column but still I get the 
 same
 error. After that I created a constraint between this new srid column and
 the srid column from the spatial_ref_sys table but nothing happened, the
 error is still there.
 > It's important to me to solve this issue because all my spatial data
 was loaded from shapefiles without SRID awareness so they don't have any
 SRID column. I don't want to reload data changing this so I need a method 
 to
 alter the tables in such a way to add this new srid column to them that is
 well related to the spatial context.
 > Thanks and regards,
 > Oscar
  > ___
 > postgis-users mailing list
 > postgis-users@postgis.refractions.net
 > http://postgis.refractions.net/mailman/listinfo/postgis-users

 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users

>>>
>>>
>>
>> ___
>> postgis-users mailing list
>> postgis-users@postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>
> ___
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refr

[postgis-users] insert query does not work anymore...

2010-01-20 Thread Steve . Toutant
Hi,
Something strange
I have PHP page that send a simple insert query to postgis. Until now this 
was working perfectly.
Now the INSERT queries do not work without any changes...as I recall...
If I execute the same query with pgAdminIII it works.

I'm able do to delete, select and create tables.

Is there any reason why postgis would suddenly reject an insert query from 
PHP? 

Any tips to investigate this curious behavior? 
Thanks
steve___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] Postgis on AIX

2010-01-20 Thread Derek Jones

Hi folks,

I have a need to run postgis on AIX.

I already have postgis on x86 working just fine - has for a long while.

Now I need to duplicate the DB on AIX, but the backend server process 
dies when loading the postgis shared lib. I've tried truss on it, but to 
no real help. Wondered if anyone had a compile tip that I am missing.


Here are the details:

-

Base OS is AIX 5.3
Compiler is xlc

IBM XL C/C++ Enterprise Edition for AIX, V9.0

I have a compiled and working 8.4.2 postgresql. I have data loaded, I 
can do selects, inserts, etc. Just fine.


I have compiled up geos and proj

geos-3.2.0
proj-4.7.0

postgis is version 1.4.1



Bear in mind I have already compiled up and worked with postgis just 
fine on x86 for some years. The problem is AIX specific.


I am not sure if there is some peculiar command line option I need to 
use on AIX - esp. with xlc. (Can't easily use gcc on this machine).


Here's part of the truss dump of what happens when the thing runs:


213446: statx("/usr1/local/lib/postgresql/postgis-1.4", 0x2FF1DCB0, 128, 
010) Err#2 ENOENT
213446: statx("/usr1/local/lib/postgresql/postgis-1.4.so", 0x2FF1DCB0, 
128, 010) = 0
213446: statx("/usr1/local/lib/postgresql/postgis-1.4.so", 0x2FF1DCF0, 
128, 010) = 0
213446: __loadx(0x014801C0, 0x2FF1C8C0, 0x0960, 0xF0253C80, 
0x) = 0xF0230B00
213446: __loadx(0x0200, 0x2FF1D300, 0x0960, 0xF0230B00, 
0x) = 0x
213446: __loadx(0x0700, 0xF0253C74, 0x0006, 0xF0230B00, 
0x) = 0xF0507F60
213446: __loadx(0x0700, 0xF0253C90, 0x0006, 0xF0230B00, 
0x) = 0xF0508188
213446: __loadx(0x0200, 0x2FF1D300, 0x0960, 0x, 
0x) = 0x

213446: loadquery(2, 0x2021B178, 0x1000) = 0
213446: kfcntl(0, F_GETFL, 0x) = 67108866
213446: kfcntl(1, F_GETFL, 0x) = 67108866
213446: kfcntl(2, F_GETFL, 0x) = 67108866
213446: kfcntl(2, F_GETFL, 0x) = 67108866
213446: __loadx(0x014D0080, 0x2FF1C850, 0x0960, 0x20199408, 
0x) = 0x20228400
213446: __loadx(0x0A04, 0xD058B834, 0x2FF22FFC, 0xD0B2, 
0x) = 0x

213446: loadquery(2, 0x2021B178, 0x1000) = 0
213446: __loadx(0x02000200, 0xF0508CC8, 0x3E80, 0x20228400, 
0x) = 0x
213446: __loadx(0x0700, 0x1053D350, 0x0009, 0x20228400, 
0x20199560) = 0x2022D438
213446: __loadx(0x0700, 0x1053D3D4, 0x0009, 0x20228400, 
0x) = 0x

213446: access("/usr/lib/nls/msg/en_US/libc.cat", 0) = 0
213446: _getpid() = 213446
213446: open("/usr/lib/nls/msg/en_US/libc.cat", O_RDONLY) = 41
213446: kioctl(41, 22528, 0x, 0x) Err#25 ENOTTY
213446: kfcntl(41, F_SETFD, 0x0001) = 0
213446: kioctl(41, 22528, 0x, 0x) Err#25 ENOTTY
213446: kread(41, "\0\001 ?\007\007 I S O 8".., 4096) = 4096
213446: lseek(41, 0, 1) = 4096
213446: lseek(41, 0, 1) = 4096
213446: lseek(41, 0, 1) = 4096
213446: _getpid() = 213446
213446: lseek(41, 0, 1) = 4096
213446: lseek(41, 8069, 0) = 8069
213446: kread(41, " T h e s y s t e m c".., 4096) = 4096
213446: close(41) = 0
213446: __loadx(0x0700, 0x20218D70, 0x0009, 0x20228400, 
0x0029) = 0x2022F124
213446: __loadx(0x0700, 0x20218DF8, 0x0009, 0x20228400, 
0x20218E09) = 0x2022F070

213446: Received signal #4, SIGILL [default]
213446: *** process killed ***


It doesn't appear to complete the postgis shared lib load. Compared with 
the same o/p from strace on x86, where it goes on to load up geos and 
then proj just fine.


Any thoughts appreciated. Stuck with an 18CPU partition and 64G of 
memory and can't use it until I fix this :-)


Kind regards

Derek.



___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] windows 2008 server

2010-01-20 Thread Johannes Schulte Südhoff
Hi
No, but the 32bit version runs fine Windows 2008 R2 server.
Regards Johannes

- Original Message 

From: Bruno Friedmann 
To: postgis-users@postgis.refractions.net
Sent: Wed, 20 January, 2010 14:59:08
Subject: Re: [postgis-users] windows 2008 server

Is there also Windows 64bits ?

On 01/19/2010 09:44 PM, Paragon Corporation wrote:
> Steve,
> Works fine for us.  We have two client servers running Windows 2008 one 8.3
> and one 8.4.  I think there was an issue with some sort of  socket
> discconnecting that was more prevalent on windows 2008.  Those issues as far
> as I can tell have been fixed with the latest 8.3 and 8.4 patches.
>  
> Leo
> 
>   _  
> 
> From: postgis-users-boun...@postgis.refractions.net
> [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of
> steve.tout...@inspq.qc.ca
> Sent: Tuesday, January 19, 2010 2:27 PM
> To: postgis-users@postgis.refractions.net
> Subject: [postgis-users] windows 2008 server
> 
> 
> 
> Hi, 
> My IT service wants to install windows 2008 server on my server. 
> Does Postgres/Postgis work on this platform? Is there known issues? 
> 
> thanks in advance 
> Steve 
> 
>

-- 

 Bruno Friedmann

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



  
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] windows 2008 server

2010-01-20 Thread Bruno Friedmann
Is there also Windows 64bits ?

On 01/19/2010 09:44 PM, Paragon Corporation wrote:
> Steve,
> Works fine for us.  We have two client servers running Windows 2008 one 8.3
> and one 8.4.  I think there was an issue with some sort of  socket
> discconnecting that was more prevalent on windows 2008.  Those issues as far
> as I can tell have been fixed with the latest 8.3 and 8.4 patches.
>  
> Leo
> 
>   _  
> 
> From: postgis-users-boun...@postgis.refractions.net
> [mailto:postgis-users-boun...@postgis.refractions.net] On Behalf Of
> steve.tout...@inspq.qc.ca
> Sent: Tuesday, January 19, 2010 2:27 PM
> To: postgis-users@postgis.refractions.net
> Subject: [postgis-users] windows 2008 server
> 
> 
> 
> Hi, 
> My IT service wants to install windows 2008 server on my server. 
> Does Postgres/Postgis work on this platform? Is there known issues? 
> 
> thanks in advance 
> Steve 
> 
>

-- 

 Bruno Friedmann

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users