[postgis-users] inserting LL RR into box2d

Obe, Regina robe.dnd at cityofboston.gov
Thu Aug 9 05:08:11 PDT 2007


Forgot to mention.  Your BOX doesn't look like 4326 spatial ref.  Are
you sure it is and its not wishful thinking on your part.

If it isn't, then figure out the spatial ref of it and then do

 insert into box_test values( 1, transform(setsrid('BOX3D(1459678
4793288, 1459878
4793488)'::box3d, what_the_spatial_ref_really_is),4326));

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Obe,
Regina
Sent: Thursday, August 09, 2007 8:03 AM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] inserting LL RR into box2d

Bounding boxes aren't OGC geometry types and also don't have SRIDs.  Try
just doing

insert into box_test (id, box) values (1, 'BOX(1459678 4793288, 1459878
4793488)');

it should automatically cast the string to a box2d object

If you want a valid OGC geometry then you would set your box field to
geometry instead of box2d and do something like
ANSI SQL compliant

insert into box_test values(1, setsrid(CAST('BOX3D(1459678 4793288,
1459878 4793488)' As box3d), 4326));

or PostgreSQL shorthand
insert into box_test values( 1, setsrid('BOX3D(1459678 4793288, 1459878
4793488)'::box3d, 4326));

 

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Ramachandran
Sent: Thursday, August 09, 2007 6:23 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] inserting LL RR into box2d

Hi
I would like to insert point to box2d from text,

I have created table  like...

create table box_test ( id integer, box box2d),

here i am trying  to insert geometry for box2d,

insert into box_test (id, box) values (1, GeomFromText('BOX3D(1459678 
4793288, 1459878 4793488)' 4326));
but its not working properly,
Can anyone tell where i am wrong and how to insert point for LL & RR..

Thanks in advance,
Rama


_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list