[GIS] MapInfo: How to get the population contained within 2 geographical tables

attribute-joinsmapinfo

I using 3 different tables which are also geographical objects:

  • population data; points on the map representing inhabitants (1 or more)
  • region data; the map is divided in regions
  • coverage data; it contains several coverage areas overlapping or not

What I am searching for is: What is the percentage of people covered by a certain coverage area in a certain region?

I tried several things but nothing worked, for example with SQL select I tried:

Select Columns: Regions.name, CoverageArea.name, Sum(Population.inhabitants)

from Tables: Regions, CoverageArea, Population

where Condition: Regions.obj Contains Population.obj And CoverageArea.obj Contains Population.obj

Group by Columns: 1, 2

Order by Columns: 1, 2

into Table Named: Selection

"And I get Incorrect tables are joined. Invalid join condition in WHERE clause."

Hope I was clear enough :s

** edit **

Few tests I did. I can't understand why the thrid SQL query doesn't work…

Population per coverage area

Population per region

Trying to get population per region and coverage area

Error message

Best Answer

I know you can join at least three tables using alfanumerical values, but I have never tried doing it using a spatial join.

But you need to make sure that your join matches the order of the tables:

where table1.some_column = table2.some_column
and table2.some_column = table3.some_column

The same properly is true if you are using a spatial join:

where table1.obj Intersects table2.obj
and table2.obj Intersects table3.obj