-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add note about deploying geolocator bucket content along side new code.
- Loading branch information
Pascal Vautour
committed
Feb 8, 2024
1 parent
2c3fa75
commit 8307358
Showing
16 changed files
with
1,896 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
docs/lambda/geolocator/geolocator-bucket-content/api/in-api-schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "API Geolocator Input Config Schema", | ||
"type": "object", | ||
"version": 1.0, | ||
"comments": "Schema for GeoView-API-geolocator input-query. The items inside parameters properties are the parameters provided by the URL.", | ||
|
||
"properties": { | ||
"params": { | ||
"type": "object", | ||
"description": "Query parameter coming from the API call url", | ||
"properties": { | ||
"querystring": { | ||
"type": "array", | ||
"description": "Dictionary containing the parameters and values passed with the url", | ||
"properties": { | ||
"q": { | ||
"type": "string", | ||
"default": "none", | ||
"description": "The query to parse and send to supported API's." | ||
}, | ||
"lang": { | ||
"type": "string", | ||
"enum": ["en", "fr"], | ||
"default" : "en", | ||
"description": "The language on wich to filter the query." | ||
}, | ||
"dev": { | ||
"type": "string", | ||
"enum": ["true", "false"], | ||
"default" : "false", | ||
"description": "show fields that are null or undefined" | ||
}, | ||
"table": { | ||
"type": "string", | ||
"enum": ["category", "component", "generic", "province", "tableurl", "none"], | ||
"default" : "none", | ||
"description": "return json dump of table" | ||
}, | ||
"keys": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { | ||
"type": "string", | ||
"enum": ["geonames", "nominatim", "locate"] | ||
}, | ||
"description": "The list of supported API key to query. Optional parameter, if missing, all supported key will be query." | ||
} | ||
}, | ||
"required": ["q","table"], | ||
"requiredAll": "false", | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["querystring"], | ||
"additionalProperties": false | ||
} | ||
}, | ||
"required": ["params"], | ||
"additionalProperties": false | ||
} |
113 changes: 113 additions & 0 deletions
113
docs/lambda/geolocator/geolocator-bucket-content/api/out-api-schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "API Geolocator Output Config Schema", | ||
"type": "object", | ||
"version": 1.0, | ||
"comments": "Schema for GeoView-API-geolocator output-query results.", | ||
"additionalProperties": false, | ||
|
||
"definitions": { | ||
"output": { | ||
"type": "array", | ||
"description": "Array of results were each item is the output from the requested API key.", | ||
"items": { | ||
"type": "object", | ||
"properties": { | ||
"key": { | ||
"type": "string", | ||
"description": "Origin API key value." | ||
}, | ||
"name": { | ||
"type": "string", | ||
"description": "Name information of the item." | ||
}, | ||
"lat": { | ||
"type": "number", | ||
"minimum": -90, | ||
"maximum": 90, | ||
"description": "Latitude of the item." | ||
}, | ||
"lng": { | ||
"type": "number", | ||
"minimum": -180, | ||
"maximum": 180, | ||
"description": "Longitude of the item." | ||
}, | ||
"bbox": { | ||
"type": "array", | ||
"minItems": 4, | ||
"items": [ | ||
{ | ||
"type": "number", | ||
"minimum": -180, | ||
"maximum": 180, | ||
"description": "West border of the bounding box." | ||
}, | ||
{ | ||
"type": "number", | ||
"minimum": -90, | ||
"maximum": 90, | ||
"description": "South border of the bounding box." | ||
}, | ||
{ | ||
"type": "number", | ||
"minimum": -180, | ||
"maximum": 180, | ||
"description": "East border of the bounding box." | ||
}, | ||
{ | ||
"type": "number", | ||
"minimum": -90, | ||
"maximum": 90, | ||
"description": "North border of the bounding box." | ||
} | ||
], | ||
"description": "The bbox of the item [minX, minY, maxX, maxY]. Optional return value." | ||
}, | ||
"province": { | ||
"type": "string", | ||
"description": "The province the item belongs to. Optional return value, may be derived from the name parameter." | ||
}, | ||
"tag": { | ||
"type": "array", | ||
"minItems": 0, | ||
"items": { | ||
"type": "string", | ||
"description": "The content of this field might vary depending of the sources." | ||
}, | ||
"description": "The tag value of the item. Optional return value. tags may be different from one API to the other, it is a value to help understand what type of item it is." | ||
} | ||
}, | ||
"required": ["name", "lat", "lng"], | ||
"additionalProperties": false | ||
} | ||
} | ||
}, | ||
"properties": { | ||
"geonames": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { "$ref": "#/definitions/output" }, | ||
"description": "The Geoname api result set." | ||
}, | ||
"nominatim": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { "$ref": "#/definitions/output" }, | ||
"description": "The Nominatim api result set." | ||
}, | ||
"locate": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { "$ref": "#/definitions/output" }, | ||
"description": "The locate api result set." | ||
}, | ||
"nts": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { "$ref": "#/definitions/output" }, | ||
"description": "The ens api result set." | ||
} | ||
}, | ||
"description": "List of supported key for the API. As we add key, we need to had an entry in the schema. The entry MUST be the same key as the in in-api-schema.json (keys enum parameter)." | ||
} |
9 changes: 9 additions & 0 deletions
9
docs/lambda/geolocator/geolocator-bucket-content/services/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# in-api-schema keys parameter | ||
|
||
valid keys: geonames, nominatim and locate. | ||
|
||
nts key (https://geogratis.gc.ca/services/delimitation/en/nts) not used as there is no query parameter (only search by spatial bbox). | ||
Static table and filtering capacity would need to be implemented. | ||
|
||
|
||
|
55 changes: 55 additions & 0 deletions
55
docs/lambda/geolocator/geolocator-bucket-content/services/findplace-schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"url" : "https://maps.googleapis.com/maps/api/place/findplacefromtext/json", | ||
|
||
"urlParams" : { | ||
}, | ||
"staticParams" : { | ||
"inputtype" : "textquery", | ||
"fields" : "name,geometry", | ||
"key" : "AIzaSyASQcYTDCw4fRr_GY5WHxIAqeTsDmvAh_8" | ||
}, | ||
"urlCodeTables" : {}, | ||
"lookup" : { | ||
"in" : { | ||
"q" : "input" | ||
}, | ||
"out" : { | ||
"structure" : { | ||
"type": "dict", | ||
"key": "candidates" | ||
}, | ||
"data" : { | ||
"name": { | ||
"field": "name", | ||
"lookup": "" | ||
}, | ||
"lat": { | ||
"field":"geometry.location.lat", | ||
"lookup": "" | ||
}, | ||
"lng": { | ||
"field": "geometry.location.lng", | ||
"lookup": "" | ||
}, | ||
"bbox" : [ | ||
{ | ||
"field": "geometry.viewport.southwest.lng", | ||
"lookup": "" | ||
}, | ||
{ | ||
"field": "geometry.viewport.southwest.lat", | ||
"lookup": "" | ||
}, | ||
{ | ||
"field": "geometry.viewport.northeast.lng", | ||
"lookup": "" | ||
}, | ||
{ | ||
"field": "geometry.viewport.northeast.lat", | ||
"lookup": "" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
docs/lambda/geolocator/geolocator-bucket-content/services/geocode-schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"url" : "https://maps.googleapis.com/maps/api/geocode/json", | ||
|
||
"urlParams" : { | ||
}, | ||
"staticParams" : { | ||
"key" : "AIzaSyASQcYTDCw4fRr_GY5WHxIAqeTsDmvAh_8" | ||
}, | ||
"urlCodeTables" : {}, | ||
"lookup" : { | ||
"in" : { | ||
"q" : "address" | ||
}, | ||
"out" : { | ||
"structure" : { | ||
"type": "dict", | ||
"key": "results" | ||
}, | ||
"data" : { | ||
"name": { | ||
"field": "formatted_address", | ||
"lookup": "" | ||
}, | ||
"lat": { | ||
"field":"geometry.location.lat", | ||
"lookup": "" | ||
}, | ||
"lng": { | ||
"field": "geometry.location.lng", | ||
"lookup": "" | ||
}, | ||
"bbox" : [ | ||
{ | ||
"field": "geometry.viewport.southwest.lng", | ||
"lookup": "" | ||
}, | ||
{ | ||
"field": "geometry.viewport.southwest.lat", | ||
"lookup": "" | ||
}, | ||
{ | ||
"field": "geometry.viewport.northeast.lng", | ||
"lookup": "" | ||
}, | ||
{ | ||
"field": "geometry.viewport.northeast.lat", | ||
"lookup": "" | ||
} | ||
], | ||
"province": { | ||
"field": "address_components", | ||
"lookup": { | ||
"type": "search", | ||
"search_field": "types", | ||
"contains": "administrative_area_level_1", | ||
"return_field": "long_name" | ||
} | ||
}, | ||
"tag": { | ||
"field": "types", | ||
"lookup": "" | ||
} | ||
|
||
} | ||
} | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
docs/lambda/geolocator/geolocator-bucket-content/services/geonames-schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"url": "https://geogratis.gc.ca/services/geoname/_PARAM1_/geonames.json", | ||
"urlParams": { | ||
"param1": "lang" | ||
}, | ||
"staticParams": {}, | ||
"urlCodeTables": { | ||
"province" : { | ||
"url": "https://geogratis.gc.ca/services/geoname/_PARAM1_/codes/province.json", | ||
"type": "array", | ||
"name": "definitions", | ||
"fields": { | ||
"code": "code", | ||
"description": "description" | ||
} | ||
}, | ||
"generic": { | ||
"url": "https://geogratis.gc.ca/services/geoname/_PARAM1_/codes/generic.json", | ||
"type": "array", | ||
"name": "definitions", | ||
"fields": { | ||
"code": "code", | ||
"description": "term" | ||
} | ||
} | ||
}, | ||
"lookup": { | ||
"in": { | ||
"q": "q" | ||
}, | ||
"out": { | ||
"structure" : { | ||
"type": "dict", | ||
"key": "items" | ||
}, | ||
"data": { | ||
"name": { | ||
"field": "name", | ||
"lookup": "" | ||
}, | ||
"province": { | ||
"field": "province.code", | ||
"lookup": { | ||
"type": "table", | ||
"field": "description" | ||
} | ||
}, | ||
"category": { | ||
"field": "generic.code", | ||
"lookup": { | ||
"type": "table", | ||
"field": "term" | ||
} | ||
}, | ||
"lat": { | ||
"field":"latitude", | ||
"lookup": "" | ||
}, | ||
"lng": { | ||
"field": "longitude", | ||
"lookup": "" | ||
}, | ||
"bbox": { | ||
"field": "bbox", | ||
"lookup": "" | ||
}, | ||
"tag": [ | ||
{ | ||
"field": "location", | ||
"lookup": "" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.