10: 2016-05-19 (木) 04:55:48 yuji ソース
Attached file: shape2osm.py
11: 2016-05-23 (月) 01:16:36 yuji ソース
Attached file: hokkaido_s.osm, Attached file: tohoku_s.osm, Attached file: kanto_s.osm, Attached file: chubu_s.osm, Attached file: kinki_s.osm, Attached file: chugoku_s.osm, Attached file: shikoku_s.osm, Attached file: kyushu_s.osm
Line 136: Line 136:
*** 海を青くする [#ze3004e1] *** 海を青くする [#ze3004e1]
-OpenStreetMapの地図データは,海岸線タグ(coastlines)がサポートされなくなってます。Mapsforgeのライブラリではこの海岸線タグで海を青く表示できるようになってます。+OpenStreetMapの地図データは,陸地と海岸の境界のタグ(coastlines)がサポートされなくなってます。Mapsforgeのライブラリではこの陸地と海岸の境界のタグで海を青く表示できるようになってます。
-海岸線がサポートされなくなっちゃったんで,なんとかして海岸線を特定し,海側はkey='natural' value='sea'タグを,陸側はkey='natural' value='nosea'タグを追加する必要があります。+陸地と海岸の境界のタグがサポートされなくなっちゃったんで,海を青く表示するには,なんとかして陸地と海岸の境界を特定し,海側はkey='natural' value='sea'タグを,陸側はkey='natural' value='nosea'タグを追加する必要があります。
このためには,日本の陸地や海の領域を特定する地形データが必要です。~ このためには,日本の陸地や海の領域を特定する地形データが必要です。~
まず,[[OpenStreetMapData>http://data.openstreetmapdata.com]]というサイトから,世界の陸地線のデータである,[[land-polygons-split-4326.zip>http://data.openstreetmapdata.com/land-polygons-split-4326.zip]]ファイルをダウンロードします。~ まず,[[OpenStreetMapData>http://data.openstreetmapdata.com]]というサイトから,世界の陸地線のデータである,[[land-polygons-split-4326.zip>http://data.openstreetmapdata.com/land-polygons-split-4326.zip]]ファイルをダウンロードします。~
 > wget http://data.openstreetmapdata.com/land-polygons-split-4326.zip  > wget http://data.openstreetmapdata.com/land-polygons-split-4326.zip
-zipファイルを解凍すると,land_polygons.shpというShapeフォーマットのデータがあります。これを[[ogr2ogr>http://www.gdal.org/ogr2ogr.html]](Windowsの場合QGISがインストールされていればogr2ogrも使える)というツールを使用して日本の陸地線のShapeデータを取り出します。+zipファイルを解凍すると,land_polygons.shpというShapeフォーマット(外形)のデータがあります。これを[[ogr2ogr>http://www.gdal.org/ogr2ogr.html]](Windowsの場合QGISがインストールされていればogr2ogrも使える)というツールを使用して日本の陸地線のShapeデータを取り出します。
 > ogr2ogr -overwrite -progress -skipfailures -clipsrc 122.560700 21.209920 153.890100 45.802450 japan.shp land-polygons-split-4326/land_polygons.shp  > ogr2ogr -overwrite -progress -skipfailures -clipsrc 122.560700 21.209920 153.890100 45.802450 japan.shp land-polygons-split-4326/land_polygons.shp
その後,&ref(shape2osm.py);を使用して,日本の陸地線データを,japan_ns.osmファイルに変換する。 その後,&ref(shape2osm.py);を使用して,日本の陸地線データを,japan_ns.osmファイルに変換する。
 > python shape2osm.py -l japan_ns -o 10000000 japan.shp  > python shape2osm.py -l japan_ns -o 10000000 japan.shp
-これで,japan_ns.osmが作成される。この時,key='natural' value='nosea'が追加される。+これで,日本の陸地の外形地図データのjapan_ns.osmが作成される。この時shape2osm.pyにより,key='natural' value='nosea'が追加されている。
-日本全体の陸地線データから,北海道,東北,関東,中部,近畿,中国,四国,九州の陸地線データを)を作成しておく。(osmconvertでカットする)+日本全体の外形データから,北海道,東北,関東,中部,近畿,中国,四国,九州の外形データを作成する。これはosmconvertを使用して各場所をカットすることにした。
 > osmconvert japan_ns.osm -B=..\poly\Hokkaido.poly -o=hokkaido_ns.osm  > osmconvert japan_ns.osm -B=..\poly\Hokkaido.poly -o=hokkaido_ns.osm
 > osmconvert japan_ns.osm -B=..\poly\Tohoku.poly -o=tohoku_ns.osm  > osmconvert japan_ns.osm -B=..\poly\Tohoku.poly -o=tohoku_ns.osm
Line 159: Line 159:
 > osmconvert japan_ns.osm -B=..\poly\Kyushu.poly -o=kyushu_ns.osm  > osmconvert japan_ns.osm -B=..\poly\Kyushu.poly -o=kyushu_ns.osm
-海を特定して,key='natural' value='sea'タグを付けるため,以下の内容でjapan_sea.osmをテキストエディタを使って作成する。めんどくさいんで,日本全体を海にしている。 +海を特定した上でkey='natural' value='sea'タグを付けるため,テキストエディタを使って %%japan_s.osmを作成する。めんどくさいんで,日本全体を海にしている。%% &ref(hokkaido_s.osm); &ref(tohoku_s.osm); &ref(kanto_s.osm); &ref(chubu_s.osm); &ref(kinki_s.osm); &ref(chugoku_s.osm); &ref(shikoku_s.osm); &ref(kyushu_s.osm); をそれぞれ作成した。
-&nbsp;<?xml version="1.0" encoding="UTF-8"?> +
- <osm version="0.6">; +
-&nbsp; <bounds minlat="32.3844554" minlon="131.8803602" maxlat="34.6285997" maxlon="134.9868537"/>; +
-&nbsp; <node timestamp="2016-04-29T23:59:59Z" changeset="20000" id="32951459320" version="1" lon="122.560700" lat="21.209920" />; +
-&nbsp; <node timestamp="2016-04-29T23:59:59Z" changeset="20000" id="32951459321" version="1" lon="122.560700" lat="45.802450" />; +
-&nbsp; <node timestamp="2016-04-29T23:59:59Z" changeset="20000" id="32951459322" version="1" lon="153.890100" lat="45.802450" />; +
-&nbsp; <node timestamp="2016-04-29T23:59:59Z" changeset="20000" id="32951459323" version="1" lon="153.890100" lat="21.209920" />; +
-&nbsp; <way timestamp="2016-04-29T23:59:59Z" changeset="20000" id="32951623372" version="1"> +
-  <nd ref="32951459320" />; +
-&nbsp; <nd ref="32951459321" /> +
-  <nd ref="32951459322" /> +
-  <nd ref="32951459323" /> +
-  <nd ref="32951459320" /> +
-  <tag k="area" v="yes" /> +
-  <tag k="layer" v="0" /> +
-  <tag k="natural" v="sea" /> +
-  </way> +
- </osm>;+
-海(japan_s.osm)と海でない陸地部分(xxxx_ns.osm)をマージして,xxxx_sea.osmを作成する。 +海(xxxx_s.osm)と陸地部分(xxxx_ns.osm)をマージして,xxxx_sea.osmを作成しておく。 
- > osmosis --read-xml file="japan_s.osm" --read-xml file="hokkaido_ns.osm" --sort --merge --write-xml file="hokkaido_sea.osm" + > osmosis --read-xml file="hokkaido_s.osm" --read-xml file="hokkaido_ns.osm" --sort --merge --write-xml file="hokkaido_sea.osm" 
- > osmosis --read-xml file="japan_s.osm" --read-xml file="tohoku_ns.osm" --sort --merge --write-xml file="tohoku_sea.osm" + > osmosis --read-xml file="tohoku_s.osm" --read-xml file="tohoku_ns.osm" --sort --merge --write-xml file="tohoku_sea.osm" 
- > osmosis --read-xml file="japan_s.osm" --read-xml file="kanto_ns.osm" --sort --merge --write-xml file="kanto_sea.osm" + > osmosis --read-xml file="kanto_s.osm" --read-xml file="kanto_ns.osm" --sort --merge --write-xml file="kanto_sea.osm" 
- > osmosis --read-xml file="japan_s.osm" --read-xml file="chubu_ns.osm" --sort --merge --write-xml file="chubu_sea.osm" + > osmosis --read-xml file="chubu_s.osm" --read-xml file="chubu_ns.osm" --sort --merge --write-xml file="chubu_sea.osm" 
- > osmosis --read-xml file="japan_s.osm" --read-xml file="kinki_ns.osm" --sort --merge --write-xml file="kinki_sea.osm" + > osmosis --read-xml file="kinki_s.osm" --read-xml file="kinki_ns.osm" --sort --merge --write-xml file="kinki_sea.osm" 
- > osmosis --read-xml file="japan_s.osm" --read-xml file="chugoku_ns.osm" --sort --merge --write-xml file="chugoku_sea.osm" + > osmosis --read-xml file="chugoku_s.osm" --read-xml file="chugoku_ns.osm" --sort --merge --write-xml file="chugoku_sea.osm" 
- > osmosis --read-xml file="japan_s.osm" --read-xml file="shikoku_ns.osm" --sort --merge --write-xml file="shikoku_sea.osm" + > osmosis --read-xml file="shikoku_s.osm" --read-xml file="shikoku_ns.osm" --sort --merge --write-xml file="shikoku_sea.osm" 
- > osmosis --read-xml file="japan_s.osm" --read-xml file="kyushu_ns.osm" --sort --merge --write-xml file="kyushu_sea.osm"+ > osmosis --read-xml file="kyushu_s.osm" --read-xml file="kyushu_ns.osm" --sort --merge --write-xml file="kyushu_sea.osm"
-やっと,陸地は<tag k="natural" v="nosea" />が,海の部分は<tag k="natural" v="sea" />がある地図データが作成できた。(海は日本全体だけど・・・)+やっと,陸地は<tag k="natural" v="nosea" />が,海の部分は<tag k="natural" v="sea" />がある地図データが作成できた。%%(海は日本全体だけど・・・)%%
*** 日本の地図と等高線をマージして完成 [#g8a11fa9] *** 日本の地図と等高線をマージして完成 [#g8a11fa9]

  • PC/地図/Locus map用ベクター地図 のバックアップ一覧
  • PC/地図/Locus map用ベクター地図 のバックアップ差分(No. All)
    • 1: 2015-10-05 (月) 03:52:54 yuji
    • 2: 2015-10-13 (火) 01:12:03 yuji
      • Attached file: del.txt, Attached file: japan.poly, Attached file: japan_map.png
    • 3: 2015-10-13 (火) 05:20:08 yuji
      • Attached file: tags.xml, Attached file: japan_map2.png, Deleted an attach file: del.txt at 2015-10-14 (水) 13:04:46
    • 4: 2015-10-14 (水) 05:05:04 yuji
      • Attached file: del.txt, Deleted an attach file: del.txt at 2015-10-15 (木) 08:33:16
    • 5: 2015-10-15 (木) 02:35:43 yuji
      • Attached file: del.txt, Deleted an attach file: del.txt at 2015-10-15 (木) 10:33:42 at 2015-10-15 (木) 10:35:13, Deleted an attach file: tags.xml at 2015-10-15 (木) 14:54:36
    • 6: 2015-10-15 (木) 08:48:39 yuji
      • Attached file: tags.xml, Deleted an attach file: tags.xml at 2015-10-15 (木) 16:48:20
    • 7: 2015-10-19 (月) 03:14:53 yuji
      • Attached file: Hokkaido.poly, Attached file: Honshu.poly, Attached file: Kyushu.poly, Deleted an attach file: Kyushu.poly at 2015-10-19 (月) 11:12:34, Deleted an attach file: Honshu.poly at 2015-10-19 (月) 11:12:48, Deleted an attach file: Hokkaido.poly at 2015-10-19 (月) 11:13:01, Attached file: hokkaido.poly, Attached file: honshu.poly, Attached file: kyushu.poly, Attached file: shikoku.poly, Deleted an attach file: tags.xml at 2015-11-27 (金) 16:51:58
    • 8: 2015-11-27 (金) 07:52:27 yuji
      • Attached file: tags.xml
    • 9: 2016-02-10 (水) 12:50:41 yuji
      • Attached file: Tohoku.poly, Attached file: Kanto.poly, Attached file: Chubu.poly, Attached file: Kinki.poly, Attached file: Chugoku.poly, Attached file: Hokkaido.poly, Attached file: Shikoku.poly, Attached file: Kyushu.poly, Deleted an attach file: shikoku.poly at 2016-02-10 (水) 21:51:25, Deleted an attach file: kyushu.poly at 2016-02-10 (水) 21:51:52, Deleted an attach file: hokkaido.poly at 2016-02-10 (水) 21:52:09
    • 10: 2016-05-19 (木) 04:55:48 yuji
      • Attached file: shape2osm.py
    • 11: 2016-05-23 (月) 01:16:36 yuji
      • Attached file: hokkaido_s.osm, Attached file: tohoku_s.osm, Attached file: kanto_s.osm, Attached file: chubu_s.osm, Attached file: kinki_s.osm, Attached file: chugoku_s.osm, Attached file: shikoku_s.osm, Attached file: kyushu_s.osm
    • 12: 2016-05-26 (木) 08:00:42 yuji
      • Attached file: tags_0.xml, Deleted an attach file: tags.xml at 2016-05-26 (木) 16:00:29, Attached file: tags.xml
    • 13: 2020-12-26 (土) 15:07:38 yuji
      • Attached file: honshu_s.osm, Attached file: Honshu.poly, Deleted an attach file: tags_0.xml at 2022-03-11 (金) 11:32:49, Deleted an attach file: tags.xml at 2022-03-11 (金) 11:32:53, Deleted an attach file: honshu_s.osm at 2022-03-11 (金) 11:44:19, Deleted an attach file: tohoku_s.osm at 2022-03-11 (金) 11:44:29, Deleted an attach file: kanto_s.osm at 2022-03-11 (金) 11:44:38, Deleted an attach file: chubu_s.osm at 2022-03-11 (金) 11:44:48, Deleted an attach file: kinki_s.osm at 2022-03-11 (金) 11:44:56, Deleted an attach file: kyushu_s.osm at 2022-03-11 (金) 11:45:05, Deleted an attach file: shikoku_s.osm at 2022-03-11 (金) 11:45:14, Deleted an attach file: chugoku_s.osm at 2022-03-11 (金) 11:45:25, Deleted an attach file: hokkaido_s.osm at 2022-03-11 (金) 11:45:35, Deleted an attach file: honshu_s_0.osm at 2022-03-11 (金) 11:50:23, Deleted an attach file: shape2osm.py at 2022-03-11 (金) 12:02:26 at 2022-03-18 (金) 07:51:26 at 2022-03-18 (金) 15:37:00 at 2022-03-22 (火) 13:24:43, Deleted an attach file: yuji_theme.zip at 2022-03-22 (火) 16:37:46, Deleted an attach file: yuji.zip at 2022-03-24 (木) 09:37:21 at 2022-03-24 (木) 10:34:56 at 2022-03-24 (木) 17:47:31 at 2022-03-24 (木) 18:16:43 at 2022-03-24 (木) 22:04:07 at 2022-03-25 (金) 15:51:22 at 2022-03-25 (金) 16:06:18 at 2022-03-25 (金) 16:14:48 at 2022-03-25 (金) 16:23:33 at 2022-03-25 (金) 16:40:05, Deleted an attach file: poi-mapping.xml at 2022-03-26 (土) 17:16:56
    • 現: 2022-03-28 (月) 22:52:43 yuji
      • Deleted an attach file: yuji.zip at 2022-04-05 (火) 17:57:26 at 2022-04-13 (水) 14:13:11 at 2022-04-13 (水) 14:42:40 at 2022-04-13 (水) 17:12:40 at 2022-04-14 (木) 10:42:26 at 2022-04-14 (木) 16:37:52 at 2022-04-14 (木) 17:12:03 at 2022-04-14 (木) 17:23:52 at 2022-04-15 (金) 09:09:56 at 2022-04-15 (金) 09:58:18, Deleted an attach file: tags.xml at 2022-04-15 (金) 16:13:22 at 2022-04-16 (土) 07:03:27 at 2022-04-17 (日) 09:45:09 at 2022-04-18 (月) 21:44:02 at 2022-04-19 (火) 13:00:54 at 2022-04-20 (水) 09:13:15 at 2022-04-21 (木) 10:48:22 at 2022-04-21 (木) 16:19:59 at 2022-04-21 (木) 16:47:32, Deleted an attach file: poi-mapping.xml at 2022-04-22 (金) 11:05:32 at 2022-04-29 (金) 16:23:58 at 2022-04-29 (金) 16:24:41 at 2022-04-29 (金) 16:41:09, Deleted an attach file: tagfilter.txt at 2022-04-29 (金) 17:20:13 at 2022-04-29 (金) 17:58:47 at 2022-04-29 (金) 18:15:10 at 2023-06-28 (水) 10:21:51 at 2023-06-30 (金) 12:17:43 at 2023-06-30 (金) 12:39:41 at 2023-06-30 (金) 16:09:41 at 2023-07-01 (土) 07:05:30 at 2023-07-03 (月) 15:49:19 at 2023-07-03 (月) 16:20:37 at 2023-07-04 (火) 10:29:36 at 2023-07-04 (火) 15:54:19 at 2023-07-07 (金) 07:12:56 at 2023-07-14 (金) 06:45:58 at 2023-07-14 (金) 14:24:10 at 2023-07-22 (土) 12:23:39 at 2023-07-26 (水) 13:15:09, Deleted an attach file: osmctools.zip at 2023-07-26 (水) 14:11:07 at 2023-08-09 (水) 15:30:16 at 2023-08-09 (水) 17:05:57, Deleted an attach file: init.sql at 2023-08-10 (木) 14:33:36 at 2023-08-10 (木) 14:34:21 at 2023-08-15 (火) 20:04:38 at 2023-08-15 (火) 21:02:58 at 2023-08-15 (火) 21:12:29 at 2023-08-16 (水) 08:46:41 at 2023-08-16 (水) 08:47:25 at 2023-08-16 (水) 15:44:09 at 2023-08-16 (水) 16:02:12 at 2023-08-16 (水) 16:09:19 at 2023-09-08 (金) 07:16:17 at 2023-09-08 (金) 07:17:22 at 2023-09-08 (金) 08:14:22

トップ   差分 バックアップ 複製 名前変更 リロード   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ   最新ページのRSS 1.0 最新ページのRSS 2.0 最新ページのRSS Atom
Counter: 4322, today: 4, yesterday: 6