2016-07-14 39 views
0

如何列出形狀文件中屬性的值。列表形狀文件的屬性值ogrinfo/ogr2ogr

ogrinfo -so -al build/SLA11aAust.shp顯示屬性。哪個命令列出STATE_CODE值:

Layer name: SLA11aAust 
 
Geometry: Polygon 
 
Feature Count: 1390 
 
Extent: (96.816941, -43.740510) - (159.109219, -9.142176) 
 
Layer SRS WKT: 
 
GEOGCS["GCS_GDA_1994", 
 
    DATUM["Geocentric_Datum_of_Australia_1994", 
 
     SPHEROID["GRS_1980",6378137,298.257222101]], 
 
    PRIMEM["Greenwich",0], 
 
    UNIT["Degree",0.017453292519943295]] 
 
STATE_CODE: String (1.0) 
 
SLA_CODE11: String (9.0) 
 
SLA_NAME11: String (50.0) 
 
SLA_5DIGIT: String (5.0) 
 
SLA_REG11: String (9.0)

回答

0

基於this post,你可以做這樣的事情:

ogrinfo SLA11aAust.shp -dialect sqlite -sql "select STATE_CODE from SLA11aAust" 

你可以再細化使用SQLite語句在SQL查詢訂購結果或匹配特定的參數組合。