I have a table of geocoded pupils and a layer with a polygon representing my city boundary. I need to find how many pupils are located 20 miles or more outside of the city boundary.

I've been reading and i think this could possible be achieved by creating a buffer of 20 miles around the city boundary polygon and then using the SQL Select to query the data to find the points within the polygon which would allow me to determine which pupils fall outside of it.

I have calculated points within a polygon before using this method but I've never created a buffer. I would like to know how i can create the type of buffer which would make a polygon which is the same shape as my city but 20 miles distance from each of the nodes.

Is this an approach i should be taking or should i be doing this a different way?


Tom's suggestion will get you there but you could also use your approach and take advantage of the SQL Select.

To do this you'll need to use a Sub Select.

In my example below, I'm expecting you only to have one polygon in your city boundary table.

Select *
Where OBJ Within (Select Buffer(OBJ, 30, 20, "mi") From CITY_BOUNDARY)

If you have more than one boundary in the city boundary table, use this approach instead:

  1. Select the city boundary with the select tool
  2. Run this query:

    Select * 
    From PUPILS 
    Where OBJ Within (Select Buffer(OBJ, 30, 20, "mi") From Selection)

You might be able to get the results you're after by using the Distance Calculator tool. You can add it to the Tools menu through the Tool Manager (Tools > Tool Manager..., then tick 'Load' next to Distance Calculator) - this is for MapInfo 12.5 and earlier, not sure about the newer versions.

Use your city boundary as the origin and select the pupils table as the destination. You'll need to set the parameters at the bottom for the destination criteria to suit your needs but I think this should do the job for you.

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.