Hi,
The problem I guess is to understand the different geographical
operators
ObjectA Within ObjectB = ObjectB Contains
ObjectA:
The centroid of ObjectA is within ObjectB/ObjectB contains the centroid
of ObjectA
ObjectA Partly Within ObjectB = ObjectB Contains
Part ObjectA = ObjectA Intersects ObjectB
Some part of ObjectA is "touching" some part of
ObjectB
ObjectA Entirely Within ObjectB = ObjectB
Contains Entire ObjectA
No part of ObjectA is outside ObjectB, it is okay for a
node in ObjectA to "touch" ObjectB
So to solve the questions you need to do this:
1) Census Tracts that fall "Entirely Within" a buffer object
Select * from
CENSUSTRACTS
Where obj Entirely Within Any
(Select obj From Buffer)2) Census Tracts that fall "Entirely and Partially Within" a buffer object
Select * from
CENSUSTRACTS
Where obj Partly Within Any
(Select obj From Buffer)3) Census Tracts that fall "Entirely Outside" a buffer
object
Select * from
CENSUSTRACTS
Where not obj Partly Within
Any (Select obj From Buffer)4) Census Tracts that fall "Entirely and Partially
Outside" a buffer object.
Select * from
CENSUSTRACTS
Where not obj Entirely Within
Any (Select obj From Buffer)And this brings me back to the problem that has been
discussed on the list before. Using a Sub Select might result in selecting a
record several times, so you would actual need to do a final
select
Select * from CENSUSTRACTS
Where ID In (Select ID From
Selection Group By ID)
Where Selection is the result of one of the 4 queries
above
HTH,
Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis
GIS Developer, MTM
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Terry McDonnell
Sent: Friday, March 17, 2006 6:29 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [MI-L] Query for determining Entirely Within/Outside of Buffer
Akua
1) I assume
you got:
objectA Entirely Within objectB
2) An object
can't be both: If it's entirely in then it can't be just partially
in. If you mean "both those that are partially, and those that are
entirely within" then you need to join the two operators with
OR:
...
objectA Partly Within objectB
or
objectA Entirely Within objectB
3) If an
object's entirely outside then it's not partly within:
....
NOT
(objectA Partly Within objectB)
4) Again An
object can't be both: If it's entirely ouside then it can't be just
partially outside. If you mean "both those that are partially, and those
that are entirely outside" then you need to join the two operators with
OR:
...
NOT( objectA Partly Within objectB
or objectA Entirely
Within objectB) ... I THINK!!!
HTH
Terry
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: 17 March 2006 17:16
To: Terry McDonnell
Subject: [MI-L] Query for determining Entirely Within/Outside of Buffer
Greetings everyone!
Does anyone know how to create a query that determines the following:
1) Census Tracts that fall "Entirely Within" a buffer object
2) Census Tracts that fall "Entirely and Partially Within" a buffer object
3) Census Tracts that fall "Entirely Outside" a buffer object
4) Census Tracts that fall "Entirely and Partially Outside" a buffer object.
For some reason when I tried doing part of #2, (trying to get the tracts "Partially Within" - I tried both "Contains" and "Within"),
the query did not pick up ALL of the tracts that actually did fall a bit within the buffer.
Is there a reason why it is not picking up all of the tracts?
For #'s 3 and 4, I have noooo idea of what operators/formula to use.
Can anyone help?
Thanks so much!
:) Akua
_______________________________________________ MapInfo-L mailing list [email protected] http://www.directionsmag.com/mailman/listinfo/mapinfo-l
