MapInfo Pro

 View Only
  • 1.  Distance calculator using exclusionary criteria

    Posted 12-11-2023 12:13

    I've used the distance calculator in MI many times, but this is the first time I need to calculate distance based on an exclusionary criteria. 

    I have a table of stores, each assigned to a district, and I need to calculate the distance from each store to the nearest store in a different district. 

    In the "use the following criteria" section of the distance calculator, is there a way to tell it to ignore the district of itself when there are multiple districts? 

    For example, if I have 80 districts and Store A is in District 1, I need to know the distance to the nearest store in any district 2-80, doesn't matter which district.

    I don't want to run this multiple times if I don't have to. 

    Thanks



    ------------------------------
    Daniel Weber
    CHICO'S
    Fort Myers FL
    ------------------------------


  • 2.  RE: Distance calculator using exclusionary criteria

    Employee
    Posted 01-18-2024 01:47

    The only way I can think of is to do this per district.

    1. Select all records where district is equal to 1
    2. Select all records where district is different from 1
    3. Run the Nearest statement or the Distance Calculator on these two tables.
    4. repeat for all district values

    This is probably something that would benefit from a small script



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------