Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 78a3e4f

Browse files
fix documentation
1 parent 79d9bdd commit 78a3e4f

File tree

3 files changed

+64
-21
lines changed

3 files changed

+64
-21
lines changed

docs/notebooks/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
The example notebooks in this directory demonstrate various functionalities of `HERE Location Services`.
44

55
## Prerequisites
6+
67
Before you run the Notebooks make sure you have:
8+
79
- A HERE developer account, free and available under [HERE Developer Portal](https://developer.here.com)
810
- An [API key](https://developer.here.com/documentation/identity-access-management/dev_guide/topics/dev-apikey.html) from the [HERE Developer Portal](https://developer.here.com)
911

10-
1112
## Preparing for visualization
1213

1314
In order to run these Notebooks, you will need a few third-party dependencies. Please copy the following text to a file name anything you like, e.g. `requirements.txt`:
@@ -23,10 +24,11 @@ For visualization requirements please install [here-map-widget-for-jupyter](http
2324

2425
Follow installation steps from here: [here-map-widget-for-jupyter](https://github.com/heremaps/here-map-widget-for-jupyter#installation).
2526

26-
2727
## Notebooks
2828

2929
- [Location Services](./location_services.ipynb) - Examples of various location services.
3030
- [Restaurant Search](./isoline_routing_restaurant_search.ipynb) - Usecase of restarant search using isoline routing.
3131
- [Routing](./routing.ipynb) - Examples of routing API.
32-
- [Matrix Routing](./matrix_routing.ipynb) - Examples of Matrix routing API.
32+
- [Matrix Routing](./matrix_routing.ipynb) - Examples of Matrix routing API.
33+
- [Autosuggest](./autosuggest.ipynb) - Examples of Autosuggest API.
34+
- [Destination Weather](./destination_weather.ipynb) - Examples of Destination Weather API.

docs/notebooks/destination_weather.ipynb

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 2,
5+
"execution_count": null,
66
"source": [
77
"import os\n",
88
"os.environ[\"LS_API_KEY\"] = \"MY-API-KEY\" # replace your API key here."
@@ -12,7 +12,7 @@
1212
},
1313
{
1414
"cell_type": "code",
15-
"execution_count": 3,
15+
"execution_count": null,
1616
"source": [
1717
"import os\n",
1818
"\n",
@@ -49,22 +49,25 @@
4949
"m.add_layer(layer)\n",
5050
"m"
5151
],
52-
"outputs": [
53-
{
54-
"output_type": "display_data",
55-
"data": {
56-
"text/plain": [
57-
"Map(api_key='TKURWbpJHcbzmWMrmTZwGAdSTLrX8WY1oddj4S4U-EM', basemap=None, center=[19.1621, 73.0008], layers=(Ob…"
58-
],
59-
"application/vnd.jupyter.widget-view+json": {
60-
"version_major": 2,
61-
"version_minor": 0,
62-
"model_id": "91639eb7343842f1a4feefac3738ab95"
63-
}
64-
},
65-
"metadata": {}
66-
}
52+
"outputs": [],
53+
"metadata": {}
54+
},
55+
{
56+
"cell_type": "code",
57+
"execution_count": null,
58+
"source": [
59+
"from geojson import Point\n",
60+
"from datetime import datetime\n",
61+
"\n",
62+
"result2 = ls.get_weather_alerts(\n",
63+
" geometry=Point(coordinates=[15.256, 23.456]),\n",
64+
" start_time=datetime.now(),\n",
65+
" width=3000,\n",
66+
" )\n",
67+
"\n",
68+
"print(result2)"
6769
],
70+
"outputs": [],
6871
"metadata": {}
6972
},
7073
{

docs/source/dest_weather.rst

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,42 @@ hourly_date :func:`datetime.datetime`
5555
one_observation bool optional Boolean, if set to true, the response only includes the closest location. Only available when the `product` parameter is set to `DEST_WEATHER_PRODUCT.observation`.
5656
language str optional Defines the language used in the descriptions in the response.
5757
units :class:`DestWeatherUnits <here_location_services.config.dest_weather_config.DestWeatherUnits>` optional Defines whether units or imperial units are used in the response.
58-
==================== =============================================================================================================== ===
58+
==================== =============================================================================================================== ===
59+
60+
Getting Weather Alerts
61+
----------------------
62+
Can be used to get information on severe weather alerts along a specified route or a single car location.
63+
64+
.. jupyter-execute::
65+
66+
import os
67+
from here_location_services import LS
68+
from geojson import Point
69+
from datetime import datetime
70+
71+
LS_API_KEY = os.environ.get("LS_API_KEY")
72+
ls = LS(api_key=LS_API_KEY)
73+
result = ls.get_weather_alerts(
74+
geometry=Point(coordinates=[15.256, 23.456]),
75+
start_time=datetime.now(),
76+
width=3000,
77+
)
78+
79+
print(result)
80+
81+
82+
Attributes
83+
----------
84+
85+
==================== =============================================================================================================== ===
86+
Attribute Type Doc
87+
==================== =============================================================================================================== ===
88+
geometry Point or LineString or Polygon or MultiPolygon Point or LineString or Polygon or MultiPolygon defining the route or a single location
89+
start_time :func:`datetime.datetime` Start time of the event
90+
id str optional Unique weather alert id.
91+
weather_severity :class:`WeatherSeverity <here_location_services.config.dest_weather_config.WeatherSeverity>` optional Defines the severity of the weather event
92+
weather_type :class:`WeatherType <here_location_services.config.dest_weather_config.WeatherType>` optional Defines the type of the weather event
93+
country str optional String for ISO-3166-1 2-letter country code.
94+
end_time :func:`datetime.datetime` optional End time of the event. If not present, warning is valid until it is not removed from the feed by national weather institutes (valid until warning is present in the response)
95+
width int optional int. default 50000
96+
==================== =============================================================================================================== ===

0 commit comments

Comments
 (0)