1

I have a dataset of address points with their associated street name, in addition to a tab file of polygons covering a catchment. I want to know if there is a way of selecting polygons which have address points with different street names within them.

I am guessing that there is a way of using the count function in MapInfo but unsure how this works with character fields.

1

The MapBasic SQL dialect is rather restricted, but this is possible by using several temporary tables. Assuming that the Points table has a column StreetName, and that the Catchments table has a unique ID value, these three SQL statements should work (enter them into the MapBasic window):

Select ID, StreetName 
   From Points, Catchments 
   Where Points.obj intersects Catchments.obj 
   Into temp noselect 
   Group By ID, StreetName
select ID, count(*) 
   from temp 
   into temp2 noselect 
   Group By ID
Select * 
   From Catchments 
   Where ID in (select ID from temp2 where count > 1)
  • I would use Within instead of Intersects as you are comparing points to polygons. But besides that, nice workaround for the limitations of the MapBasic SQL – Peter Horsbøll Møller Nov 22 '18 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.