Subscribe to this thread
Home - General / All posts - Dissolve in M9
HMS25 post(s)
#22-Nov-19 13:22

Is there any transform available in M9 that "dissolves away" or removes the borders between areas that have identical values in data attribute fields" similar to the M8 "Drawing - Dissolve" dialog?

Dimitri


5,611 post(s)
#23-Nov-19 07:56

The Release 8 Dissolve dialog works with only one field at a time. There are two approaches to that in 9:

When you only care about one value, you can take a point-and-click approach using the Select and Transform panes. Suppose you have a drawing showing US states as areas, but the drawing has all the islands for the state of Maine as separate areas. Instead of just one record for Maine that is a branched area, there are a zillion records with "Maine" in the Name field for the various islands. You want to combine them all into a single area. That's easy:

1. Use the Select pane, Text Contains, to select all objects/records with Maine in the Name field. 2. In the Transform pane check the Restrict to Selection box, and then do the Union Areas transform. Use the Options button to combine fields however you like in the output.

Suppose you want to do the above automatically for all of the US states at once, so all the areas with "Massachusetts" in the Name field get combined into one area, all the areas with "New Hampshire" get combined into one and so on? For that you use a snippet of SQL, as described in the SQL Example: Learning to Union Areas in SQL from Edit Query topic.

That's a teaching topic, so it goes into detail about how to use Edit Query to learn to do such things in a step by step way. But the way an experienced user would do it, given in the Notes at the end of the topic, boils down to a very short bit of SQL. Taking the snippet from the topic and adapting it if we had a States table with a Name field for each state, and we wanted to populate a "States Union" table:

INSERT INTO [States Union Table] (

  [Name],

  [Geom]

SELECT

  First([Name]),

  GeomUnionAreas([Geom])

FROM [States Table] GROUP BY [Name];

The above is the part that does the trick, without the extra infrastructure of creating a new drawing / table / etc. You can do that easily enough without SQL, using Create - New Table with two fields in it, a Name text field and a Geom geom field.

bdg54 post(s)
#23-Nov-19 19:04

Thanks, this is something that I can use.

HMS25 post(s)
#24-Nov-19 17:11

Thanks for the explanation. The example is very elucidative and the SQL snippet works great.

Manifold User Community Use Agreement Copyright (C) 2007-2019 Manifold Software Limited. All rights reserved.