[postgis-users] Not able to excute spatial query on postgresql database with postgis support

Michael Fuhr mike at fuhr.org
Wed Nov 1 07:02:19 PST 2006


On Tue, Oct 31, 2006 at 10:47:50AM -0600, vamsee movva wrote:
> > What can you tell us about the geometries in la_damage ?
>
> Honestly i don't have any idea about geometries and how to find geometries.
> the geometry in la_blocks for stfid = 220750501002999?
> I don't know how to see the geometry of the_geom column.

You can see a geometry's textual representation with functions like
AsText() and AsEWKT() or you could see graphical output with various
visualization tools.

> > What's the output of the following query?
> 
> SELECT summary(the_geom) FROM la_blocks WHERE stfid = '220750501002999';
> please find the attached file "stfid.txt"

Ouch:

> MultiPolygon[B] with 1 elements
>   Polygon[] with 2507 rings

I count 64266 points altogether.  Does this geometry's row in
la_blocks contain other columns that explain what it is?  Is this
geometry's size an anomaly?  The following queries should show
the geometries with the most rings and points:

SELECT stid, npoints(the_geom), nrings(the_geom)
FROM la_blocks
ORDER BY nrings DESC
LIMIT 10;

SELECT stid, npoints(the_geom), nrings(the_geom)
FROM la_blocks
ORDER BY npoints DESC
LIMIT 10;

Examining the geometry's bounding box might also be revealing:

SELECT getbbox(the_geom)
FROM la_blocks
WHERE stfid = '220750501002999';

I'm wondering if this geometry is representative of the rest of the
data or if it's an outlier and possibly bogus.

-- 
Michael Fuhr



More information about the postgis-users mailing list