Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ogr2osmでの変換テスト #3

Open
nyampire opened this issue Jul 11, 2019 · 3 comments
Open

ogr2osmでの変換テスト #3

nyampire opened this issue Jul 11, 2019 · 3 comments

Comments

@nyampire
Copy link
Member

No description provided.

@nyampire
Copy link
Member Author

shapefileから変換するにあたって、shapefileに対して以下の操作を行う必要がある。

  • 属性テーブルが2byteになっているので、1byteに修正 (筆ポリゴン->FUDE, 耕地の種類->TYPEなど)
  • encodingの指定(元ファイルはshift-jisでエンコードされている)については、python2系で動かすと期待通り指定することができる。

例えばこんなかんじのコマンドになる。

python ./ogr2osm.py -t ./translations/fude-trans.py --encoding=CP932 -e 2451 -o ./machida.osm -v -d ./target/13209町田市2019_5.shp 

@nyampire
Copy link
Member Author

fude-trans.pyはこんなかんじ。

https://gist.github.com/nyampire/e84f540db806e421b5865358ad78c888

@nyampire
Copy link
Member Author

以下の順番で処理をかければ、望むファイルを得られそう。

  • オリジナルのshapefileをgeojsonに変換(ESPGを3857へ変更、Encodingをutf-8に変更)
  • 変換後のgeojsonに対して、sedで筆ポリゴン -> FUDE ,耕地の種類 -> TYPEを置換
  • sedで置換したファイルをもう一度shapefileに変換

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant