@@ -38,17 +38,15 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
38
38
"namespace" : "http://www.opengis.net/ogcapi-features-1/1.0" }},
39
39
"description" : {"type" : "string" , "xml" : {"name" : "Description" ,
40
40
"namespace" : "http://www.opengis.net/ogcapi-features-1/1.0" }},
41
- "links" : {"type" : "array" , "xml" : {"name" : "link" ,
42
- "namespace" : "http://www.w3.org/2005/Atom" },
41
+ "links" : {"type" : "array" , "xml" : {"name" : "link" ,"namespace" : "http://www.w3.org/2005/Atom" },
43
42
"items" : {"$ref" : "#/components/schemas/Link" }},
44
43
"extent" : {"$ref" : "#/components/schemas/Extent" },
45
44
"itemType" : {"type" : "string" },
46
45
"crs" : {"type" : "array" , "items" : {"type" : "string" }},
47
46
"storageCrs" : {"type" : "string" }}, "xml" : {"name" : "Collection" ,
48
47
"namespace" : "http://www.opengis.net/ogcapi-features-1/1.0" }},
49
48
"Collections" : {"type" : "object" , "properties" : {
50
- "links" : {"type" : "array" , "xml" : {"name" : "link" ,
51
- "namespace" : "http://www.w3.org/2005/Atom" },
49
+ "links" : {"type" : "array" , "xml" : {"name" : "link" ,"namespace" : "http://www.w3.org/2005/Atom" },
52
50
"items" : {"$ref" : "#/components/schemas/Link" }},
53
51
"collections" : {"type" : "array" , "xml" : {"name" : "Collection" ,
54
52
"namespace" : "http://www.opengis.net/ogcapi-features-1/1.0" },
@@ -66,25 +64,20 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
66
64
"rel" : {"type" : "string" , "xml" : {"attribute" : True }},
67
65
"type" : {"type" : "string" , "xml" : {"attribute" : True }},
68
66
"title" : {"type" : "string" , "xml" : {"attribute" : True }}},
69
- "xml" : {"name" : "link" ,
70
- "namespace" : "http://www.w3.org/2005/Atom" }},
67
+ "xml" : {"name" : "link" ,"namespace" : "http://www.w3.org/2005/Atom" }},
71
68
"Spatial" : {"type" : "object" , "properties" : {"bbox" : {"type" : "array" ,
72
69
"items" : {
73
70
"type" : "array" ,
74
71
"items" : {
75
72
"type" : "number" ,
76
73
"format" : "double" }}},
77
74
"crs" : {"type" : "string" ,
78
- "xml" : {
79
- "attribute" : True }}},
80
- "xml" : {"name" : "SpatialExtent" ,
81
- "namespace" : "http://www.opengis.net/ogcapi-features-1/1.0" }},
75
+ "xml" : {"attribute" : True }}},
76
+ "xml" : {"name" : "SpatialExtent" ,"namespace" : "http://www.opengis.net/ogcapi-features-1/1.0" }},
82
77
"Temporal" : {"type" : "object" , "properties" : {
83
- "interval" : {"type" : "array" ,
84
- "items" : {"type" : "string" , "format" : "date-time" }},
78
+ "interval" : {"type" : "array" ,"items" : {"type" : "string" , "format" : "date-time" }},
85
79
"trs" : {"type" : "string" , "xml" : {"attribute" : True }}},
86
- "xml" : {"name" : "TemporalExtent" ,
87
- "namespace" : "http://www.opengis.net/ogcapi-features-1/1.0" }},
80
+ "xml" : {"name" : "TemporalExtent" ,"namespace" : "http://www.opengis.net/ogcapi-features-1/1.0" }},
88
81
"LandingPage" : {"type" : "object" }}}
89
82
landingpagejson = {"title" : "Landing Page" , "description" : "Landing Page" , "links" : [{
90
83
"href" : str (deploypath ) + "/index.json" ,
@@ -132,7 +125,7 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
132
125
"title" : "this document as JSON" },
133
126
{"href" : outpath + "collections/index.html" , "rel" : "self" , "type" : "text/html" ,
134
127
"title" : "this document as HTML" }]}
135
- collectionshtml = "<html><head></head><body><header><h1>Collections of " + str (
128
+ collectionshtml = "<html><head><meta name= \" viewport \" content= \" width=device-width, initial-scale=1 \" />< /head><body><header><h1>Collections of " + str (
136
129
deploypath ) + "</h1></head>{{collectiontable}}<footer><a href=\" index.json\" >This page as JSON</a></footer></body></html>"
137
130
collectiontable = "<table><thead><th>Collection</th><th>Links</th></thead><tbody>"
138
131
apijson ["paths" ]["/collections" ] = {"get" : {"tags" : ["Collections" ], "summary" : "describes collections" ,
@@ -180,8 +173,7 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
180
173
{"href" : str (opweb .replace (".geojson" , "" ) + "/index.ttl" ).replace ("//" , "/" ),
181
174
"rel" : "collection" , "type" : "text/ttl" , "title" : "Collection as TTL" }]})
182
175
currentcollection = {"title" : featurecollectionspaths [coll ]["name" ],
183
- "id" : coll .replace (outpath , "" ).replace ("index.geojson" , "" ).replace (".geojson" ,
184
- "" )[1 :],
176
+ "id" : coll .replace (outpath , "" ).replace ("index.geojson" , "" ).replace (".geojson" ,"" )[1 :],
185
177
"links" : [], "itemType" : "feature" }
186
178
currentcollection ["links" ] = [
187
179
{"href" : opwebcoll + "/items/index.json" , "rel" : "items" , "type" : "application/json" ,
@@ -208,8 +200,7 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
208
200
"/" ), "operationId" : "collection-" + str (
209
201
coll .replace (outpath , "" ).replace ("index.geojson" , "" ).replace (".geojson" , "" )[1 :]),
210
202
"parameters" : [], "responses" : {"default" : {"description" : "default response" , "content" : {
211
- "application/json" : {"schema" : {"$ref" : "#/components/schemas/Collections" },
212
- "example" : None }}}}}}
203
+ "application/json" : {"schema" : {"$ref" : "#/components/schemas/Collections" },"example" : None }}}}}}
213
204
curcollrow = "<tr><td><a href=\" " + opweb .replace (".geojson" , "" ) + "/items/indexc.html\" >" + str (
214
205
featurecollectionspaths [coll ]["name" ]) + "</a></td><td><a href=\" " + opweb .replace (".geojson" ,
215
206
"" ) + "/items/indexc.html\" >[Collection as HTML]</a> <a href=\" " + opweb .replace (
@@ -219,7 +210,7 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
219
210
f .write (json .dumps (currentcollection ))
220
211
f .close ()
221
212
f = open (op + "indexc.html" , "w" , encoding = "utf-8" )
222
- f .write ("<html><head></head><body><h1>" + featurecollectionspaths [coll ][
213
+ f .write ("<html><head><meta name= \" viewport \" content= \" width=device-width, initial-scale=1 \" />< /head><body><h1>" + featurecollectionspaths [coll ][
223
214
"name" ] + "</h1><table><thead><tr><th>Collection</th><th>Links</th></tr></thead><tbody>" + str (
224
215
curcollrow ) + "</tbody></table></html>" )
225
216
f .close ()
@@ -350,7 +341,7 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
350
341
print (e )
351
342
if mergeJSON :
352
343
result .append (curcoll )
353
- collectiontable += "</tbody></table>"
344
+ collectiontable += "</tbody></table>"
354
345
if mergeJSON :
355
346
with open (outpath + "/features.js" , 'w' , encoding = "utf-8" ) as output_file :
356
347
output_file .write ("var featurecolls=" + json .dumps (result ))
0 commit comments