[postgis-devel] BOX3D creation issue (concat)
James DeMichele
James.DeMichele at redfin.com
Thu Oct 25 16:57:17 PDT 2007
Hi,
I am having an issue creating a BOX3D and using concat to create the
BOX3D. Here is the table I have that I am using to get my bounding
points from:
postgres=# select * from markets;
market_id | 1
name | sample
days_to_old | 45
display_name | Sample Area
mkt_bdry_min_lat | 46.7285
mkt_bdry_min_long | -123.038
mkt_bdry_max_lat | 48.2984
mkt_bdry_max_long | -120.906
When I attempt to construct a BOX3D using a query that concats these
items together such as:
select 'BOX3D(' || m.mkt_bdry_min_long || ' ' || m.mkt_bdry_min_lat ||
', ' || m.mkt_bdry_max_long || ' ' || m.mkt_bdry_max_lat || ')'::box3D
from markets m where m.market_id = 1;
ERROR: BOX3D parser - doesnt start with BOX3D(
----------------------
I found some information that suggested I attempt to make a Geometry out
of this string instead. So I tried this:
select GeometryFromText('BOX3D(' || m.mkt_bdry_min_long || ' ' ||
m.mkt_bdry_min_lat || ', ' || m.mkt_bdry_max_long || ' ' ||
m.mkt_bdry_max_lat || ')', 4326) from markets m where m.market_id = 1;
ERROR: Invalid OGC WKT (does not start with P,L,M,C or G)
----------------------
I also found some information that suggests using "expand(geometry,
float)." But, I don't want to have to figure out how to expand anything
since I already have the exact bounding box.
Any help in figuring out how to construct this Box3D would be greatly
appreciated.
Thanks.
-James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20071025/a89e6a60/attachment.html>
More information about the postgis-devel
mailing list