2008年6月29日日曜日

グラフィカルなデータ表示 1情報の確認

シェイプファイルの属性を使って、グラフィカルなデータ表示をします。

最初に、マップデータcountries_simplの情報を知るために管理ツールをインストールします。
Synapticパッケージマネージャでgdal-binを検索してインストールします。

dataフォルダへ移動しfreegis_worlddata-0.1_simplフォルダ内の利用可能なレイヤ名を表示します。

~/ka-map/htdocs/data$ ogrinfo freegis_worlddata-0.1_simpl
INFO: Open of `freegis_worlddata-0.1_simpl'
using driver `ESRI Shapefile' successful.
1: countries_simpl (Polygon)
2: population (None)
3: code3166tofibs (None)

次に、populationレイヤのデータを表示します。

~/ka-map/htdocs/data$ ogrinfo -summary freegis_worlddata-0.1_simpl countries_simpl
INFO: Open of `freegis_worlddata-0.1_simpl'
using driver `ESRI Shapefile' successful.

Layer name: countries_simpl
Geometry: Polygon
Feature Count: 3901
Extent: (-179.999900, -89.999900) - (179.999900, 83.627357)
Layer SRS WKT:
(unknown)
gid: Real (11.0)
cat: Real (11.0)
fibs: String (2.0)
name: String (255.0)
f_code: String (255.0)
total: Real (11.0)
male: Real (11.0)
female: Real (11.0)
ratio: Real (24.15)

summaryオプションをつけないとレイヤの詳細すべてを表示します。が、データが多いので国名のオプションをつけて表示します。

~/ka-map/htdocs/data$ ogrinfo freegis_worlddata-0.1_simpl countries_simpl -where "name='Nepal'"
INFO: Open of `freegis_worlddata-0.1_simpl'
using driver `ESRI Shapefile' successful.

Layer name: countries_simpl
Geometry: Polygon
Feature Count: 1
Extent: (-179.999900, -89.999900) - (179.999900, 83.627357)
Layer SRS WKT:
(unknown)
gid: Real (11.0)
cat: Real (11.0)
fibs: String (2.0)
name: String (255.0)
f_code: String (255.0)
total: Real (11.0)
male: Real (11.0)
female: Real (11.0)
ratio: Real (24.15)
OGRFeature(countries_simpl):3039
gid (Real) = 39788
cat (Real) = 169
fibs (String) = NP
name (String) = Nepal
f_code (String) = FA001
total (Real) = 27070666
male (Real) = 13897249
female (Real) = 13173417
ratio (Real) = 105.500000000000000
POLYGON ((82.503806999999995 ...(続く)

このうち、totalが総人口、maleが男、femaleが女の人口です。

0 件のコメント: