Skip to content

Commit d014eb3

Browse files
kylemann16gadomski
authored andcommitted
Fix providers usage in pdal-to-stac.py
1 parent 8bf9b1c commit d014eb3

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

examples/example-autzen.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,16 @@
7474
"id": "autzen-classified.copc.laz",
7575
"links": [
7676
{
77-
"href": "https://github.com/PDAL/data/raw/master/autzen/autzen-classified.copc.laz",
77+
"href": "./example-autzen.json",
7878
"rel": "self"
79+
},
80+
{
81+
"href": "https://github.com/PDAL/data/blob/master/LICENSE",
82+
"rel": "license"
7983
}
8084
],
8185
"properties": {
8286
"datetime": "0001-01-02T00:00:00Z",
83-
"item:license": "LICENSE",
84-
"item:provider": "USGS",
8587
"pc:count": 10653336,
8688
"pc:density": 4.664071112,
8789
"pc:schemas": [
@@ -275,7 +277,7 @@
275277
"name": "ScanAngleRank",
276278
"position": 9,
277279
"stddev": 8.484304657,
278-
"variance": 71.9834255
280+
"variance": 71.98342551
279281
},
280282
{
281283
"average": 126.4052859,
@@ -359,6 +361,16 @@
359361
}
360362
],
361363
"pc:type": "lidar",
364+
"providers": [
365+
{
366+
"description": "United States Geological Survey",
367+
"name": "USGS",
368+
"roles": [
369+
"producer"
370+
],
371+
"url": "https://www.usgs.gov"
372+
}
373+
],
362374
"title": "USGS 3DEP LiDAR"
363375
},
364376
"stac_extensions": [

examples/pdal-to-stac.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,21 @@ def convertBBox(obj):
7474
output['type'] = 'Feature'
7575

7676
assets = {'data': {'href': filename}}
77-
#assets['thumbnail'] =
7877
properties = {}
7978

8079
properties['pc:schemas'] = info['schema']['dimensions']
8180
properties['pc:statistics'] = stats['statistic']
8281
properties['title'] = "USGS 3DEP LiDAR"
83-
properties['item:provider'] = "USGS"
84-
properties['item:license'] = 'LICENSE'
82+
properties['providers'] = [
83+
{
84+
"name": "USGS",
85+
"description": "United States Geological Survey",
86+
"roles": [
87+
"producer",
88+
],
89+
"url": "https://www.usgs.gov"
90+
}
91+
]
8592
properties['pc:type'] = 'lidar' # eopc, lidar, radar, sonar
8693
try:
8794
properties['pc:density'] = boundary['avg_pt_per_sq_unit']
@@ -96,10 +103,13 @@ def convertBBox(obj):
96103
output['stac_extensions'] = ['https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json']
97104
output['stac_version'] = '1.0.0'
98105

99-
link = {'rel':'self',"href":filename}
100-
output['links'] = [link]
101-
102106
example_dir = Path(__file__).parent
103-
with open(example_dir/'example-autzen.json', 'w') as autzen_out:
107+
out_filename = str(example_dir/'example-autzen.json')
108+
109+
self_link = {'rel':'self',"href":'./example-autzen.json'}
110+
lic_link = {'rel':'license',"href":'https://github.com/PDAL/data/blob/master/LICENSE'}
111+
output['links'] = [self_link, lic_link]
112+
113+
with open(out_filename, 'w') as autzen_out:
104114
autzen_out.write(json.dumps(output, sort_keys=True, indent=2,
105115
separators=(',', ': ')))

0 commit comments

Comments
 (0)