codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
s2092651@031986 Tue Jul 02 11:11:05 ~/Downloads $ unzip 1259030001_ste11aaust_shape.zip Archive: 1259030001_ste11aaust_shape.zip inflating: STE11aAust.shx extracting: STE11aAust.cpg inflating: STE11aAust.dbf inflating: STE11aAust.prj inflating: STE11aAust.shp s2092651@031986 Tue Jul 02 11:11:11 ~/Downloads $ python Python 2.7.3 (default, Feb 25 2013, 15:08:30) [GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.24)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from fiona import open >>> records = list(open("STE11aAust.shp", "r")) >>> len(records) 9 >>> from pprint import pprint >>> for record in records: ... pprint(record["properties"]) ... {'STATE_CODE': u'1', 'STATE_NAME': u'New South Wales'} {'STATE_CODE': u'2', 'STATE_NAME': u'Victoria'} {'STATE_CODE': u'3', 'STATE_NAME': u'Queensland'} {'STATE_CODE': u'4', 'STATE_NAME': u'South Australia'} {'STATE_CODE': u'5', 'STATE_NAME': u'Western Australia'} {'STATE_CODE': u'6', 'STATE_NAME': u'Tasmania'} {'STATE_CODE': u'7', 'STATE_NAME': u'Northern Territory'} {'STATE_CODE': u'8', 'STATE_NAME': u'Australian Capital Territory'} {'STATE_CODE': u'9', 'STATE_NAME': u'Other Territories'} >>>
Private
[
?
]
Run code
Submit