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
Line 1: Line 1:
* Locus Map [#rfc076d7] * Locus Map [#rfc076d7]
-Locus Mapは,Android端末で動作するGPS地図アプリケーション。無料版の[[Locus Map>https://play.google.com/store/apps/details?id=menion.android.locus]]と有料版の[[Locus Map Pro>https://play.google.com/store/apps/details?id=menion.android.locus.pro]]がある。+Locus Mapは,Android端末で動作するGPS地図アプリケーション。無料版の[[Locus Map>https://play.google.com/store/apps/details?id=menion.android.locus]]と有料版の[[Locus Map Pro>https://play.google.com/store/apps/details?id=menion.android.locus.pro]]がある。03/15/2021にLocus Mapの後継だと思われる[[Locus Map 4>https://www.locusmap.app/locus-map-4-is-here-enjoy-its-first-release/]](有料機能は,SilverとGoldのサブスクリプションになった)がリリースされた。
 +Locus Map/Locus Map Proは,~
- 多くのオンライン地図,オフライン地図に対応。~ - 多くのオンライン地図,オフライン地図に対応。~
OpenStreetMapベースのベクター地図も使用できる。ベクター地図は,Mapsforge形式が使用でき,ファイルサイズが小さい。国土地理院のGSI Mapsにも対応。自分で作成した地図も利用できる。~ OpenStreetMapベースのベクター地図も使用できる。ベクター地図は,Mapsforge形式が使用でき,ファイルサイズが小さい。国土地理院のGSI Mapsにも対応。自分で作成した地図も利用できる。~
オンライン地図はキャッシュすることが出来,キャッシュ済みの場合はモバイル通信しなくても表示できる。~ オンライン地図はキャッシュすることが出来,キャッシュ済みの場合はモバイル通信しなくても表示できる。~
 +地図を重ねて表示もできる。~
- 各国語表示・音声出力対応。もちろん,日本語表示・日本語音声OK。~ - 各国語表示・音声出力対応。もちろん,日本語表示・日本語音声OK。~
- 地図表示が高速。~ - 地図表示が高速。~
ベクター地図では,スクロールしたりしても全くストレスがない。 ベクター地図では,スクロールしたりしても全くストレスがない。
 +- ベクター地図の表示をThemeでカスタマイズできる。~
- オフラインPOI,お気に入りポイント対応,Googleプレイス,ウィキペディア検索も出来る。~ - オフラインPOI,お気に入りポイント対応,Googleプレイス,ウィキペディア検索も出来る。~
-オフラインPOIデータは,SQLite形式な独自DBフォーマット(公開していない)なデータ。LoMap(Lucasストアでの有料のベクター地図)を購入すると,このオフラインPOIファイルがついてくる。~+オフラインPOIデータは,SQLite形式な独自DBフォーマット(公開していない)なデータ。LoMaps(Lucasストアでの有料のベクター地図)を購入すると,このオフラインPOI DBファイルがついてくる。~
- トラックの保存やインポート機能。~ - トラックの保存やインポート機能。~
GPSロガーとしても使用可能。時刻・標高付きGPXファイルを保存・インポート機能。~ GPSロガーとしても使用可能。時刻・標高付きGPXファイルを保存・インポート機能。~
Line 16: Line 19:
カーナビ,自転車,徒歩ナビ。ポイントへの接近通知対応。~ カーナビ,自転車,徒歩ナビ。ポイントへの接近通知対応。~
- 等高線や起伏データの表示。~ - 等高線や起伏データの表示。~
-- 座標,連絡先検索が可能。+- 座標,住所,連絡先検索が可能。
-LoMapのオフラインPOIデータを利用したオフラインの住所検索(市や町名で検索)機能もあるが,日本のOpenStreetMap自体に町名や番地などが入っているのが稀なため,ほとんど使えない。+LoMapsのオフラインPOI DBを利用したオフラインの住所検索(市やストリート名で検索)機能もあるが,日本のOpenStreetMapの住所情報にストリート名(日本では町名や番地などになる)が入っているのが稀なため,ほとんど使えない。~ 
 +住所検索には[[GeoNames>http://www.geonames.org/]]のデータを使ってオフライン検索もできる。~
- ジオキャッシングで使いやすい機能搭載。 - ジオキャッシングで使いやすい機能搭載。
 +- ダッシュボード機能がある。~
 +サイクルコンピュータのような表示が出来る。~
- プラグインで機能が追加できる。~ - プラグインで機能が追加できる。~
- BluetoothやANT+センサーとの接続対応。 - BluetoothやANT+センサーとの接続対応。
Line 25: Line 31:
のような機能・特徴があり,非常に使いやすい地図アプリ。Locus Map Proを購入して使用している。~ のような機能・特徴があり,非常に使いやすい地図アプリ。Locus Map Proを購入して使用している。~
-*Locus Map用の地図 [#veb1f176] +* Locus Map用の地図 [#veb1f176] 
-[[Locus Map>http://www.locusmap.eu/]]で使用できるベクター日本地図は,Locus Mapアプリで,Lucusストアからダウンロード購入出来る。Locusストアでは,ベクター地図をLoMapsと呼んでいるようだ。Locus Map Free(無料版)でもファイル3個までは無料でダウンロードして使用することが出来るが,日本全体をカバーするにはファイル4個ダウンロードしないとダメ。+[[Locus Map>http://www.locusmap.eu/]]でオフラインで使用できるベクター日本地図は,Locus Mapを使ってLucusストアからダウンロード購入出来る。Locusストアでは,ベクター地図をLoMapsと呼んでいるようだ。Locus Map Free(無料版)でもファイル3個までは無料でダウンロードして使用することが出来るが,日本全体をカバーするにはファイル4個ダウンロードしないとダメ。
以前,実はLocusストアのベクター日本地図はところどころデータが破損していて,正常に地図が表示されない問題があった。 :cry:  ~ 以前,実はLocusストアのベクター日本地図はところどころデータが破損していて,正常に地図が表示されない問題があった。 :cry:  ~
このことを報告した後,''2015/12月以降のダウンロード出来る地図は問題が修正されているので,その後は問題はなく使用できている。'' このことを報告した後,''2015/12月以降のダウンロード出来る地図は問題が修正されているので,その後は問題はなく使用できている。''
-また,Locusストアから有償でダウンロードするベクター日本地図は,概ね3ヶ月後に地図が更新されるのだが,この時は再度お金を払って(日本全部で200円程度だが)ダウンロードする必要がある。(上記の正常に表示されない地図からのバージョンアップでもお金を払ったことがあったが,不具合があったベクター地図を更新するのにも有料なのは納得出来なかったなぁ。)+また,Locusストアから有償でダウンロードするベクター日本地図は,概ね3ヶ月毎に地図が更新されるのだが,この時は再度お金を払って(日本全部で200円程度だが)ダウンロードする必要がある。(上記の正常に表示されない地図からのバージョンアップでもお金を払ったことがあったが,不具合があったベクター地図を更新するのにも有料なのは納得出来なかったなぁ。)
-LoMapsをダウンロードすると,オフラインで使えるPOI DBや住所DBが合わせてダウンロード出来るので,有用ではある。(抱き合わせ販売・・・)+LoMapsをダウンロードすると,オフラインで使えるPOI DBや住所DBが合わせてダウンロード出来るので,有用ではある。(抱き合わせ販売・・・)
 +オフラインPOI DBのフォーマット仕様は公開してもらいたいなぁ。
-[[Locus Map>http://www.locusmap.eu/]]でフリーで使用できるベクター日本地図がどこかにないのか探すと,以下からダウンロードして使用できた。+** 無料で使用できるベクター地図 [#eeb18e6d] 
 +[[Locus Map>http://www.locusmap.eu/]]でフリーで使用できるベクター日本地図がどこかにないのか探してみると,以下からダウンロードして使用することができた。
-''[[Mapsforge Download Server>http://download.mapsforge.org/]]''~+- ''[[Mapsforge Download Server>http://download.mapsforge.org/]]''~
[[OpenStreetMap>http://www.openstreetmap.org/]]から変換した日本全体のベクター地図がダウンロード出来て,Locus Mapでもそのまま使用できる。~ [[OpenStreetMap>http://www.openstreetmap.org/]]から変換した日本全体のベクター地図がダウンロード出来て,Locus Mapでもそのまま使用できる。~
残念ながら,このMapsforgeの地図には等高線データは含まれていない &worried;  また,更新頻度は1~2ヶ月ぐらいなので,常に最新とは限らない。~ 残念ながら,このMapsforgeの地図には等高線データは含まれていない &worried;  また,更新頻度は1~2ヶ月ぐらいなので,常に最新とは限らない。~
-それと,日本語ではなく英語表示になります。 +それと,日本語ではなく英語表示になります。~ 
- +- %%''[[locusvectormaps>http://www.locusvectormaps.com/]]''%%~ 
-''[[locusvectormaps>http://www.locusvectormaps.com/]]''~+%%OpenStreetMapから変換した日本全体のベクター地図がダウンロード出来る。%%~ 
 +%%残念ながら,こちらも等高線データは含まれていない &worried;  更新頻度は毎月1回程度されていて,日本語で表示される。%%~ 
 +%%問題としては,海が青く表示されない &worried; %% 
 +- [[vector.city>https://vector.city/]]~ 
 +OpenStreetMapから変換した日本のベクター地図がダウンロード出来る。locusvectormapsの後継サイトのようだ。~ 
 +ダウンロードできる日本のベクター地図は,ファイルが正常に作成出来ていないか破損しているファイルだった。~ 
 +- ''[[OpenAndroMaps>http://www.openandromaps.org/en/]]''~
OpenStreetMapから変換した日本全体のベクター地図がダウンロード出来る。~ OpenStreetMapから変換した日本全体のベクター地図がダウンロード出来る。~
-残念ながら,こちらも等高線データは含まれていない &worried; 更新頻度は毎月1回程度されていて,日本語で表示される。+しかもこのデータは,SRTMのデータから作成された20mの等高線がバッチリ入っています。(いくつかのヨーロッパの地図では10mの等高線が入っている。)嬉しいことに,日本語で表示するベクター地図もあります。(一時期,日本語対応のベクター地図は削除されていたんだけど復活している。ダウンロードする時Multilingual Mapを選べは日本語が入っているベクター地図をダウンロードできる。)~ 
-問題としては,海が青く表示されない &worried;+しかも2020/07ぐらいから,Locus Mapで使用できるオフラインPOIデータもサポートされた :D ~ 
 +この日本全体のベクター地図は一つの地図ファイルで分割はされていないので,Locus Mapで複数の地図にまたがる検索などの問題が起きないので嬉しい。''これを無料で提供されているのには頭が下がります。'' 少しですが感謝したく寄付しました。~ 
 +更新頻度は3ヶ月ぐらい。~ 
 +- [[AndroidMaps>https://www.androidmaps.co.uk/]]~ 
 +OpenStreetMapから変換した日本のベクター地図がダウンロード出来る。~ 
 +残念ながら,このベクター地図には等高線データは含まれていない &worried; 日本語での表示はOK。
 +- [[Kurviger>https://download.kurviger.de/]]~ 
 +OpenStreetMapから変換した日本のベクター地図がダウンロード出来る。~ 
 +[[Kurviger>https://kurviger.de/en]]はオートバイ用の経路検索アプリで,Mapsforge Map Writer Pluginの開発者が共同開発している。[[Androidアプリ>https://play.google.com/store/apps/details?id=gr.talent.kurviger]]もある。このアプリで利用するベクター地図を提供しているようだ。~ 
 +残念ながら,このベクター地図には等高線データは含まれていない &worried; 日本語での表示はOK。~
-''[[OpenAndroMaps>http://www.openandromaps.org/en/]]''~ 
-OpenStreetMapから変換した日本全体のベクター地図がダウンロード出来る。~ 
-しかもこのデータは,SRTMのデータから作成された等高線(20m)がバッチリ入っています。嬉しいことに,日本語で表示するベクター地図もあります。(一時期,日本語対応のベクター地図は削除されていたんだけど,また復活している。ダウンロードする時Multilingual Mapを選べは日本語が入っているベクター地図をダウンロードできる。)~ 
-通常は,このベクター地図を利用すれば問題はありません。しかし更新頻度は,上記のMapsforgeよりも遅い。更新頻度がもう少し上がってくれればいいんだけどな!~ 
-ところどころ(ローマ字)表記も残っています。ただ,これはOpenStreetMapの登録がローマ字入りになっているからなんだけど。 
-上記のサイトから提供されているOpenStreetMapベースのベクター地図が利用は出来るが,OpenStreetMapは自分で自由に地図を編集出来るのが楽しくていいわけです。自分で編集したら,すぐそのデータを使いたくなっちゃいます。~ +通常は,OpenAndroMapsのベクター地図を利用すれば問題無いと思う。更新頻度が上記のMapsforgeよりも遅いのが残念。更新頻度がもう少し上がってくれればいいんだけどな!~
-そこで,OpenStreetMapの地図データからLocus Mapで使用できるベクター地図(.mapファイル)を自前で作成することにした。+
-**OpenStreetMapから日本の地図を作成 [#nb5b0177] +ところどころ(ローマ字)表記されるところがある。ただ,これはOpenStreetMapの登録がローマ字入りになっているからなんだけど。
-まず,[[このページ>/PC/地図/OpenStreetMap]]に書いてあるようにして,日本の地図データを用意する。~ +
-これを[[Locus Map>http://www.locusmap.eu/]]が表示できるベクター地図(mapsforgeライブラリで出力した地図)に変換して作成する。~ +
-日本全体の地図データは大きなファイルになってしまって,ツールを使っての処理も大変時間がかかってしまうので,幾つかに分けたほうが良いかも。Locusストアで提供されている日本地図も4個に分けられている。OsmAndでは8個に分けられている。そこで同じように4個に分けてみた。+
-.pbfファイルはバイナリデータに圧縮したファイルなんで,[[osmconvertツール>http://wiki.openstreetmap.org/wiki/Osmconvert]]を使ってosmfilterで編集出来るように.o5mファイルに変換した後,4個(北海道,本州,四国,九州)に分割する。~ +* OpenStreetMapから日本のベクター地図を作成 [#nb5b0177] 
-//本州を一つにするとメモリ使用量が大きくなってしまい,うまく作成できなくなっちゃったんで((osmconvertを64bitでコンパイルすればメモリ不足にならないかも。)),北海道,東北,関東,中部,近畿,中国,四国,九州の8個に分割することにした。 +上記のサイトから提供されているOpenStreetMapベースのベクター地図をダウンロードして利用は出来るが,地図が必ずしも最新ではないことがある。OpenStreetMapは自分で自由に地図を編集出来るのが楽しい。自分で編集したら,すぐそのデータを使いたくなっちゃいます。~ 
-//分割するため,各polyファイルを作成した。( &ref(Hokkaido.poly); &ref(Tohoku.poly); &ref(Kanto.poly); &ref(Chubu.poly); &ref(Kinki.poly); &ref(Chugoku.poly); &ref(Shikoku.poly); &ref(Kyushu.poly); )~ + 
-分割するため,各polyファイルを作成した。( &ref(Hokkaido.poly); &ref(Honshu.poly); &ref(Shikoku.poly); &ref(Kyushu.poly); )~ +そこで自前でOpenStreetMapの地図データからLocus Mapで使用できるベクター地図(.mapファイル)を作成することにした。 
-この[[polyファイル>http://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format]]は,地図のエリアを緯度・経度の情報で指定する目的で使用されます。 + 
-// > osmconvert japan-latest.osm.pbf -o=japan-latest.o5m +まず,[[このページ>/PC/地図/OpenStreetMap]]に書いてあるようにして,最新の日本の地図データ(japan-latest.osm.pbf)を用意する。 
-// > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Hokkaido.poly -o=hokkaido.o5m + 
-// > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Tohoku.poly -o=tohoku.o5m +この日本の地図データを[[Locus Map>http://www.locusmap.eu/]]が表示できるベクター地図(mapsforgeライブラリで出力した地図)に変換する。 
-// > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Kanto.poly -o=kanto.o5m + 
-// > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Chubu.poly -o=chubu.o5m +日本全体の地図データは大きなファイルになってしまって,ツールを使っての変換処理も大変時間がかかってしまうのと,PCに多くのメモリーを搭載していないと((おそらく日本全体の場合は32GBのメモリを搭載する必要がある。))処理が途中でメモリ不足で停止してしまう。なので幾つかの小さい地域に分けたほうが良い。~ 
-// > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Kinki.poly -o=kinki.o5m + 
-// > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Chugoku.poly -o=chugoku.o5m +Locusストアで提供されているLoMaps日本地図も,北海道・本州・四国・九州の4個に分けられている。OsmAnd/OsmAnd+では,北海道・東北・関東・中部・近畿・中国・四国・九州の8個に分けられている。 
-// > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Shikoku.poly -o=shikoku.o5m + 
-// > osmconvert --complex-ways japan-latest.osm -B=..\poly\Kyushu.poly -o=kyushu.o5m +そこで,OsmAnd/OsmAnd+と同じように北海道・東北・関東・中部・近畿・中国・四国・九州の8個と本州に分けて作成してみた。 
-// > osmconvert japan-latest.osm.pbf -o=japan-latest.o5m+ 
 +** 日本の地図データを小さい領域に分割する [#qbf44137] 
 +日本全体の地図データを北海道・東北・関東・中部・近畿・中国・四国・九州,といった8個の.pbfファイル,もしくは北海道・本州・四国・九州の4個の.pbfファイルに分割する。(北海道・四国・九州は共通) 
 + 
 +日本全体の地図を8個(or 4個)に分割するため,領域を定義したpolyファイルを作成した。( &ref(Hokkaido.poly); &ref(Tohoku.poly); &ref(Kanto.poly); &ref(Chubu.poly); &ref(Kinki.poly); &ref(Chugoku.poly); &ref(Shikoku.poly); &ref(Kyushu.poly);&ref(Honshu.poly);)~ 
 +この[[polyファイル>http://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format]]は,地図のエリアを緯度・経度の情報で指定する目的で使用出来る。~ 
 + 
 +日本全体の地図データを単純に8個(or 4個)に分割する場合は以下のようにする。~ 
 + > cd jpmap 
 + > osmconvert --complex-ways japan-latest.osm.pbf -B=..\poly\Hokkaido.poly -o=hokkaido.osm.pbf 
 + > osmconvert --complex-ways japan-latest.osm.pbf -B=..\poly\Tohoku.poly   -o=tohoku.osm.pbf 
 + > osmconvert --complex-ways japan-latest.osm.pbf -B=..\poly\Kanto.poly   -o=kanto.osm.pbf 
 + > osmconvert --complex-ways japan-latest.osm.pbf -B=..\poly\Chubu.poly   -o=chubu.osm.pbf 
 + > osmconvert --complex-ways japan-latest.osm.pbf -B=..\poly\Kinki.poly   -o=kinki.osm.pbf 
 + > osmconvert --complex-ways japan-latest.osm.pbf -B=..\poly\Chugoku.poly -o=chugoku.osm.pbf 
 + > osmconvert --complex-ways japan-latest.osm.pbf -B=..\poly\Shikoku.poly -o=shikoku.osm.pbf 
 + > osmconvert --complex-ways japan-latest.osm.pbf -B=..\poly\Kyushu.poly   -o=kyushu.osm.pbf 
 + > osmconvert --complex-ways japan-latest.osm.pbf -B=..\poly\Honshu.poly  -o=honshu.osm.pbf 
 +分割するのにオブジェクト・タグが境界にまたがっている場合,そのまま分割するとオブジェクト・タグが落ちてしまう場合があるので,--complex-waysをつけている。(4個に分割する場合は,またがらないとは思うが・・・) 
 + 
 +Locus Mapでは,Themeファイルで不要なタグを表示しなくすることも出来る。 
 + 
 +*** 不要なタグ情報を削除してサイズを小さくして分割する [#x11ec3da] 
 +上記のように単純に分割するのではなく,分割する時に日本全体のosmの地図データから不要なタグ情報を削除して少しでも地図のサイズを小さくしたかったので,実際には以下のようにしてみた。~ 
 + 
 +日本全体の地図データの.pbfファイルはバイナリデータに圧縮したファイルなんで,[[osmctools>https://github.com/mapsme/osmctools]](MSYS2/MinGW-W64環境で自前ビルドした&ref(osmctools.zip);((日本全体や本州のデータのような大きなサイズのデータを処理する場合,Windowsでも64bit版でないとうまく行かないため。)))の[[osmconvert>http://wiki.openstreetmap.org/wiki/Osmconvert]]を使って,[[osmfilter>https://wiki.openstreetmap.org/wiki/Osmfilter]]で編集出来るように.o5mファイルに変換する。~ 
 + 
 +まず,日本全体のpbf地図データをo5mフォーマットに変換する。~ 
 + > cd jpmap 
 + > osmconvert japan-latest.osm.pbf -o=japan-latest.o5m 
 + 
 +その後,分割する。~
 > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Hokkaido.poly -o=hokkaido.o5m  > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Hokkaido.poly -o=hokkaido.o5m
- > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Honshu.poly -o=honshu.o5m + > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Tohoku.poly   -o=tohoku.o5m 
- > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Shikoku.poly -o=shikoku.o5m + > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Kanto.poly    -o=kanto.o5m 
- > osmconvert --complex-ways japan-latest.osm -B=..\poly\Kyushu.poly -o=kyushu.o5m + > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Chubu.poly    -o=chubu.o5m 
-4個に分割するのにタグが境界にまたがっている場合,そのまま分割するとタグが落ちてしまうんで,--complex-waysをつけている。+ > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Kinki.poly    -o=kinki.o5m 
 + > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Chugoku.poly  -o=chugoku.o5m 
 + > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Shikoku.poly -o=shikoku.o5m 
 + > osmconvert --complex-ways japan-latest.osm -B=..\poly\Kyushu.poly   -o=kyushu.o5m 
 + > osmconvert --complex-ways japan-latest.o5m -B=..\poly\Honshu.poly  -o=honshu.o5m 
 +上記と同様に--complex-waysをつけている。
-そして,いらないタグ(電線とか)を[[osmfilterツール>http://wiki.openstreetmap.org/wiki/Osmfilter]]を使って削除する。&ref(del.txt);にいらないタグを入れておく。 +そして,いらないタグ(他の言語,電線とか)を[[osmfilter>http://wiki.openstreetmap.org/wiki/Osmfilter]]を使って削除する。&ref(del.txt);にいらないタグを入れておく。
-// > osmfilter hokkaido.o5m --parameter-file=del.txt > hokkaido_temp.o5m +
-// > osmfilter tohoku.o5m --parameter-file=del.txt > tohoku_temp.o5m +
-// > osmfilter kanto.o5m --parameter-file=del.txt > kanto_temp.o5m +
-// > osmfilter chubu.o5m --parameter-file=del.txt > chubu_temp.o5m +
-// > osmfilter kinki.o5m --parameter-file=del.txt > kinki_temp.o5m +
-// > osmfilter chugoku.o5m --parameter-file=del.txt > chugoku_temp.o5m +
-// > osmfilter shikoku.o5m --parameter-file=del.txt > shikoku_temp.o5m +
-// > osmfilter kyushu.o5m --parameter-file=del.txt > kyushu_temp.o5m+
 > osmfilter hokkaido.o5m --parameter-file=del.txt > hokkaido_temp.o5m  > osmfilter hokkaido.o5m --parameter-file=del.txt > hokkaido_temp.o5m
- > osmfilter honshu.o5m --parameter-file=del.txt > honshu_temp.o5m + > osmfilter tohoku.o5m   --parameter-file=del.txt > tohoku_temp.o5m 
- > osmfilter shikoku.o5m --parameter-file=del.txt > shikoku_temp.o5m + > osmfilter kanto.o5m   --parameter-file=del.txt > kanto_temp.o5m 
- > osmfilter kyushu.o5m --parameter-file=del.txt > kyushu_temp.o5m + > osmfilter chubu.o5m   --parameter-file=del.txt > chubu_temp.o5m 
-ところどころ,名前に(英語)のような表示が出る所があるんで,ついでにこれを削除しちゃう。((OpenStreetMapを編集する場合,現在では,日本語名(romaji)のような表記は推奨されなくなったそうです。))~ + > osmfilter kinki.o5m   --parameter-file=del.txt > kinki_temp.o5m 
-.osmに戻してperlを使って + > osmfilter chugoku.o5m --parameter-file=del.txt > chugoku_temp.o5m 
-// > osmconvert hokkaido_temp.o5m -o=hokkaido_temp.osm + > osmfilter shikoku.o5m --parameter-file=del.txt > shikoku_temp.o5m 
-// > osmconvert tohoku_temp.o5m -o=tohoku_temp.osm + > osmfilter kyushu.o5m  --parameter-file=del.txt > kyushu_temp.o5m 
-// > osmconvert kanto_temp.o5m -o=kanto_temp.osm + > osmfilter honshu.o5m  --parameter-file=del.txt > honshu_temp.o5m 
-// > osmconvert chubu_temp.o5m -o=chubu_temp.osm +ところどころ,名前に「ほげほげ(英語)」のように登録されているデータがあるので,ついでに(英語)の部分を削除する。((OpenStreetMapを編集する場合,現在では,日本語名(英語/ローマ字)のような表記は推奨されなくなったそうです。))~ 
-// > osmconvert kinki_temp.o5m -o=kinki_temp.osm +これは,地図データを.osmファイルに変換してからperlを使って削除した。~
-// > osmconvert chugoku_temp.o5m -o=chugoku_temp.osm +
-// > osmconvert shikoku_temp.o5m -o=shikoku_temp.osm +
-// > osmconvert kyushu_temp.o5m -o=kyushu_temp.osm +
-// > perl -p -e 's/\(.+?\)//g;' hokkaido_temp.osm > hokkaido.osm +
-// > perl -p -e 's/\(.+?\)//g;' tohoku_temp.osm > tohoku.osm +
-// > perl -p -e 's/\(.+?\)//g;' kanto_temp.osm > kanto.osm +
-// > perl -p -e 's/\(.+?\)//g;' chubu_temp.osm > chubu.osm +
-// > perl -p -e 's/\(.+?\)//g;' kinki_temp.osm > kinki.osm +
-// > perl -p -e 's/\(.+?\)//g;' chugoku_temp.osm > chugoku.osm +
-// > perl -p -e 's/\(.+?\)//g;' shikoku_temp.osm > shikoku.osm +
-// > perl -p -e 's/\(.+?\)//g;' kyushu_temp.osm > kyushu.osm+
 > osmconvert hokkaido_temp.o5m -o=hokkaido_temp.osm  > osmconvert hokkaido_temp.o5m -o=hokkaido_temp.osm
- > osmconvert honshu_temp.o5m -o=honshu_temp.osm + > osmconvert tohoku_temp.o5m   -o=tohoku_temp.osm 
- > osmconvert shikoku_temp.o5m -o=shikoku_temp.osm + > osmconvert kanto_temp.o5m    -o=kanto_temp.osm 
- > osmconvert kyushu_temp.o5m -o=kyushu_temp.osm+ > osmconvert chubu_temp.o5m    -o=chubu_temp.osm 
 + > osmconvert kinki_temp.o5m    -o=kinki_temp.osm 
 + > osmconvert chugoku_temp.o5m  -o=chugoku_temp.osm 
 + > osmconvert shikoku_temp.o5m -o=shikoku_temp.osm 
 + > osmconvert kyushu_temp.o5m   -o=kyushu_temp.osm 
 + > osmconvert honshu_temp.o5m  -o=honshu_temp.osm
 > perl -p -e 's/\(.+?\)//g;' hokkaido_temp.osm > hokkaido.osm  > perl -p -e 's/\(.+?\)//g;' hokkaido_temp.osm > hokkaido.osm
- > perl -p -e 's/\(.+?\)//g;' honshu_temp.osm > honshu.osm + > perl -p -e 's/\(.+?\)//g;' tohoku_temp.osm   > tohoku.osm 
- > perl -p -e 's/\(.+?\)//g;' shikoku_temp.osm > shikoku.osm + > perl -p -e 's/\(.+?\)//g;' kanto_temp.osm    > kanto.osm 
- > perl -p -e 's/\(.+?\)//g;' kyushu_temp.osm > kyushu.osm + > perl -p -e 's/\(.+?\)//g;' chubu_temp.osm    > chubu.osm 
-こんなようにして,(英語)を削除した。+ > perl -p -e 's/\(.+?\)//g;' kinki_temp.osm    > kinki.osm 
 + > perl -p -e 's/\(.+?\)//g;' chugoku_temp.osm  > chugoku.osm 
 + > perl -p -e 's/\(.+?\)//g;' shikoku_temp.osm > shikoku.osm 
 + > perl -p -e 's/\(.+?\)//g;' kyushu_temp.osm   > kyushu.osm 
 + > perl -p -e 's/\(.+?\)//g;' honshu_temp.osm  > honshu.osm 
 +こんなようにして,(英語)を削除した。ちょっと地図データのサイズが小さくなった。~
-//これで,ベクター日本地図のhakkaido.osm(北海道),%%honshu.osm(本州),%%tohoku.osm(東北),kanto.osm(関東),chubu.osm(中部),kinki.osm(近畿),chugoku.osm(中国),shikoku.osm(四国),kyushu.osm(九州)が出来た。.osmファイルはテキストファイル(xml)で,日本全体だと22Gbyte以上になっちゃう。 +これで,ベクター日本地図のhakkaido.osm(北海道),tohoku.osm(東北),kanto.osm(関東),chubu.osm(中部),kinki.osm(近畿),chugoku.osm(中国),shikoku.osm(四国),kyushu.osm(九州)及びhonshu.osm(本州)が出来た。.osmファイルはテキストファイル(xml)で,日本全体だと24Gbyte以上になっちゃう。
-これで,ベクター日本地図のhakkaido.osm(北海道),honshu.osm(本州),shikoku.osm(四国),kyushu.osm(九州)が出来た。.osmファイルはテキストファイル(xml)で,日本全体だと22Gbyte以上になっちゃう。+
-この後,.osmを.pbfに変更しておく。 +この後,.osmを.pbf(圧縮ファイル)に変換しておく。~
-// > osmconvert hokkaido.osm -o=hokkaido.osm.pbf +
-// > osmconvert tohoku.osm -o=tohoku.osm.pbf +
-// > osmconvert kanto.osm -o=kanto.osm.pbf +
-// > osmconvert chubu.osm -o=chubu.osm.pbf +
-// > osmconvert kinki.osm -o=kinki.osm.pbf +
-// > osmconvert chugoku.osm -o=chugoku.osm.pbf +
-// > osmconvert shikoku.osm -o=shikoku.osm.pbf +
-// > osmconvert kyushu.osm -o=kyushu.osmpbf+
 > osmconvert hokkaido.osm -o=hokkaido.osm.pbf  > osmconvert hokkaido.osm -o=hokkaido.osm.pbf
- > osmconvert honshu.osm -o=honshu.osm.pbf + > osmconvert tohoku.osm   -o=tohoku.osm.pbf 
- > osmconvert shikoku.osm -o=shikoku.osm.pbf + > osmconvert kanto.osm    -o=kanto.osm.pbf 
- > osmconvert kyushu.osm -o=kyushu.osmpbf+ > osmconvert chubu.osm    -o=chubu.osm.pbf 
 + > osmconvert kinki.osm    -o=kinki.osm.pbf 
 + > osmconvert chugoku.osm  -o=chugoku.osm.pbf 
 + > osmconvert shikoku.osm -o=shikoku.osm.pbf 
 + > osmconvert kyushu.osm   -o=kyushu.osmpbf 
 + > osmconvert honshu.osm  -o=honshu.osm.pbf
-*** SRTMのデータから等高線地図を作成 [#w49cf595] +** SRTMのデータから等高線地図を作成 [#w49cf595] 
-OpenStreatMapから日本のベクター地図は作成できたんだけど,等高線が入っていない。+日本のOpenStreatMapから各地域の地図データは作成出来たんだけど,この地図には等高線が入っていない。~
ハイキングやちょっとした山登りをするときには,等高線が見れないと不便。 ハイキングやちょっとした山登りをするときには,等高線が見れないと不便。
-そこで,日本のベクター等高線地図を作ることにした。+そこで,等高線地図を作ることにした。
-日本の等高線データを得るには,+日本の等高線データを得られるサイト。~
- 国土地理院~ - 国土地理院~
-[[国土地理院>http://www.gsi.go.jp/kiban/index.html]]から正確な等高線データ(5mまたは10mメッシュ)をダウンロード出来る。+[[国土地理院>http://www.gsi.go.jp/kiban/index.html]]から正確な標高データ(5mまたは10mメッシュ)をダウンロード出来る。
-ファイルフォーマットは,JPGIS(GML)ということだが・・・ .osmに変換する方法がわからない。~+ファイルフォーマットは,JPGIS(GML)ということだが・・・ この標高データから等高線データを作成して.osmに変換する方法がわからない。~
- SRTM~ - SRTM~
-[[Shuttle Radar Topography Mission(SRTM)>http://www2.jpl.nasa.gov/srtm/]]と呼ばれるスペースシャトルに積み込んだレーダを使って全世界の詳細な立体地形データを作成すること目的としたミッションがあって,その成果が利用できるみたい。+[[Shuttle Radar Topography Mission(SRTM)>http://www2.jpl.nasa.gov/srtm/]]と呼ばれる米スペースシャトルに積み込んだレーダを使って全世界の詳細な立体地形データを作成すること目的としたミッションがあって,その成果が利用できるみたい。
-[[SRTM3 Version3>http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/]]からデータ(.hgt.zip)をダウンロード出来る。SRTM1 Version 3はUSAのみなので,日本の地形の場合は,SRTM3 Version 3になるんだと思う。実際の地形データは,緯度経度で区切られた区画ごとにファイルになっている。+[[SRTM3 Version3(3秒/90m 全世界)>http://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL3.003/2000.02.11/]]または[[SRTM1 Version 3(1秒/30m)>http://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL3.003/2000.02.11/]]からデータをダウンロード出来る。SRTM1 Version3(1秒/30m)は,詳細データになるのだがどうもUSAのみみたいだ((現在では,SRTM1 Version3にも全世界のデータが含まれているようだ。))。日本の地形の場合はSRTM3 Version 3に含まれている。~ 
 +実際の地形データは(データがあるサイトにより)hgtファイルかtiffファイルになっていて,緯度経度で区切られた区画ごと(1度)のファイルになっている。~ 
 +また,[[http://dwtkns.com/srtm30m/]]のサイトでは,位置を選択してSRTM1 Version3のhgtファイルをダウンロード出来る。~
-SRTMのデータからOpenStreetMapのフォーマットに変換してくれる以下のようなツールがあるみたいなんで,それを使用して等高線地図を作ってみた。(国土地理院のデータの方が正確らしいが・・・)+SRTMのデータをダウンロードしてOpenStreetMapのフォーマットに変換してくれる以下のようなツールがあるみたいなんで,それを使用して等高線地図を作ってみた。(国土地理院のデータの方が正確らしいが・・・)
[[srtm2osm>http://wiki.openstreetmap.org/wiki/Srtm2Osm#Download]]~ [[srtm2osm>http://wiki.openstreetmap.org/wiki/Srtm2Osm#Download]]~
まず見つけたツールがsrtm2osm。~ まず見つけたツールがsrtm2osm。~
OpenStreetMapのwikiに使い方が書かれていた。.netのアプリなんでWindows用。(monoを使ってLinuxでも動かせるようだが・・・)~ OpenStreetMapのwikiに使い方が書かれていた。.netのアプリなんでWindows用。(monoを使ってLinuxでも動かせるようだが・・・)~
-srtm2osmのオプションの-bounds1に日本の左下の緯度・経度と右上の緯度・経度を指定すれば,SRTMデータが有るサーバからデータをダウンロードして,等高線データを作成して,それを.osmファイルとして作成してくれる。~ +srtm2osmのオプションの-bounds1に日本の左下の緯度・経度と右上の緯度・経度を指定すれば,SRTMデータがあるサーバからデータをダウンロードして,等高線データを作成して,それを.osmファイルとして作成してくれる。~ 
-ただ日本全国になると129個のファイル(データがある分)の.osmファイルが出来てしまって,これを1つの.osmにマージしないといけないのだが,うまくマージ(osmosisを使った)が出来ない。~+ただ日本全国になると129個のファイル(データがある分)の.osmファイルが出来てしまって,これを1つの.osmにマージしないといけないのだが,うまくマージ(osmosisを使った)が出来なかった。~
[[phyghtmap>http://katze.tfiu.de/projects/phyghtmap/index.html]]~ [[phyghtmap>http://katze.tfiu.de/projects/phyghtmap/index.html]]~
-次に見つけたのがphyghtmap。(バージョン1.42を使った)+次に見つけたのがphyghtmap version 1.42(python2.7が必要)。このツールも使ってみた((phyghtmap version 2.0以降ではPython3.xが必要。また,version 2.10以降ではデータをダウンロードするサイトが変更になって,[[USGS' earthexplorer>https://ers.cr.usgs.gov/]]でアカウントが必要になった。事前に[[アカウントを作成して>https://ers.cr.usgs.gov/register/]],phyghtmapの実行時に--earthexplorer-user=USER_ID --earthexplorer-password=PASSWORDを指定する。))。(最新版は2.23)
-Pythonで動くので,WindowsでもLinuxでも使える。このツールでもやはり129個のデータをダウンロードするのはsrtm2osmと同様だが,.osmに変換する時にオプションに--max-nodes-per-tile=0を使うと,1個の.osmにマージして出力してくれた :-D+Pythonで動くので,WindowsでもLinuxでも使える。日本の領域指定に&ref(japan.poly);を使った。~ 
 +このツールでもやはり129個のデータをダウンロード(hgtディレクトリ)するのはsrtm2osmと同様だが,.osmに変換する時にオプションに--max-nodes-per-tile=0を使うと,1個の.osmにマージして出力してくれた :-D
 + > cd srtm 
 +// > phyghtmap --polygon=..\poly\japan.poly --output-prefix=japan_srtm --srtm=1 --step=20 --line-cat=500,100 --start-node-id=20000000000 --start-way-id=10000000000 --write-timestamp --max-nodes-per-tile=0 --earthexplorer-user=USER_ID --earthexplorer-password=PASSWORD 
 + > phyghtmap --polygon=..\poly\japan.poly --output-prefix=japan_srtm --srtm=3 --step=20 --line-cat=500,100 --start-node-id=20000000000 --start-way-id=10000000000 --write-timestamp --max-nodes-per-tile=0 
 + > mv japan_srtm_lon122.56_153.89lat21.21_45.80_srtm3.osm japan_srtm.osm 
 +// > mv japan_srtm_lon122.56_153.89lat21.21_45.80_srtm3v3.0.osm japan_srtm.osm 
 +--step=20で20mの等高線に(--step=10で10mにも出来る。ファイルサイズは倍になる。),--line-cat=500,100で500m/100m毎に少し太線にするようにした。~ 
 +--write-timestampオプションを指定しないと,後でosmosisでマージしてLocus map用のベクター地図.mapファイルを作成する時にtimestampが無いってエラーを出してうまくいかない。~
- > phyghtmap --polygon=japan.poly --output-prefix=japan_srtm --srtm=3 --step=20 --line-cat=500,100 --start-node-id=20000000000 --start-way-id=10000000000 --write-timestamp --max-nodes-per-tile=0 +これで,なんとか20m(ハイキング用なんで20m)での日本の等高線地図japan_srtm.osmを作成できた。
- +
---step=20で20mの等高線に,--line-cat=500,100で500m/100m毎に少し太線にするようにした。--write-timestampオプションを指定しないと,後でosmosisでマージしてLocus map用のベクター地図.mapファイルを作成する時にtimestampが無いってエラーを出してうまくいかない。~ +
-これで,なんとか20m(ハイキング用なんで20m)での日本の等高線地図japan_srtm.mapを作成できた。+
ただ出来上がった等高線地図には,おかしな等高線がたくさん出来ている。ダウンロードしたSRTMの.hgtファイルを確認したら,ところどころデータがおかしいのが原因。~ ただ出来上がった等高線地図には,おかしな等高線がたくさん出来ている。ダウンロードしたSRTMの.hgtファイルを確認したら,ところどころデータがおかしいのが原因。~
-srtm2osmでダウンロードした.hgtファイルのデータは大丈夫みたいなので(つまり http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/ にあるデータはダメで,http://e4ftl01.cr.usgs.gov/SRTM/SRTMGL3.003/2000.02.11/ のだと大丈夫ってこと。) ,srtm2osmでダウンロードした.hgtファイルに入れ替えて,再度phyghtmapを使って.osmファイルを作成した。~ +srtm2osmでダウンロードした.hgtファイルのデータは大丈夫みたいなので(つまりhttp://dds.cr.usgs.gov/srtm/version2_1/SRTM3/Eurasia/にあるデータはいくつか壊れていてダメで,http://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL3.003/2000.02.11/ のだと大丈夫),srtm2osmでダウンロードした.hgtファイルに入れ替えて,再度phyghtmapを使って.osmファイルを作成した。~ 
-これでやっと,日本の等高線データのjapan_srtm.osmが作成できた。+これでやっと,日本の等高線データのjapan_srtm.osmが作成できた。(version2.10以降のphyghtmapだと正常な標高データがダウンロード出来る。)
-また,日本の等高線データjapan_srtm.osmも地図データと同様に,%%4個%%8個に分割するのも同じようにすれば作成できる。(phyghtmapで,直接作成することも出来るが,こっちのやり方のほうが早い。) +日本の等高線データjapan_srtm.osmから地図データと同様に8個(4個)に分割するのも,同じようにすれば作成できる。(phyghtmapで直接作成することも出来るが,こっちのやり方のほうが早かった。) 
-// > osmconvert japan_srtm.osm -B=..\poly\Hokkaido.poly -o=hokkaido_srtm.osm + > osmconvert japan_srtm.osm -B=..\poly\Hokkaido.poly -o=hokkaido_srtm.pbf 
-// > osmconvert japan_srtm.osm -B=..\poly\Tohoku.poly -o=tohoku_srtm.osm + > osmconvert japan_srtm.osm -B=..\poly\Tohoku.poly   -o=tohoku_srtm.pbf 
-// > osmconvert japan_srtm.osm -B=..\poly\Kanto.poly -o=kanto_srtm.osm + > osmconvert japan_srtm.osm -B=..\poly\Kanto.poly   -o=kanto_srtm.pbf 
-// > osmconvert japan_srtm.osm -B=..\poly\Chubu.poly -o=chubu_srtm.osm + > osmconvert japan_srtm.osm -B=..\poly\Chubu.poly   -o=chubu_srtm.pbf 
-// > osmconvert japan_srtm.osm -B=..\poly\Kinki.poly -o=kinki_srtm.osm + > osmconvert japan_srtm.osm -B=..\poly\Kinki.poly   -o=kinki_srtm.pbf 
-// > osmconvert japan_srtm.osm -B=..\poly\Chugoku.poly -o=chugoku_srtm.osm + > osmconvert japan_srtm.osm -B=..\poly\Chugoku.poly -o=chugoku_srtm.pbf 
-// > osmconvert japan_srtm.osm -B=..\poly\Shikoku.poly -o=shikoku_srtm.osm + > osmconvert japan_srtm.osm -B=..\poly\Shikoku.poly -o=shikoku_srtm.pbf 
-// > osmconvert japan_srtm.osm -B=..\poly\Kyushu.poly -o=kyushu_srtm.osm + > osmconvert japan_srtm.osm -B=..\poly\Kyushu.poly   -o=kyushu_srtm.pbf 
- > osmconvert japan_srtm.osm -B=..\poly\Hokkaido.poly -o=hokkaido_srtm.osm + > osmconvert japan_srtm.osm -B=..\poly\Honshu.poly   -o=honshu_srtm.pbf 
- > osmconvert japan_srtm.osm -B=..\poly\Honshu.poly -o=honshu_srtm.osm +一度作成しておけば,後は地図と等高線をマージすれば等高線入り日本地図データが作れることになる。
- > osmconvert japan_srtm.osm -B=..\poly\Shikoku.poly -o=shikoku_srtm.osm +
- > osmconvert japan_srtm.osm -B=..\poly\Kyushu.poly -o=kyushu_srtm.osm +
-一度作成しておけば,後は地図と等高線をマージすれば%%4個%%8個の等高線入り日本地図データが作れます。+
-ちなみに,ダウンロードした.hgtファイルをLocus/data/srtm/ フォルダーに入れておいて,Locus mapで地形を表示する設定にすると,起伏なんかが明暗表示されて見やすくなります。+ちなみに,ダウンロードした.hgtファイルをLocus/data/srtmフォルダーに入れておいて,Locus mapで地形を表示する設定にすると,起伏なんかが明暗表示されて見やすくなる。
-*** 海を青くする [#ze3004e1] +(2015SRTMデータ:&ref(hgt2015.zip);/2022SRTMデータ:&ref(hgt3v3_2022.zip);)~
-OpenStreetMapの地図データは,陸地と海岸の境界のタグ(coastlines)がサポートされなくなってます。Mapsforgeのライブラリではこの陸地と海岸の境界のタグで海を青く表示できるようになってます。+
-陸地と海岸の境界のタグがサポートされなくなっちゃったんで,海を青く表示するには,なんとかして陸地と海岸の境界を特定し,海側はkey='natural' value='sea'タグを,陸側はkey='natural' value='nosea'タグを追加する必要があります。+** 海を青くする地図を作成 [#ze3004e1] 
 +OpenStreetMapの地図データは,陸地と海岸の境界のタグ(coastlines)がサポートされなくなっている。このためMapsforge形式のベクター地図を作成する時に何も対策をしないと,海の部分が青く表示されないベクター地図になる。
-このためには,日本の陸地や海の領域を特定する地形データが必要です。+Mapsforgeのライブラリでは,陸地と海の部分をタグ(陸地はnosea,海はsea)を指定しておくと,海のタグ部分を青く表示するように設定できる。 
-まず,[[OpenStreetMapData>http://openstreetmapdata.com/data/coastlines]]というサイトから,世界の陸地線のデータである,[[land-polygons-split-4326.zip>http://data.openstreetmapdata.com/land-polygons-split-4326.zip]]ファイルをダウンロードします。+ 
- > wget http://data.openstreetmapdata.com/land-polygons-split-4326.zip +なので海を青く表示するには,なんとかして陸地と海岸の境界を特定し,海側はkey='natural' value='sea'タグを,陸側はkey='natural' value='nosea'タグを地図データに追加する必要がある。 
-zipファイルを解凍すると,land_polygons.shpというShapeフォーマット(外形)のデータがあります。これを[[ogr2ogr>http://www.gdal.org/ogr2ogr.html]](Windowsの場合,[[QGIS>http://qgis.org/ja/site/]]がインストールされていればogr2ogrも使える)というツールを使用して日本全体の外形のShapeデータを取り出します。+ 
 +''このやりかたが正しい方法かどうかはわからないが,とりあえずこの対策をしてみる。'' 
 + 
 +このためには,日本の陸地や海の領域を特定する地形データが必要になる。
 + 
 +*** 海部分のデータを作成 [#x30ea5e8] 
 + > cd sea 
 +このディレクトリに,海を特定した上で'' 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); &ref(honshu_s.osm); をそれぞれ作成した。 
 + 
 +*** 陸地部分のデータを作成 [#h86513ef] 
 +[[OpenStreetMap Data>https://osmdata.openstreetmap.de/]]というサイトから,世界の陸地線のデータである,[[land-polygons-split-4326.zip>https://osmdata.openstreetmap.de/download/land-polygons-split-4326.zip]]ファイルをダウンロードする。
 + > wget https://osmdata.openstreetmap.de/download/land-polygons-split-4326.zip 
 +zipファイルを解凍すると,''land_polygons.shp''という世界全体のShapeフォーマット(外形)のデータがある。このファイルを[[ogr2ogr>http://www.gdal.org/ogr2ogr.html]]( [[GDAL>https://gdal.org/]] に含まれている。Windowsの場合,[[QGIS>http://qgis.org/ja/site/]]がインストールされていればogr2ogrも使える。)というツールを使用して,日本全体の外形のShapeデータのjapan.shpを取り出す。
 > 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が作成される。この時shape2osm.pyにより,key='natural' value='nosea'が追加されている。~ +これで,日本全体の陸地の外形データのjapan_ns.osmが作成される。この時,shape2osm.pyにより,'' key='natural' value='nosea' ''タグが追加されている。 
-そして,日本全体の外形データから,北海道,東北,関東,中部,近畿,中国,四国,九州の外形データを作成する。これはosmconvertを使用して各場所をカットすることにした。 + 
-// > osmconvert japan_ns.osm -B=..\poly\Hokkaido.poly -o=hokkaido_ns.osm +//そして,日本全体の外形データから,北海道,本州,四国,九州の外形データを作成する。これはosmconvertを使用して各場所をカットすることにした。~
-// > osmconvert japan_ns.osm -B=..\poly\Tohoku.poly -o=tohoku_ns.osm +
-// > osmconvert japan_ns.osm -B=..\poly\Kanto.poly -o=kanto_ns.osm +
-// > osmconvert japan_ns.osm -B=..\poly\Chubu.poly -o=chubu_ns.osm +
-// > osmconvert japan_ns.osm -B=..\poly\Kinki.poly -o=kinki_ns.osm +
-// > osmconvert --complex-ways japan_ns.osm -B=..\poly\Chugoku.poly -o=chugoku_ns.osm +
-// > osmconvert japan_ns.osm -B=..\poly\Shikoku.poly -o=shikoku_ns.osm +
-// > osmconvert japan_ns.osm -B=..\poly\Kyushu.poly -o=kyushu_ns.osm +
- > osmconvert japan_ns.osm -B=..\poly\Hokkaido.poly -o=hokkaido_ns.osm +
- > osmconvert japan_ns.osm -B=..\poly\Honshu.poly -o=honshu_ns.osm +
- > osmconvert japan_ns.osm -B=..\poly\Shikoku.poly -o=shikoku_ns.osm +
- > osmconvert japan_ns.osm -B=..\poly\Kyushu.poly -o=kyushu_ns.osm+
-海を特定した上でkey='natural' value='sea'タグを付けるため,テキストエディタを使って %%japan_s.osmを作成する。めんどくさいんで,日本全体を海にしている。%% +そして,日本全体の外形データから,北海道,東北,関東,中部,近畿,中国,四国,九州,(本州)の外形データを作成する。これはosmconvertを使用して各場所をカットすることにした。~ 
-//&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); をそれぞれ作成した。 + > osmosis --read-xml file="japan_s.osm" --read-xml file="japan_ns.osm" --sort --merge --write-xml file="japan_ns2.osm
-&ref(hokkaido_s.osm); &ref(honshu_s.osm); &ref(shikoku_s.osm); &ref(kyushu_s.osm); をそれぞれ作成した。+ ;> osmconvert --complex-ways japan_ns2.osm -B=..\poly\Hokkaido.poly -o=hokkaido_ns.osm 
 + ;> osmconvert --complex-ways japan_ns2.osm -B=..\poly\Tohoku.poly  -o=tohoku_ns.osm 
 + ;> osmconvert --complex-ways japan_ns2.osm -B=..\poly\Kanto.poly    -o=kanto_ns.osm 
 + ;> osmconvert --complex-ways japan_ns2.osm -B=..\poly\Chubu.poly    -o=chubu_ns.osm 
 + ;> osmconvert --complex-ways japan_ns2.osm -B=..\poly\Kinki.poly    -o=kinki_ns.osm 
 + > osmconvert --complex-ways japan_ns2.osm -B=..\poly\Chugoku.poly  -o=chugoku_ns.osm 
 + ;> osmconvert --complex-ways japan_ns2.osm -B=..\poly\Shikoku.poly  -o=shikoku_ns.osm 
 + ;> osmconvert --complex-ways japan_ns2.osm -B=..\poly\Kyushu.poly  -o=kyushu_ns.osm 
 + ;> osmconvert --complex-ways japan_ns2.osm -B=..\poly\Honshu.poly  -o=honshu_ns.osm
 +*** 海(xxxx_s.osm)と陸地部分(xxxx_ns.osm)をマージする [#nb06f2dc]
海(xxxx_s.osm)と陸地部分(xxxx_ns.osm)をマージして,xxxx_sea.osmを作成しておく。 海(xxxx_s.osm)と陸地部分(xxxx_ns.osm)をマージして,xxxx_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="tohoku_s.osm" --read-xml file="tohoku_ns.osm" --sort --merge --write-xml file="tohoku_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="chubu_s.osm" --read-xml file="chubu_ns.osm" --sort --merge --write-xml file="chubu_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="chugoku_s.osm" --read-xml file="chugoku_ns.osm" --sort --merge --write-xml file="chugoku_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="kyushu_s.osm" --read-xml file="kyushu_ns.osm" --sort --merge --write-xml file="kyushu_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="hokkaido_s.osm" --read-xml file="hokkaido_ns.osm" --sort --merge --write-xml file="hokkaido_sea.osm"
- > osmosis --read-xml file="honshu_s.osm" --read-xml file="honshu_ns.osm" --sort --merge --write-xml file="honshu_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="shikoku_s.osm" --read-xml file="shikoku_ns.osm" --sort --merge --write-xml file="shikoku_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="kyushu_s.osm" --read-xml file="kyushu_ns.osm" --sort --merge --write-xml file="kyushu_sea.osm" + > osmosis --read-xml file="chubu_s.osm"    --read-xml file="chubu_ns.osm"    --sort --merge --write-xml file="chubu_sea.osm" 
-やっと,陸地は<tag k="natural" v="nosea" />が,海の部分は<tag k="natural" v="sea" />がある地図データが作成できた。%%(海は日本全体だけど・・・)%%+ > 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="chugoku_s.osm"  --read-xml file="chugoku_ns.osm"  --sort --merge --write-xml file="chugoku_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="kyushu_s.osm"   --read-xml file="kyushu_ns.osm"   --sort --merge --write-xml file="kyushu_sea.osm" 
 + > osmosis --read-xml file="honshu_s.osm"  --read-xml file="honshu_ns.osm"  --sort --merge --write-xml file="honshu_sea.osm" 
 +pbfファイルに変換しておく。~ 
 + > osmconvert hokkaido_sea.osm -o=hokkaido_sea.pbf 
 + > osmconvert tohoku_sea.osm  -o=tohoku_sea.pbf 
 + > osmconvert kanto_sea.osm    -o=kanto_sea.pbf 
 + > osmconvert chubu_sea.osm    -o=chubu_sea.pbf 
 + > osmconvert kinki_sea.osm    -o=kinki_sea.pbf 
 + > osmconvert chugoku_sea.osm  -o=chugoku_sea.pbf 
 + > osmconvert shikoku_sea.osm  -o=shikoku_sea.pbf 
 + > osmconvert kyushu_sea.osm  -o=kyushu_sea.pbf 
 + > osmconvert honshu_sea.osm  -o=honshu_sea.pbf 
 +やっと,陸地は<tag k="natural" v="nosea" />が,海の部分は<tag k="natural" v="sea" />がある地図データが作成できた。
-*** 日本の地図と等高線をマージして完成 [#g8a11fa9] +** 日本の地図と等高線と海・陸地をマージして完成 [#g8a11fa9] 
-上で作成した各場所のベクター地図とベクター等高線地図,及び海を青くする地図,を1つのファイルにマージして,ベクターマップの.mapフォーマットに変換します。~ +[[Locus Map>http://www.locusmap.eu/]]は,ベクター地図としてmapsforgeフォーマット.mapファイルをサポートしている。他にもGarminのベクター地図の.imgファイルもそのまま使える。
-ツールはOpenStreetMapのwikiに書かれている[[osmosis(0.43.1を使用)>http://wiki.openstreetmap.org/wiki/JA:Osmosis]]と[[mapsforge writer plugin(mapsforge-map-writer-*.jar)(0.6.0を使用)>https://github.com/mapsforge/mapsforge]]を使いました。[[Locus map>http://www.locusmap.eu/]]のベクターマップのフォーマットは,mapsforgeライブラリをサポートしているからです。他にもGarminのベクターマップの.imgファイルもそのまま使えます。+
-osmosisはjavaアプリケーションですが,日本全体を処理する場合はRAMがたくさんあるPC出ないと,そのままではメモリ不足で停止しちゃいます。(5Gを割り当てても足りない)~ +上で作成した各場所のベクター地図とベクター等高線地図,及び海を青くする地図,を1つのファイルにマージして日本の各地域のベクター地図.mapファイルに変換する。
-type=hdを使うと速度はかなり遅くなりますが,メモリ不足はなんとか回避できます。tag-conf-file=&ref(tags.xml);で表示用にタグ設定しておきます。(設定がおかしいかも・・・) +
-// > osmosis.bat --read-xml file="jpmap\hokkaido.osm" --read-xml file="srtm\hokkaido_srtm.osm" --merge --read-xml file="sea\hokkaido_sea.osm" --merge --mapfile-writer file="hokkaido.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
-// > osmosis.bat --read-xml file="jpmap\tohoku.osm" --read-xml file="srtm\tohoku_srtm.osm" --merge --read-xml file="sea\tohoku_sea.osm" --merge --mapfile-writer file="tohoku.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
-// > osmosis.bat --read-xml file="jpmap\kanto.osm" --read-xml file="srtm\kanto_srtm.osm" --merge --read-xml file="sea\kaito_sea.osm" --merge --mapfile-writer file="kanto.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
-// > osmosis.bat --read-xml file="jpmap\chubu.osm" --read-xml file="srtm\chubu_srtm.osm" --merge --read-xml file="sea\chubu_sea.osm" --merge --mapfile-writer file="chubu.map" type=hd tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
-// > osmosis.bat --read-xml file="jpmap\kinki.osm" --read-xml file="srtm\kinki_srtm.osm" --merge --read-xml file="sea\kinki_sea.osm" --merge --mapfile-writer file="kinki.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
-// > osmosis.bat --read-xml file="jpmap\chugoku.osm" --read-xml file="srtm\chugoku_srtm.osm" --merge --read-xml file="sea\chugoku_sea.osm" --merge --mapfile-writer file="chugoku.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
-// > osmosis.bat --read-xml file="jpmap\shikoku.osm" --read-xml file="srtm\shikoku_srtm.osm" --merge --read-xml file="sea\shikoku_sea.osm" --merge --mapfile-writer file="shikoku.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
-// > osmosis.bat --read-xml file="jpmap\kyushu.osm" --read-xml file="srtm\kyushu_srtm.osm" --merge --read-xml file="sea\kyushu_sea.osm" --merge --mapfile-writer file="kyushu.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
- > osmosis.bat --read-xml file="jpmap\hokkaido.osm" --read-xml file="srtm\hokkaido_srtm.osm" --merge --read-xml file="sea\hokkaido_sea.osm" --merge --mapfile-writer file="hokkaido.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
- > osmosis.bat --read-xml file="jpmap\honshu.osm" --read-xml file="srtm\honshu_srtm.osm" --merge --read-xml file="sea\honshu_sea.osm" --merge --mapfile-writer file="honshu.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
- > osmosis.bat --read-xml file="jpmap\shikoku.osm" --read-xml file="srtm\shikoku_srtm.osm" --merge --read-xml file="sea\shikoku_sea.osm" --merge --mapfile-writer file="shikoku.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
- > osmosis.bat --read-xml file="jpmap\kyushu.osm" --read-xml file="srtm\kyushu_srtm.osm" --merge --read-xml file="sea\kyushu_sea.osm" --merge --mapfile-writer file="kyushu.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" +
-とにかく時間がかかります。4分割の場合は全部マージするだけでも大体27時間(sortしないと15時間)ぐらいかかった :-o んだけど,8分割だと全体では6時間ぐらいで作成できた。+
-こうやって出来た日本のベクターマップを,Locus/mapsVector/japanフォルダーにコピーして,Locusで使用することが出来た。~+変換ツールには,[[OpenStreetMapのwiki>https://wiki.openstreetmap.org]]に書かれている[[osmosis>https://github.com/openstreetmap/osmosis]](最新は0.48.3)と[[Mapsforge Map-Writer plugin>https://github.com/mapsforge/mapsforge]]の[[mapsforge-map-writer-0.6.0-jar-with-dependencies.jar>https://search.maven.org/search?q=mapsforge-map-writer]](最新は0.17.0)を使った。~ 
 +DownloadしたMapsforge Map-Writer pluginのjarファイルは,osmosisのlib/defaultにコピーする。 
 + 
 +Mapsforge Map-Writer pluginを使って最近の日本全体や本州のmap地図を作成する場合は,RAMが16G搭載したPC(Java VMを動かす時に-Xms13G -Xmx13Gとか使って)でも,メモリ不足で停止しちゃう。8Gマシンで5Gを割り当ててもまったく足りない &worried; ~ 
 +搭載メモリが少ない場合は,オプションの''type=hd''を使うと速度はかなり遅くなるがうまくいくことがある。~ 
 +それでも,最近のOSMデータから日本全体や本州の.mapを作成しようとすると,zoom interval 1の書き出し時にエラー(java.nio.BufferOverflowException)でうまく行かなくなってしまった XD ~ 
 +これは,Mapsforge Map-Writer pluginでのオブジェクト書き出し時のメモリ割り当てサイズが固定値で,それを超えた量になってしまったため。~ 
 +しょうがないので,tag mappingファイル(tags.xml)を編集してzoom interval 1(0~7)に割り当てるタグ(オブジェクト数)をできるだけ減らすようにしたら,なんとか本州の.mapも作成できた。この為,zoom 0~7だと表示する情報が減ってしまった。~ 
 +等高線表示用のタグもtag-conf-file=&ref(tags.xml);に設定しておく。 
 + 
 +以下のコマンド(本州だけはtype=hdを使っている)でマージして,.mapファイルを作成する。~ 
 + > osmosis --read-pbf file="jpmap\hokkaido.osm.pbf" --read-pbf file="srtm\hokkaido_srtm.pbf"  --merge --read-pbf file="sea\hokkaido_sea.pbf" --merge --mapfile-writer file="hokkaido.osm.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="jpmap\tohoku.osm.pbf" --read-pbf file="srtm\tohoku_srtm.pbf" --merge --read-pbf file="sea\tohoku_sea.pbf" --merge --mapfile-writer file="tohoku.osm.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="jpmap\kanto.osm.pbf" --read-pbf file="srtm\kanto_srtm.pbf" --merge --read-pbf file="sea\kanto_sea.pbf" --merge --mapfile-writer file="kanto.osm.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="jpmap\chubu.osm.pbf" --read-pbf file="srtm\chubu_srtm.pbf" --merge --read-pbf file="sea\chubu_sea.pbf" --merge --mapfile-writer file="chubu.osm.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="jpmap\kinki.osm.pbf" --read-pbf file="srtm\kinki_srtm.pbf" --merge --read-pbf file="sea\kinki_sea.pbf" --merge --mapfile-writer file="kinki.osm.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="jpmap\chugoku.osm.pbf" --read-pbf file="srtm\chugoku_srtm.pbf" --merge --read-pbf file="sea\chugoku_sea.pbf" --merge --mapfile-writer file="chugoku.osm.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="jpmap\shikoku.osm.pbf" --read-pbf file="srtm\shikoku_srtm.pbf" --merge --read-pbf file="sea\shikoku_sea.pbf" --merge --mapfile-writer file="shikoku.osm.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="jpmap\kyushu.osm.pbf" --read-pbf file="srtm\kyushu_srtm.pbf" --merge --read-pbf file="sea\kyushu_sea.pbf" --merge --mapfile-writer file="kyushu.osm.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="jpmap\honshu.osm.pbf" --read-pbf file="srtm\honshu_srtm.pbf" --merge --read-pbf file="sea\honshu_sea.pbf" --merge --mapfile-writer file="honshu.osm.map" tag-conf-file=tags\tags.xml map-start-zoom=10 comment="%date% made by Yuji Ueno" type=hd 
 +とにかく時間がかかります。4分割の場合は全部マージするだけでも大体27時間ぐらいかかった :-o 8分割(本州除く)だと全体では6時間ぐらいで作成出来た。 
 + 
 +こうやって,北海道(hokkaido.osm.map),東北(tohoku.osm.map),関東(kanto.osm.map),中部(chubu.osm.map),近畿(kinki.osm.map),中国(chugoku.osm.map),四国(shikoku.osm.map),九州(kyushu.osm.map)の8個と本州(honshu.osm.map)の日本のベクター地図が出来たので,これらの4個または8個のベクター地図をLocus MapのmapsVectorフォルダーにコピーして,日本全国の地図をLocus Mapで使用することが出来た。~
&ref(japan_map.png);&ref(japan_map2.png); &ref(japan_map.png);&ref(japan_map2.png);
-%% ただ作成した日本のベクターマップには問題があって,海の色が青くなっていない %% ;( +作成した日本のベクター地図は,[[こちら(気が向いたら更新)>https://onedrive.live.com/redir?resid=9D5AE460143634BB%21170]]に置いておく。 
-%% たぶん,key='natural' value='sea'のタグを持つデータが無いんだと思うけど・・・ OpenStreetMapでは,key='natural' value='sea'タグのような,海と陸地の堺で色を変得ることに利用できるタグは無いみたい。対応方法は,日本の陸地の堺に'nosea'タグを,海に'sea'タグをMapsforge-Writerで書き出すときに追加すれば良いんだけど,うまく日本のShapeファイルから各部分を取り出せないんで,とりあえずこのまま。 %%+ 
 +上記の作業をbatファイルにしておけば,定期的に日本のベクター地図を作成することが出来ると思う。 
 + 
 +** themeファイル [#zaaa0e85] 
 +Locus Mapで作成した日本のベクター地図を使用するときに使用出来る&ref(yuji.zip,,themeファイル);をOpenAndroMapsのElevateをベースに作成してみた。~ 
 +Locus MapのmapsVector/_themesフォルダーにコピーすれば使用できる。 
 + 
 +* POIデータの作成 [#q451597f] 
 +Mapsforgeライブラリには,POI Writerプラグイン(バージョン0.6.1から対応した)がある。~ 
 +このプラグインを使ってOpenStreetMapのデータからMapsforge形式のPOIを抽出しSQLite DBファイルに書き出すことが出来る。~ 
 + 
 +POI DBファイルを作成するのには,mapファイル作成する[[osmosis>https://github.com/openstreetmap/osmosis]](最新は0.48.3)と[[Mapsforge POI-Writer plugin>https://github.com/mapsforge/mapsforge]]の[[mapsforge-poi-writer-0.17.0-jar-with-dependencies.jar>https://search.maven.org/search?q=mapsforge-poi-writer]](最新は0.17.0)を使った。~ 
 +DownloadしたMapsforge POI-Writer pluginのjarファイルは,osmosisのlib/defaultにコピーする。~ 
 + 
 +抽出するPOIは,&ref(poi-mapping.xml);ファイルに設定しておく。 
 + 
 +osmosisコマンドで,.poiファイルを作成する。~ 
 + > cd poi 
 + > osmosis --read-pbf file="..\jpmap\hokkaido.osm.pbf" --poi-writer file="hokkaido.osm.poi" tag-conf-file=..\tags\poi-mapping.xml comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="..\jpmap\tohoku.osm.pbf"  --poi-writer file="tohoku.osm.poi"  tag-conf-file=..\tags\poi-mapping.xml comment="%date% made by Yuji Ueno" 
 + ;> osmosis --read-pbf file="..\jpmap\kanto.osm.pbf"    --poi-writer file="kanto.osm.poi"    tag-conf-file=..\tags\poi-mapping.xml comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="..\jpmap\chubu.osm.pbf"    --poi-writer file="chubu.osm.poi"    tag-conf-file=..\tags\poi-mapping.xml comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="..\jpmap\kinki.osm.pbf"    --poi-writer file="kinki.osm.poi"    tag-conf-file=..\tags\poi-mapping.xml comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="..\jpmap\chugoku.osm.pbf"  --poi-writer file="chugoku.osm.poi"  tag-conf-file=..\tags\poi-mapping.xml comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="..\jpmap\shikoku.osm.pbf"  --poi-writer file="chugoku.osm.poi"  tag-conf-file=..\tags\poi-mapping.xml comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="..\jpmap\kyushu.osm.pbf"  --poi-writer file="kyushu.osm.poi"  tag-conf-file=..\tags\poi-mapping.xml comment="%date% made by Yuji Ueno" 
 + > osmosis --read-pbf file="..\jpmap\honshu.osm.pbf"  --poi-writer file="honshu.osm.poi"  tag-conf-file=..\tags\poi-mapping.xml comment="%date% made by Yuji Ueno" 
 + 
 +これで,北海道(hokkaido.osm.poi),東北(tohoku.osm.poi),関東(kanto.osm.poi),中部(chubu.osm.poi),近畿(kinki.osm.poi),中国(chugoku.osm.poi),四国(shikoku.osm.poi),九州(kyushu.osm.poi),本州(honshu.osm.poi)のMapsforge形式のPOI DBファイルが作成できた。 
 + 
 +** Mapsforge POI DBをLocus MapのオフラインPOI DBに変換する [#s7194f4c] 
 +Locus Mapでは,残念ながらMapsforge POI DBは使用できない。~ 
 +MapsforgeライブラリでPOI DBがサポートされる前から,Locus MapではオフラインPOI機能を搭載するため独自にオフラインPOI DBを作成していた。なので独自フォーマットなのはしょうがない。~ 
 +またこのLoMapの一部であるオフラインPOI DBは,住所検索用のDBデータも入っている。 
 + 
 +LoMapsのオフラインPOI DBのフォーマットは公開されていないので,LoMapsを購入しないとオフラインPOI DBを使用することは出来なかったが,独自にフォーマットを解析した人が[[仕様を公開してくれている>https://gitlab.com/noschinl/locus-poi-db]] ;) ~ 
 +このおかげかどうかはわからないが[[OpenAndroMaps>http://www.openandromaps.org/en/]]でも,2020/07ぐらいからLocus Mapで使用できるオフラインPOI DB(住所検索DBは含まれていない)をサポートしている。~ 
 + 
 +また,Mapsforge POI DBをLocus Mapのoffline POI DBに変換するツール[[poi_converter>https://github.com/lieblerj/poi_converter]]が公開されているので,このツールを使ってLocus Map用のオフラインPOI DBを作成してみた。しかし,住所検索用のデータは残念ながら変換できないようだ。~ 
 + > python poiconverter.py -if poi -om create hokkaido.osm.poi hokkaido.osm.db 
 + > python poiconverter.py -if poi -om create tohoku.osm.poi  tohoku.osm.db 
 + > python poiconverter.py -if poi -om create kanto.osm.poi    kanto.osm.db 
 + > python poiconverter.py -if poi -om create chubu.osm.poi    chubu.osm.db 
 + > python poiconverter.py -if poi -om create kinki.osm.poi    kinki.osm.db 
 + > python poiconverter.py -if poi -om create chugoku.osm.poi  chugoku.osm.db 
 + > python poiconverter.py -if poi -om create shikoku.osm.poi  shikoku.osm.db 
 + > python poiconverter.py -if poi -om create kyushu.osm.poi  kyushu.osm.db 
 + > python poiconverter.py -if poi -om create honshu.osm.poi  honshu.osm.db 
 + 
 +北海道(hokkaido.osm.db),東北(tohoku.osm.db),関東(kanto.osm.db),中部(chubu.osm.db),近畿(kinki.osm.db),中国(chugoku.osm.db),四国(shikoku.osm.db),九州(kyushu.osm.db),本州(honshu.osm.db)のLocus Mapで使えるオフラインPOI DBファイルが作成できた。 
 + 
 +4個または8個のファイルをLocus MapのmapsVectorフォルダーにコピーすると使用できた。~ 
 + 
 +* GeoNamesのデータを住所検索に使う [#ud7a9c17] 
 +上記で作成したオフラインPOI DBファイルでは住所検索が出来ないので,代わりに[[GeoNames>http://www.geonames.org/]]のデータをオフライン住所検索に使ってみる。~ 
 + 
 +GeoNamesの[[ここから>http://download.geonames.org/export/dump/]]JP.zip(日本のデータ)をダウンロードする。~ 
 +JP.zipを解凍してJP.txtをLocus Mapのdata/geoNamesフォルダーにコピーする。~ 
 + 
 +これでLocus Mapの検索を開き「GenoNamesとGNSでオフライン検索」をマークしてファイルの選択でJPを選ぶと,住所検索として使用できた。 
 + 
 +* 作成したベクター地図の確認 [#n1207ad0] 
 +Windowsでも動作する[[Cruiser>https://wiki.openstreetmap.org/wiki/Cruiser]]というツールを使うと,作成した日本のベクター地図をPCで確認することが出来る。上記のthemeファイルやPOI DBファイルを使える。~
-作成した日本のベクターマップは,[[こちら%%(時々更新)%%>https://onedrive.live.com/redir?resid=9D5AE460143634BB%21170]]+Mapsforgeライブラリでの地図の標示は,非常に高速に処理されているのがわかる。

  • 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: 1, yesterday: 0