Hi All
as i promised that sum (i'm bored with registering raster images now)
Only one of the answers appeared to work (and that not completely - i'm
still tinkering. Many Thanks to Russell Lawley.

Anyway  here is the original Question

> Hi Listers
> an object geography type question for y'all
> 
> I have a set of polygons and a set of polylines. The objects in the
> polyline table fall into two categories. One lot run contiguous to the
> boundaries of the Polygon coverage (imagine the Polygon covergae after a
> 'convert to polylines' operation and that is them). The other lot of
> polylines are not do not run contiguous to the Polygon boundaries and are
> in fact completely enclosed by those polygons.
> 
> What I need to do is select all those polylines that are 'within' the
> polygon boundaries so I can create a new dataset. I have tried various SQL
> spatial statements but they do not seem to be achieving what I need
> 
> TIA and will sum
> 
And the Answwer

save a copy of your polygon table and then turn all thos polygons into
polylines (i'm calling this table "edges").
now pack the  table with the two types of line (polylinetab), add a
new column and then update it with rowid so that each of your lines
has an identifier (say LINEID).

now write out the following SQL to the SQL window
SELECT sum(objectlen(overlap(polylinetab.obj,edges.obj) , "m")) 
"RL_TEST" , polylinetab.LINEID
FROM
polylinetab,edges
WHERE
polylinetab.obj INTERSECTS edges.obj
GROUP BY
polylinetab.LINEID

run the query.

this will give you grouped table showing an amount of overlap and a
LINEID for all the polylines that have an overlap, with the EDGES of
your polygons. 
lines that only intersect the edges, not run along them, will have an
overlap of 0m and they will have be grouped together in the row with 
an RL_test = 0

NOW, you have to save that query result as a table . Open it, DELETE
the row that contains an RL_test = 0   (remember, it has grouped all
the lines that do not overlap, into this one record!)

now run a query to select from the polylinetab all thos records whos
lineID is NOT in the query result.....

select * from polylinetab where NOT lineid in (select lineid  from
queryX)

Plus....,

I forgot to mention, that because it calculates an overlap, if some of
your lines are semi concordant with the edge lines you can also pick
out these by selecting lines with an RL_test (overlap)  greater or
less than a certain value...(but dontforget....thre will be several
lines with rl_test = 0..NOT just the lineid quoted in the resultin
query!)

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to