"RE: [postgis-users] Intersection bug

Sean M. Montague smontague at ATSDenver.com
Tue Mar 29 15:49:15 PST 2005


I just got my email back after being down since last Thursday.  Below is
my query in php syntax

$theSQL=("SELECT AsSVG(intersection(the_geom, $extract),0,8)
As the_geom
>From $table
WHERE layer='$lyr'
AND the_geom && $extract");

$extract is a box defined by the user as they zoom in.  The SVG
coordinates have been modified to correspond to the PostGIS database.

My layers are MULTIPOLYGON with many of them containing holes.  If
$extract falls over a hole, then nothing is returned.  Sometimes the
poly layer is returned, and sometimes not.  This is what I mean by
aborted.  It doesn't actually throw me an error, it just does nothing.
You say it returns an "empty geom", which I take as meaning this is
intentional and not a bug.  Is this true?  If so, is there a way around
it?  All my poly layers have holes, which would render the intersection
query useless to me.  Thanks.


-----Original Message-----

If your query box falls into a polygon hole the result will be
the empty geom (it's topological intersection!).

If by 'gets aborted' you mean you receive an error this has to do
GEOS/JTS algorithms throwing exceptions, error message should tell
you more; they are usually due to invalidity of input geometries.

Finally: what are you really doing ? Show us a query.

--strk;

On Thu, Mar 24, 2005 at 02:57:14PM -0700, Sean M. Montague wrote:
> Has anyone had a problem with intersecting a poly and getting a result
> one time and nothing another?  In my SVG, I have set up zoom levels,
> when the map reaches a certain level, I intersect the data in PostGIS
> with the user defined zoom box, and recreate the map, allowing me to
add
> detail without increasing map size.  But there seems to be a bug in
the
> intersection query.  It seems that if my zoom box happens to intersect
a
> poly a certain way, the whole query gets aborted and nothing is
> returned.  I've potentially already detected what is happening, but
I'm
> not sure how to simplify my example.  I've done so already, but I only
> know how to use php with PostGIS, so any example I forward will be in
> php.  I use SVG to display the results.  Only way I know how to. 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list