<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal>Hi all<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>I am helping to build a web mapping application using Openlayers,
Geoserver and PostGIS. One of the fundamental functions that we need to build
into the application is the facility to allow users to define a bounding box on
the map to discover all the spatial data available for that area. I'm currently
working on the database SQL needed to process such a request. I've written the
following query that allows me to retrieve the data within a bounding box for a
single polygon layer:<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>SELECT policeareas.gid, policeareas.name,
ST_AsEWKT(policeareas.the_geom) as WKT FROM policeareas, boundingbox WHERE
ST_Intersects(boundingbox.the_geom, policeareas.the_geom);<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>What I don't know how to do is to write a query that retrieves
ALL spatial data (point, line and polygon layers/tables) in the database within
the specified search area. Also, should I be using Box2d or Box3d to handle my
bounding box object?<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Any help/pointers appreciated.<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Thanks <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Rob<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal> <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'>Dr Robert Berry<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'>Wales Institute of Social
and Economic Research, Data and Methods (WISERD)<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'>Room J308b<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'>GIS Research Centre<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'>Faculty of Advanced
Technology<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'>University of Glamorgan<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'>CF371DL<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'><o:p> </o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'>01443 483377<o:p></o:p></span></b></p>
<p class=MsoNormal><b><span style='font-size:10.0pt'>raberry@glam.ac.uk<o:p></o:p></span></b></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>