[GIS] Create collection from selected objects

mapbasicmapinfo

I have a table with a series of objects in it. Each record has a reference number but these numbers are NOT unique – e.g. there are two records with reference "01" and each of them has a different object attached.

I would like to combine all objects with the same reference number into a collection object so that I can attach these collection objects to a different table. I should end up with one row per reference number with no duplicates and without losing any of the objects.

I could use "Objects combine" but this will do a geographic union which is not appropriate – some sites are subsections of sites with the same reference number.

The documentation for the "Create collection" statement only shows it being used to create objects.

Best Answer

I thought you might be able to do it using SQL, but it seems Mapinfo doesn't allow you to combine geometries using SQL - Manifold, which I've also used, does.

One way may be to convert the table file into a database (SQLite or PostGIS), possibly using QGIS and then perform an aggregate ST_Collect query grouping by reference number

Related Question