MapInfo Pro

 View Only
  • 1.  Duplicate polygons with varying values

    Posted 06-12-2023 15:44

    I have lots of polygons (triangles) each with a unique ID.  There are many duplicate polygons with each one having a value which represents water depth.  I'd like to create a gis layer having the maximum value for each triangle and retain the trianglecreating a new max value/polygon layer. Any help appreciated. Thanks M



    ------------------------------
    Michael W
    Knowledge Community Shared Account
    ------------------------------


  • 2.  RE: Duplicate polygons with varying values

    Employee
    Posted 06-13-2023 01:29

    Do the duplicate polygons have the same ID or other value that can help you identify which polygons are "the same"?



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



  • 3.  RE: Duplicate polygons with varying values

    Posted 06-13-2023 03:02

    Hi Peter,

    Thanks for your interest. The duplicate polygons have the same ID. I did try using an Sql to group and aggregate which does find max for each ID but the geometry gets lost. Any help appreciated.  Thanks. M



    ------------------------------
    Michael W
    Knowledge Community Shared Account
    ------------------------------



  • 4.  RE: Duplicate polygons with varying values
    Best Answer

    Employee
    Posted 06-13-2023 03:33

    Okay, it seems you are on the right track, Michael :-)

    Now if you can take the easy way depends on your version of MapInfo Pro.

    If you are using MapInfo Pro v2019 or newer, you can add the AggregateCombine() aggregate to your list of columns to include. This will merge the polygons from the records with the same IDs and so keep the geometry when doing a Group By.

    The query will look like this:

    Select ID, Max(WaterDepth) "WaterDepth", AggregateCombine(OBJ)
       From MEASUREMENTS
       Group By ID

    If you are using an older version of MapInfo Pro, you'll have to save the result from the Group By and we then have to find a way to get the polygon added back onto the non-mappable records. For now, I hope you are on a more recent version of MapInfo Pro - fingers crossed :-)



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



  • 5.  RE: Duplicate polygons with varying values

    Posted 06-13-2023 07:10

    Hi Peter,

    This worked perfectly and I am really grateful for your help.  Thank you. M



    ------------------------------
    Michael W
    Knowledge Community Shared Account
    ------------------------------