I have two polygon layers. One is All_India_Locality layer which has attributes:{Locality_ID,Locality_Name} and the other is All_India_Pincode layer which has attributes:{Pincode,City}
I want to find all the pincodes that are overlapping the localities. So my output should be a table which has attributes:{Locality_ID,Locality_Name,Pincode}.
There's one catch theat pincodes which are just sharing boundaries with the localities should not be selected. (Therefore intersect query won't work)
Example: For the highlighted locality "8781", only Pincode "574105" should be displayed in Pincode column as it overlaps the locality "8781". Pincodes "576107" and "574118" should not be displayed as they are sharing the boundary.
If localities are overlapped by multiple pincodes, then multiple records of same locality should be present.
I am using mapinfo. One workaround I found for this query is that I split the localities layer with pincodes layer and then updated the Pincode column with pincode values from pincode layer using query "Pincode.obj contains Localities.obj"
Is there any other way?
Best Answer
I'm assuming that a locality object is only covered by one pincode object, right?
You can do this in three steps:
Let's try:
First you need to add a column for the pincode to the Locality table
Next we are joining the two tables
Notice that the I have included multiple columns in the result. That's so that you better can see if it looks correct. Also note that I have used a tolerance of 100 sq m to determine whether a locality object is covered by a pincode object. This should remove those that only share a common boundary.
Now you can update the pincode on the Locality layer with the pincode from the Pincode layer using the query result