-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_datafangst.py
More file actions
56 lines (44 loc) · 1.51 KB
/
test_datafangst.py
File metadata and controls
56 lines (44 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from pnvdb.var import auth
import pnvdb
import pprint
import json
import geojson
import time
if __name__ == '__main__':
pp = pprint.PrettyPrinter(indent=4)
username = auth.username
password = auth.password
contractId = '7168c19c-e637-48fd-9771-61eb43c53d6f'
datafangst = pnvdb.Datafangst(username, password, contractId)
point = (10.39241731, 63.43053048)
poly = [(10.39241731, 63.43053048),
(10.39272171, 63.42909269),
(10.39579151, 63.42898665),
(10.39495434, 63.43043698),
(10.39241731, 63.43053048),
]
line = [(10.2, 63.4),
(10.3, 63.4),
(10.3, 63.5),
]
feature1 = datafangst.feature(96, point, "Skilt")
feature1.attribute(5530,8879)
feature1.comment("Fra Pnvdb")
feature2 = datafangst.feature(5, line, 'rekkverk')
feature2.attribute(1089,13749)
feature2.attribute(1248,4591)
feature2.attribute(9591,13811)
feature2.comment("Fra Pnvdb")
feature3 = datafangst.feature(15, poly, 'Gras')
feature3.attribute(4129,5092)
feature3.comment("Fra Pnvdb")
print(feature1.attribute)
datafangst_collection = datafangst.feature_collection()
datafangst_collection.add_feature(feature1)
datafangst_collection.add_feature(feature2)
datafangst_collection.add_feature(feature3)
pushed = datafangst_collection.push()
print(pushed)
print(datafangst_collection.status())
time.sleep(3)
print(datafangst_collection.status())