Incorrect results from RelateQuery?

Topics: User Forum
Apr 3, 2007 at 8:08 PM
I have a query:

SELECT ST.AsText(ST.Envelope(the_geom))
FROM ST.RelateQuery('blockgroup', 'the_geom', ST.GeomFromText('POINT(-87.71596200638386 41.852889252821946)',-1), 'Within') AS q
INNER JOIN blockgroup AS t ON q.oid = t.oid

where blockgroup is us census block groups in latlong...

The above query returns the following envelope:
POLYGON((-67.9955300000001 47.1348699999999,-67.9955300000001 47.1607399999994,-67.92785 47.1607399999994,-67.92785 47.1348699999999,-67.9955300000001 47.1348699999999))

which doesn't have POINT(-87.71596200638386 41.852889252821946) in it.

Am I doing something wrong? Contains does not return any rows (and yes, the point is within a block).

Thanks,

John
Coordinator
Apr 4, 2007 at 9:37 PM
Hi,
I couldn't reproduce your problem. I downloaded the Illinois census block group data from here, imported it, ran your query and got:
POLYGON((-87.719854 41.851732,-87.719854 41.854832,-87.713454 41.854832,-87.713454 41.851732,-87.719854 41.851732))

Best regards,
Ricardo Stuven.