Frank,
I ended up using SetSpatialFilter with an OGRLinearRing and it works great.
It filters my selection from 247,203 polygons down to 218 extremelly fast.
Thanks again for all your help,
Andy

-----Original Message-----
From: Frank Warmerdam [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 09, 2004 6:57 AM
To: [EMAIL PROTECTED]
Subject: Re: [mitab] Spatial query ability


Andrew wrote:
> Is there anything in the MITAB api that would allow me to do an
> "within" type of query? Basically I'd like to be able to select all
> the polygons within a certain rectangle. Is there anything like this
> built in or do I need to implement my own spatial manipulation of
> features?

Andy,

You can call SetSpatialFilter() on any OGRLayer (which is a base class of
TABFile) to set a query rectangle.  Then only features whose geometry
envelope (bounding rectangle) intersects the envelope of your spatial filter
geometry will be read.

If you need a more exact spatial query, such as to return only geometries
completely within a rectangle, then you will need to do some further
processing yourself.  The current CVS version of GDAL/OGR (which includes
MITAB of course) includes integration with the GEOS geometry engine which
can do a variety of spatial predicates.

Note that the SetSpatialFilter() style filtering will take advantage of
the spatial index of the tab file to fairly efficiently only read the
features in the target area.

Best regards,

-- 
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up   | Frank Warmerdam,
[EMAIL PROTECTED]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





 
Yahoo! Groups Links



 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/dkFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/mitab/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to