select name, Buffer(the_geom, .12) from coastlines where iso_3_code = 'PNG';
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBHZjzvVKLPvRhXZEW0Dqs5TKyA-TZqJwkwf3An4Vqc_jzONI3w_l4HZWVuErqYL8QrR2j9C1qeh3OGP8fK6aEsJL38fNBvw2Tz3maSolthygD4iiLIYFVN2xPqXkwWEpKaIKBVnODOyeF/s400/papua_buffer.png)
After a bit of screwing around, the solution I found is to blow up the MULTIPOLYGON that is Papua New Guinea with ST_Dump, then ST_Buffer each of the individual polygons, and finally return those buffered polygons as a subquery result to the geomunion function. Like this:
SELECT c.name, geomunion(the_geom) FROM (SELECT name, ST_Buffer((ST_Dump(the_geom)).geom, .12) AS the_geom FROM coastlines) c WHERE c.name LIKE 'Papua%' GROUP BY c.name;
The results look like this:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_s96Prp6hCNmhfpqq6k82juR766utvwkdFSCy47XTgdLYBz7yPzpgbjqeokGFRa4FZyNTguIX23NgHtt-ZCl0BOfGPNvyGTEeMDjZyf920WrwybLQ9Ks0ugB2QLp4GAtuCLnta3sdfxcy/s400/correct_papua_buffer.png)
Works, but it doesn't seem like this should be necessary.
No comments:
Post a Comment