4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

複数の polygon 領域の結合(geojsonファイル)

Last updated at Posted at 2016-03-12

こんにちは。
geojsonファイルの中の複数の polygon 領域を結合(dissolve, union, merge)させました。ogr2ogr コマンド(GDAL)を使っています(処理結果は dissolved.json となります)。

$ ogr2ogr -f GeoJSON -explodecollections dissolved.json two_rectangles.json -dialect sqlite -sql "select ST_Union(geometry) as geometry from OGRGeoJSON"
dissolved.jpg

この処理前ファイルは、

two_rectangles.json
{"type":"FeatureCollection","features":[
 {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-98.4,43.9],[-98.4,44.9],[-95.5,44.9],[-95.5,43.9],[-98.4,43.9]]]}},
 {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-97.9,44.4],[-97.9,45.4],[-95.0,45.4],[-95.0,44.4],[-97.9,44.4]]]}}]}
4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?