[postgis-users] Re: inserting LL RR into box2d

Ramachandran v.ramachandran at and.com
Thu Aug 9 22:16:06 PDT 2007


Hi Regina,

Thank you for your valuable guidance,
It works well,
It is 4326 spatial ref. but doesn't included decimal values,
However you have solved my problem,

Regards,
Rama.

> 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));
>
>
>  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));
>
>
> Hope that helps,
> Regina





More information about the postgis-users mailing list