読者です 読者をやめる 読者になる 読者になる

Geographic Data

Getting Started With GEO, CouchDB, and Node.js

Getting Started With GEO, CouchDB, and Node.js

"Getting Started with GEO, CouchDB and Node.js"を読んでいて、homebrewでGDALをインストールしようとすると失敗したので手動での準備のためのメモ。

GDAL Complete

http://www.kyngchaos.com/software:frameworks
からGDAL Completeをダウンロード>インストール。


~/.zsh_rc等にパスを通す

export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH
% source ~/.zshrc

// サンプルデータ
% git clone https://github.com/dthompson/example_shapefile_to_geojson.git

% cd example_shapefile_to_geojson/110m_lakes/
110m_lakes.dbf 110m_lakes.prj 110m_lakes.shp 110m_lakes.shx
% ogrinfo 110m_lakes.shp
INFO: Open of `110m_lakes.shp'
      using driver `ESRI Shapefile' successful.
1: 110m_lakes (Polygon)

% ogrinfo -so 110m_lakes.shp 110m_lakes 
INFO: Open of `110m_lakes.shp'
      using driver `ESRI Shapefile' successful.

Layer name: 110m_lakes
Geometry: Polygon
Feature Count: 26
Extent: (-124.953634, -16.536406) - (109.929807, 66.969298)
Layer SRS WKT:
GEOGCS["GCS_WGS_1984",
    DATUM["WGS_1984",
        SPHEROID["WGS_1984",6378137.0,298.257223563]],
    PRIMEM["Greenwich",0.0],
    UNIT["Degree",0.0174532925199433]]
ScaleRank: Integer (10.0)
FeatureCla: String (32.0)
Name1: String (254.0)
Name2: String (254.0)

% ogr2ogr -f "GeoJSON" 110m_lakes.json 110m_lakes.shp
% cat 110m_lakes.json 
{
"type": "FeatureCollection",
"features": [ .....