<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=555272821-20082007><FONT face="Courier New"
color=#800000>Thanks Josh,</FONT></SPAN></DIV>
<DIV><SPAN class=555272821-20082007><FONT face="Courier New"
color=#800000></FONT></SPAN> </DIV>
<DIV><SPAN class=555272821-20082007><FONT face="Courier New" color=#800000>This
did the trick.</FONT></SPAN></DIV>
<DIV><SPAN class=555272821-20082007><FONT face="Courier New"
color=#800000></FONT></SPAN> </DIV>
<DIV><SPAN class=555272821-20082007><FONT face="Courier New"
color=#800000>Matt</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV align=left>It is from the wellspring of our despair and the places that we
are broken that we come to repair the world.</DIV>
<DIV align=left>-- Murray Waas</DIV>
<DIV><FONT face="Courier New" color=#800000><SPAN
class=555272821-20082007>-----------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><PRE>I don't know the intricacies of that error, but you have a couple easy
options. For just the one county, like in your query - ditch the
distinct, eg:
SELECT extent(the_geom) FROM shp_precincts WHERE county_id=72;
For all counties, try pulling the geom data out in different style, eg:
SELECT distinct(county_id), astext(extent(the_geom)) as the_extent FROM
shp_precincts GROUP BY county_id
-Josh
Matthew Pettis wrote:
><I> Hi,
</I>><I>
</I>><I> I'm trying to calculate a minimum bbox/extent for a group of polygons
</I>><I> with a similar attribute. For this specific case, I am trying to find
</I>><I> a bbox/extent for all of the voting precincts within the same county.
</I>><I>
</I>><I> here is the sql I'm executing:
</I>><I> =====================
</I>><I> select
</I>><I> distinct
</I>><I> extent(the_geom) as the_extent
</I>><I> from
</I>><I> shp_precincts
</I>><I> where
</I>><I> county_id = 72
</I>><I> ;
</I>><I> =====================
</I>><I>
</I>><I> 'the_geom' is a polygon representing a voting precinct, and the where
</I>><I> clause subsets to all voting precincts belonging to a specific
</I>><I> county. I get the following error which I don't understand or know
</I>><I> how to correct:
</I>><I>
</I>><I> =====================
</I>><I> ERROR: could not identify an ordering operator for type box2d
</I>><I> HINT: Use an explicit ordering operator or modify the query.
</I>><I> =====================
</I>><I>
</I>><I> Any help is appreciated in resolving this. What I ultimately want to
</I>><I> do is have a result set that has a bounding box for each county based
</I>><I> on the polygons of precincts that belong to that county.
</I>><I>
</I>><I> tia,
</I>><I> Matt
</I>><I> --
</I>><I> It is from the wellspring of our despair and the places that we are
</I>><I> broken that we come to repair the world.
</I>><I> -- Murray Waas
</I>><I> ------------------------------------------------------------------------
</I>><I>
</I>><I> _______________________________________________
</I>><I> postgis-users mailing list
</I>><I> <A href="http://postgis.refractions.net/mailman/listinfo/postgis-users">postgis-users at postgis.refractions.net</A>
</I>><I> <A href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</A>
</I>><I> </I></PRE></DIV></BODY></HTML>