-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtester.py
More file actions
17 lines (14 loc) · 710 Bytes
/
tester.py
File metadata and controls
17 lines (14 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pygeoj as gj
testfile = gj.new()
testfile.add_feature(geometry=gj.Geometry(type="Point", coordinates=[(11,11)]),
properties=dict(hello=1, world=2))
testfile.add_feature(geometry=gj.Geometry(type="Point", coordinates=[(12,12)]),
properties=dict(hello=1, world=2))
for feat in testfile:
feat.properties["new"] = "stuff"
feat.geometry.coordinates = (99,99)
#feat.properties = dict(new="shit")
#feat.geometry = gj.Geometry(type="Point", coordinates=(7777,7777))
print("hmm", feat.geometry, feat.properties, feat.__geo_interface__)
for feat in testfile:
print(feat, feat.geometry, feat.properties, feat.__geo_interface__, feat.validate())