Ushant Suman (23) [Avatar] Offline
In listing 11.1 I am facing difficulty in understanding the output of the query.Only Brisbane and San Francisco we are able to dissolve boundaries and able to combine in single multi polygon .It is due to only these multipolygons have a sharing bounday common.I am not sure please help??
regina.leo (265) [Avatar] Offline
Imagine you have a district like a state composed of 2 or more polygons that none of them touch each other at all. Like for example the islands of Hawaii and you store each of those polygons as a separate record.

Now you want to combine into a single record by unioning all the polygons.
When you union them, you will have a single multipolygon consisting of the same number of polygons as you had rows before because none of the polygons touched each other. But you'll have one row.

Now imagine a district (like the figure in 11.1 and 11.2) the boroughs of New York city. You'll start off with 5 rows (one for each borrough).
However since the borroughs touch each other, when you ST_Union them (the union operation will collapse the boundaries of each polygon into the adjacent touching ones) so that you end up with fewer polygons than what you started with.