9-1 シェイプファイルの属性の情報の確認
最初に、情報を知るために管理ツールをインストールします。
Synaptic パッケージマネージャで gdal-bin を検索してインストールします。
mapdata フォルダへ移動し 110m_cultural フォルダ内の利用可能なレイヤ名を表示します。
nob61@deb8-vmw:~/mapdata/110m_cultural$ cd ../ nob61@deb8-vmw:~/mapdata$ ogrinfo 110m_cultural/ INFO: Open of `110m_cultural/' using driver `ESRI Shapefile' successful. 1: ne_110m_admin_0_countries (Polygon)
次に、population レイヤのデータを表示します。
nob61@deb8-vmw:~/mapdata$ ogrinfo -summary 110m_cultural ne_110m_admin_0_countries
INFO: Open of `110m_cultural' using driver `ESRI Shapefile' successful. Layer name: ne_110m_admin_0_countries Geometry: Polygon Feature Count: 177 Extent: (-180.000000, -90.000000) - (180.000000, 83.645130) Layer SRS WKT: GEOGCS["GCS_WGS_1984", DATUM["WGS_1984", SPHEROID["WGS_84",6378137.0,298.257223563]], PRIMEM["Greenwich",0.0], UNIT["Degree",0.0174532925199433]]
scalerank: Integer (4.0) featurecla: String (30.0) labelrank: Real (16.6) sovereignt: String (254.0) sov_a3: String (254.0) adm0_dif: Real (16.6) level: Real (16.6) type: String (254.0) admin: String (254.0) adm0_a3: String (254.0) geou_dif: Real (16.6) geounit: String (254.0) gu_a3: String (254.0) su_dif: Real (16.6) subunit: String (254.0) su_a3: String (254.0) brk_diff: Real (16.6) name: String (254.0) name_long: String (254.0) brk_a3: String (254.0) brk_name: String (254.0) brk_group: String (254.0) abbrev: String (254.0) postal: String (254.0) formal_en: String (254.0) formal_fr: String (254.0) note_adm0: String (254.0) note_brk: String (254.0) name_sort: String (254.0) name_alt: String (254.0) mapcolor7: Real (16.6) mapcolor8: Real (16.6) mapcolor9: Real (16.6) mapcolor13: Real (16.6) pop_est: Real (16.6) gdp_md_est: Real (16.6) pop_year: Real (16.6) lastcensus: Real (16.6) gdp_year: Real (16.6) economy: String (254.0) income_grp: String (254.0) wikipedia: Real (16.6) fips_10: String (254.0) iso_a2: String (254.0) iso_a3: String (254.0) iso_n3: String (254.0) un_a3: String (254.0) wb_a2: String (254.0) wb_a3: String (254.0) woe_id: Real (16.6) adm0_a3_is: String (254.0) adm0_a3_us: String (254.0) adm0_a3_un: Real (16.6) adm0_a3_wb: Real (16.6) continent: String (254.0) region_un: String (254.0) subregion: String (254.0) region_wb: String (254.0) name_len: Real (16.6) long_len: Real (16.6) abbrev_len: Real (16.6) tiny: Real (16.6) homepart: Real (16.6)
summaryオプションをつけないとレイヤの詳細すべてを表示します。が、データが多いので国名のオプションをつけて表示します。
nob61@deb8-vmw:~/mapdata$ ogrinfo 110m_cultural ne_110m_admin_0_countries -where "name='Japan'"
INFO: Open of `110m_cultural' using driver `ESRI Shapefile' successful. Layer name: ne_110m_admin_0_countries Geometry: Polygon Feature Count: 1 Extent: (-180.000000, -90.000000) - (180.000000, 83.645130) Layer SRS WKT: GEOGCS["GCS_WGS_1984", DATUM["WGS_1984", SPHEROID["WGS_84",6378137.0,298.257223563]], PRIMEM["Greenwich",0.0], UNIT["Degree",0.0174532925199433]]
scalerank: Integer (4.0) featurecla: String (30.0) labelrank: Real (16.6) sovereignt: String (254.0) sov_a3: String (254.0) adm0_dif: Real (16.6) level: Real (16.6) type: String (254.0) admin: String (254.0) adm0_a3: String (254.0) geou_dif: Real (16.6) geounit: String (254.0) gu_a3: String (254.0) su_dif: Real (16.6) subunit: String (254.0) su_a3: String (254.0) brk_diff: Real (16.6) name: String (254.0) name_long: String (254.0) brk_a3: String (254.0) brk_name: String (254.0) brk_group: String (254.0) abbrev: String (254.0) postal: String (254.0) formal_en: String (254.0) formal_fr: String (254.0) note_adm0: String (254.0) note_brk: String (254.0) name_sort: String (254.0) name_alt: String (254.0) mapcolor7: Real (16.6) mapcolor8: Real (16.6) mapcolor9: Real (16.6) mapcolor13: Real (16.6) pop_est: Real (16.6) gdp_md_est: Real (16.6) pop_year: Real (16.6) lastcensus: Real (16.6) gdp_year: Real (16.6) economy: String (254.0) income_grp: String (254.0) wikipedia: Real (16.6) fips_10: String (254.0) iso_a2: String (254.0) iso_a3: String (254.0) iso_n3: String (254.0) un_a3: String (254.0) wb_a2: String (254.0) wb_a3: String (254.0) woe_id: Real (16.6) adm0_a3_is: String (254.0) adm0_a3_us: String (254.0) adm0_a3_un: Real (16.6) adm0_a3_wb: Real (16.6) continent: String (254.0) region_un: String (254.0) subregion: String (254.0) region_wb: String (254.0) name_len: Real (16.6) long_len: Real (16.6) abbrev_len: Real (16.6) tiny: Real (16.6) homepart: Real (16.6) OGRFeature(ne_110m_admin_0_countries):82 scalerank (Integer) = 1 featurecla (String) = Admin-0 country labelrank (Real) = 2.000000 sovereignt (String) = Japan sov_a3 (String) = JPN adm0_dif (Real) = 0.000000 level (Real) = 2.000000 type (String) = Sovereign country admin (String) = Japan adm0_a3 (String) = JPN geou_dif (Real) = 0.000000 geounit (String) = Japan gu_a3 (String) = JPN su_dif (Real) = 0.000000 subunit (String) = Japan su_a3 (String) = JPN brk_diff (Real) = 0.000000 name (String) = Japan name_long (String) = Japan brk_a3 (String) = JPN brk_name (String) = Japan brk_group (String) = (null) abbrev (String) = Japan postal (String) = J formal_en (String) = Japan formal_fr (String) = (null) note_adm0 (String) = (null) note_brk (String) = (null) name_sort (String) = Japan name_alt (String) = (null) mapcolor7 (Real) = 5.000000 mapcolor8 (Real) = 3.000000 mapcolor9 (Real) = 5.000000 mapcolor13 (Real) = 4.000000 pop_est (Real) = 127078679.000000 gdp_md_est (Real) = 4329000.000000 pop_year (Real) = -99.000000 lastcensus (Real) = 2010.000000 gdp_year (Real) = -99.000000 economy (String) = 1. Developed region: G7 income_grp (String) = 1. High income: OECD wikipedia (Real) = -99.000000 fips_10 (String) = (null) iso_a2 (String) = JP iso_a3 (String) = JPN iso_n3 (String) = 392 un_a3 (String) = 392 wb_a2 (String) = JP wb_a3 (String) = JPN woe_id (Real) = -99.000000 adm0_a3_is (String) = JPN adm0_a3_us (String) = JPN adm0_a3_un (Real) = -99.000000 adm0_a3_wb (Real) = -99.000000 continent (String) = Asia region_un (String) = Asia subregion (String) = Eastern Asia region_wb (String) = East Asia & Pacific name_len (Real) = 5.000000 long_len (Real) = 5.000000 abbrev_len (Real) = 5.000000 tiny (Real) = -99.000000 homepart (Real) = 1.000000 MULTIPOLYGON (((134.638428176003885 34.149233710256425,... [続く]
このうち、pop_estが総人口です。
0 件のコメント:
コメントを投稿