[postgis-users] RE: getting non-latlon extent as lat/lon

Steve Benzo steve_benzo at yahoo.com
Tue Aug 8 06:49:13 PDT 2006


Hi,
   
  It looks like we're on the right track towards getting an aggregated lat/lon from a non lat/lon EPSG'd table. The one issue I'm getting when running that command Mark, is an "Input geometry has unknown (-1) SRID"
   
  I've checked geometry_columns and the table in question does have an EPSG code assigned to it, so I dunno...
   
  Thoughts?
   
  SB 
   
  -------

ERROR:  Input geometry has unknown (-1) SRID
  
  In statement:
SELECT AsText(transform(extent(the_geom), 4326)) FROM tablex;
   
  Geometry_columns
   public tablex 2 26917 MULTIPOLYGON 
  ----------
   
  On Sat, 2006-08-05 at 05:03 -0700, Steve Benzo wrote:
> Ok, that seems to get me a bunch of lat/lon coordinates, but how do I
> translate those into an extent then? Thanks.
>  
> SB


Hi Steve,

How about something like this:

SELECT AsText(transform(extent(the_geom), 4326) FROM geomtable;

Note that since extent() is an aggregate it will scan the entire table
to produce the overall extent which can be slow on larger tables; you
may like to consider using the estimated_extent() function if you need
to do this interactively as part of an application.


Kind regards,

Mark.


 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060808/236ad006/attachment.html>


More information about the postgis-users mailing list