Forgive me for my laymans terms but I have been landed with an
embedded Mapinfo 9.5 application which is returning spurious
intersecting data for a plotted polygon. Despite trawling through the
'Net, this forum and the user guides for clues as to how to fix our
problem I'm not really up to speed with all the correct terminology
Our application allows the user to plot a polygon (Usually a spefic
property or plot of land) and then attempts to drill through the
layers retrieving any data from the layers where the plotted polygon
intersects. Pretty standard stuff I'd expect. Where our problem lies
is that in some cases the user may also wish to plot an area inside a
neighbouring property, and if so we would want to include that data
too.
Our problem is that we only want to return all intersecting data that
appears *inside* the plotted polygon and not any neighbouring layers
that are adjacent to the the plotted polygon. The current code uses
'Intersect' which returns too much data (neighbouring properties that
have not being plotted into) and when modified to 'Contains' it only
returns data for any neighbouring polygons where the plotted polygon
covers the centroid of the neighbouring property.
Is there any way of retrieving data that only lies within the plotted
polygon, regardless of whether the centroid is covered or not?
I hope this makes sense but to clarify I have put together an
illustration of our problem:
http://www.mis-lgs.com/downloads/MapinfoRules.jpg
Thank you in advance for any advice on how we can achieve the desired
results.
--
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To post to this group, send email to mapi...@googlegroups.com.
To unsubscribe from this group, send email to mapinfo-l+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mapinfo-l?hl=en.
As far as I'm aware Intersects is the query you would want.
I don't know about the rest of the group but I would have used the
intersects query here. I'm a bit suprised you are getting record 3
back from the intersects. It would suggest the boundary between 2 and
3 isn't flush and it could be possible that a stray vertex somewhere
does cross the boundary between 2 and 3
If there is one vertex not snapped it could be possible that the
boundaries do intersect eachother.
There is a good page on the MapInfo Professional Helpfile showing the
difference between each of the Spatial Queries.
http://reference.mapinfo.com/software/mapinfo_pro/english/9.0/MI_UG.pdf
Page 332
This guide is for MapInfo 9.0 but it all still applies to MapInfo 9.5.
Intersects does not worry about Centroid, whereas the Within query
uses the centroid of a polygon.
Good luck.
Andrew
Maybe you need to reduce the search polygon very slighly, by creating a
buffer within the search polygon with a buffer distance of minus a few
inches or centimetres.
Then run the query on the buffer object, not the original object.
Gentreau.
So to filter out neighboring regions that only have a common boundary
and that the intersects operator returns true for you can use
Select * from table where area(overlap(obj, testobj), "sq in") > 0
Overlap will return empty objects for regions with just a common
boundary. Note that this will be slower than intersects because we are
creating the actual objects of intersection for each comparison. But
that may not be an issue.
Eric Blasenheim
PBBI (MapInfo)
> results.- Hide quoted text -
>
> - Show quoted text -
Cheers!
I finally managed to get the system working as required using a
negative buffer as suggested. The code I used applies a -5cm negative
buffer on any polygons plotted in the original LCPlotlayer into a new
table called 'Buffer'. I simply run the intersects operator on the new
table and the results then only return anything inside the originally
plotted polygon and not any neighbouring polygons.
Cheers all.
Although specific to my solution here's the code in case it helps
anyone in the future:
Create Table "buffer" (MISRef Char(50)) file "C:\Documents and Settings
\lee\My Documents\buffer.TAB" TYPE NATIVE Charset "WindowsLatin1"
Create Map For buffer CoordSys Earth Projection 8, 79, "m", -2, 49,
0.9996012717, 400000, -100000 Bounds (-7845061.1011, -15524202.1641)
(8645061.1011, 4470074.53373)
Add Map Layer buffer
Set Map Layer 1 Editable On
Create Object As Buffer From LCPlotLayer Width -5 Units "cm" Type
Cartesian Resolution 12 Into Table buffer Group by Rowid Data
MISRef=MISRef