Query to output all adjacent regions from a geographic layer in MapInfo

250 views
Skip to first unread message

Will Ferguson

unread,
Nov 13, 2016, 7:27:24 AM11/13/16
to MapInfo-L
HI,

I was wondering if there's a way to output all adjacent regions from all regions recursively in MapInfo? Basically, I have a zipcode file with shapes, and I'm trying to output a file that lists all origin zips and "touching" zip pairs for analysis.

Will

Peter Horne

unread,
Nov 13, 2016, 4:24:49 PM11/13/16
to MapInfo-L
Hi Will,

Try with an SQL statement like -

Select *
From ZipCodeFile
where ZipCodeFile.obj intersects ZipCodeFile.obj andZipCodeNumber <> ZipCodeNumber
Into ZipcodeTouching

Thanks
Peter H

Peter Horne

unread,
Nov 13, 2016, 5:05:01 PM11/13/16
to MapInfo-L
Hi again Will,
Apologies,

it seems that you have to save a copy of your ZIpCodeFile, let's call it ZipCodeFile2
Then run the SQL statement

From ZipCodeFile, ZipCodeFile2
where ZipCodeFile.obj intersects ZipCodeFile2.obj andZipCodeNumber <> ZipCodeNumber2
Into ZipcodeTouching

Thx

Tony Pilkington

unread,
Nov 15, 2016, 10:57:16 AM11/15/16
to mapi...@googlegroups.com
This does quite a lot of what you need. It breaks groups of adjoining polygons into polylines with the 2 adjacent county names as fields, and the lengths of common polylines.
If a linework output region is set to –1, then it means sea or estuary.
I have provided a test set of English counties, the mbx and the code ( if you need to tweak or adapt it).
First run; load up counties map and select all of them.
Press left button and;
Indicate on the dialog which field to use as identifier...County.
Set the match value as 1m (max)
Identify the output table.
 
Analyse the output table (Linework)
 
Good Luck
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7859 / Virus Database: 4664/13403 - Release Date: 11/13/16

Polygon Components.zip

Will Ferguson

unread,
Nov 17, 2016, 8:54:16 AM11/17/16
to MapInfo-L
Perfect, I was able to output exactly what I needed with this and manipulate in access from there.

Will Ferguson

unread,
Nov 17, 2016, 9:05:30 AM11/17/16
to MapInfo-L, a.j.pil...@talk21.com
Awesome! Thanks!
Reply all
Reply to author
Forward
0 new messages