The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Ushant Suman (23) [Avatar] Offline
#1
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
#2
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.