stadiamaps 1.0.6__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stadiamaps/__init__.py +6 -24
- stadiamaps/api/geocoding_api.py +1917 -760
- stadiamaps/api/geospatial_api.py +483 -221
- stadiamaps/api/routing_api.py +1615 -723
- stadiamaps/api_client.py +275 -272
- stadiamaps/api_response.py +12 -16
- stadiamaps/configuration.py +13 -11
- stadiamaps/exceptions.py +67 -30
- stadiamaps/models/__init__.py +5 -23
- stadiamaps/models/access.py +44 -26
- stadiamaps/models/admin_region.py +46 -28
- stadiamaps/models/administrative.py +48 -30
- stadiamaps/models/auto_costing_options.py +69 -48
- stadiamaps/models/auto_costing_options_all_of.py +1 -1
- stadiamaps/models/base_costing_options.py +52 -33
- stadiamaps/models/base_trace_request.py +70 -40
- stadiamaps/models/bicycle_costing_options.py +61 -42
- stadiamaps/models/bicycle_costing_options_all_of.py +1 -1
- stadiamaps/models/bike_network.py +42 -24
- stadiamaps/models/contour.py +45 -27
- stadiamaps/models/coordinate.py +45 -26
- stadiamaps/models/costing_model.py +10 -12
- stadiamaps/models/costing_options.py +51 -33
- stadiamaps/models/directions_options.py +45 -27
- stadiamaps/models/distance_unit.py +8 -11
- stadiamaps/models/edge_sign.py +46 -28
- stadiamaps/models/edge_use.py +8 -11
- stadiamaps/models/end_node.py +48 -30
- stadiamaps/models/geo_attributes.py +47 -29
- stadiamaps/models/geo_json_geometry.py +25 -25
- stadiamaps/models/geo_json_geometry_base.py +45 -27
- stadiamaps/models/geo_json_line_string.py +47 -28
- stadiamaps/models/geo_json_line_string_all_of.py +2 -2
- stadiamaps/models/geo_json_point.py +47 -28
- stadiamaps/models/geo_json_point_all_of.py +2 -2
- stadiamaps/models/geo_json_polygon.py +47 -28
- stadiamaps/models/geo_json_polygon_all_of.py +2 -2
- stadiamaps/models/geocoding_object.py +46 -28
- stadiamaps/models/height_request.py +55 -34
- stadiamaps/models/height_response.py +49 -30
- stadiamaps/models/highway_classification.py +52 -34
- stadiamaps/models/intersecting_edge.py +45 -27
- stadiamaps/models/isochrone_costing_model.py +8 -11
- stadiamaps/models/isochrone_feature.py +45 -27
- stadiamaps/models/isochrone_properties.py +48 -30
- stadiamaps/models/isochrone_request.py +54 -35
- stadiamaps/models/isochrone_response.py +47 -29
- stadiamaps/models/locate_detailed_edge.py +73 -55
- stadiamaps/models/locate_edge.py +56 -39
- stadiamaps/models/locate_edge_info.py +47 -29
- stadiamaps/models/locate_node.py +50 -31
- stadiamaps/models/locate_node_all_of.py +1 -1
- stadiamaps/models/locate_object.py +49 -31
- stadiamaps/models/maneuver_sign.py +50 -32
- stadiamaps/models/maneuver_sign_element.py +45 -27
- stadiamaps/models/map_match_costing_model.py +8 -11
- stadiamaps/models/map_match_request.py +74 -44
- stadiamaps/models/map_match_request_all_of.py +1 -1
- stadiamaps/models/map_match_route_response.py +57 -29
- stadiamaps/models/map_match_route_response_all_of.py +1 -1
- stadiamaps/models/map_match_trace_options.py +47 -29
- stadiamaps/models/map_match_waypoint.py +49 -30
- stadiamaps/models/map_match_waypoint_all_of.py +1 -1
- stadiamaps/models/matched_point.py +52 -34
- stadiamaps/models/matrix_costing_model.py +9 -12
- stadiamaps/models/matrix_distance.py +46 -28
- stadiamaps/models/matrix_request.py +70 -39
- stadiamaps/models/matrix_response.py +60 -36
- stadiamaps/models/motor_scooter_costing_options.py +70 -49
- stadiamaps/models/motor_scooter_costing_options_all_of.py +1 -1
- stadiamaps/models/motorcycle_costing_options.py +69 -48
- stadiamaps/models/motorcycle_costing_options_all_of.py +1 -1
- stadiamaps/models/nearest_roads_request.py +65 -34
- stadiamaps/models/node_id.py +42 -24
- stadiamaps/models/node_type.py +8 -11
- stadiamaps/models/optimized_route_request.py +66 -35
- stadiamaps/models/pedestrian_costing_options.py +59 -40
- stadiamaps/models/pelias_geo_json_feature.py +50 -31
- stadiamaps/models/pelias_geo_json_properties.py +54 -36
- stadiamaps/models/pelias_geo_json_properties_addendum.py +43 -25
- stadiamaps/models/pelias_geo_json_properties_addendum_osm.py +42 -24
- stadiamaps/models/pelias_layer.py +8 -11
- stadiamaps/models/pelias_response.py +49 -30
- stadiamaps/models/pelias_response_geocoding.py +1 -1
- stadiamaps/models/pelias_source.py +8 -11
- stadiamaps/models/restrictions.py +44 -26
- stadiamaps/models/road_class.py +8 -11
- stadiamaps/models/route_leg.py +48 -29
- stadiamaps/models/route_maneuver.py +73 -55
- stadiamaps/models/route_request.py +76 -43
- stadiamaps/models/route_response.py +56 -28
- stadiamaps/models/route_response_alternates_inner.py +105 -0
- stadiamaps/models/route_response_trip.py +1 -1
- stadiamaps/models/route_summary.py +48 -30
- stadiamaps/models/route_trip.py +135 -0
- stadiamaps/models/routing_response_waypoint.py +49 -30
- stadiamaps/models/routing_response_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint.py +60 -41
- stadiamaps/models/routing_waypoint_all_of.py +1 -1
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +48 -30
- stadiamaps/models/simple_routing_waypoint.py +48 -29
- stadiamaps/models/simple_routing_waypoint_all_of.py +1 -1
- stadiamaps/models/speeds.py +49 -31
- stadiamaps/models/trace_attribute_filter_options.py +47 -28
- stadiamaps/models/trace_attribute_key.py +8 -11
- stadiamaps/models/trace_attributes_base_response.py +51 -32
- stadiamaps/models/trace_attributes_request.py +72 -42
- stadiamaps/models/trace_attributes_request_all_of.py +1 -1
- stadiamaps/models/trace_attributes_request_all_of_filters.py +2 -2
- stadiamaps/models/trace_attributes_response.py +54 -35
- stadiamaps/models/trace_attributes_response_all_of.py +1 -1
- stadiamaps/models/trace_edge.py +88 -70
- stadiamaps/models/travel_mode.py +8 -11
- stadiamaps/models/traversability.py +8 -11
- stadiamaps/models/truck_costing_options.py +72 -51
- stadiamaps/models/truck_costing_options_all_of.py +1 -1
- stadiamaps/models/tz_response.py +45 -27
- stadiamaps/models/valhalla_languages.py +8 -11
- stadiamaps/models/valhalla_long_units.py +8 -11
- stadiamaps/models/warning.py +42 -24
- stadiamaps/py.typed +0 -0
- stadiamaps/rest.py +127 -172
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/METADATA +4 -4
- stadiamaps-2.0.0.dist-info/RECORD +128 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/WHEEL +1 -1
- stadiamaps-1.0.6.dist-info/RECORD +0 -125
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/LICENSE.txt +0 -0
- {stadiamaps-1.0.6.dist-info → stadiamaps-2.0.0.dist-info}/top_level.txt +0 -0
stadiamaps/api/geocoding_api.py
CHANGED
@@ -3,61 +3,80 @@
|
|
3
3
|
"""
|
4
4
|
Stadia Maps Geospatial APIs
|
5
5
|
|
6
|
-
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
7
|
|
8
|
-
The version of the OpenAPI document:
|
8
|
+
The version of the OpenAPI document: 6.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
12
12
|
Do not edit the class manually.
|
13
|
-
"""
|
14
|
-
|
13
|
+
""" # noqa: E501
|
15
14
|
|
16
|
-
import re # noqa: F401
|
17
|
-
import io
|
18
15
|
import warnings
|
19
|
-
|
20
|
-
from
|
16
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
17
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
21
18
|
from typing_extensions import Annotated
|
22
19
|
|
23
|
-
from pydantic import Field, StrictFloat, StrictInt, StrictStr
|
24
|
-
|
25
|
-
from
|
26
|
-
|
20
|
+
from pydantic import Field, StrictFloat, StrictInt, StrictStr
|
21
|
+
from typing import List, Optional, Union
|
22
|
+
from typing_extensions import Annotated
|
27
23
|
from stadiamaps.models.pelias_layer import PeliasLayer
|
28
24
|
from stadiamaps.models.pelias_response import PeliasResponse
|
29
25
|
from stadiamaps.models.pelias_source import PeliasSource
|
30
26
|
|
31
|
-
from stadiamaps.api_client import ApiClient
|
27
|
+
from stadiamaps.api_client import ApiClient, RequestSerialized
|
32
28
|
from stadiamaps.api_response import ApiResponse
|
33
|
-
from stadiamaps.
|
34
|
-
ApiTypeError,
|
35
|
-
ApiValueError
|
36
|
-
)
|
29
|
+
from stadiamaps.rest import RESTResponseType
|
37
30
|
|
38
31
|
|
39
|
-
class GeocodingApi
|
32
|
+
class GeocodingApi:
|
40
33
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
41
34
|
Ref: https://openapi-generator.tech
|
42
35
|
|
43
36
|
Do not edit the class manually.
|
44
37
|
"""
|
45
38
|
|
46
|
-
def __init__(self, api_client=None):
|
39
|
+
def __init__(self, api_client=None) -> None:
|
47
40
|
if api_client is None:
|
48
41
|
api_client = ApiClient.get_default()
|
49
42
|
self.api_client = api_client
|
50
43
|
|
51
|
-
@validate_arguments
|
52
|
-
def autocomplete(self, text : Annotated[StrictStr, Field(..., description="The place name (address, venue name, etc.) to search for.")], focus_point_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None, focus_point_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None, boundary_rect_min_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_rect_max_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_rect_min_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_rect_max_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_circle_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None, boundary_circle_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None, boundary_circle_radius : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None, boundary_country : Annotated[Optional[conlist(StrictStr)], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None, boundary_gid : Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None, layers : Annotated[Optional[conlist(PeliasLayer)], Field(description="A list of layers to limit the search to.")] = None, sources : Annotated[Optional[conlist(PeliasSource)], Field(description="A list of sources to limit the search to.")] = None, size : Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None, lang : Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None, **kwargs) -> PeliasResponse: # noqa: E501
|
53
|
-
"""Search and geocode quickly based on partial input. # noqa: E501
|
54
44
|
|
55
|
-
|
56
|
-
|
57
|
-
|
45
|
+
@validate_call
|
46
|
+
def autocomplete(
|
47
|
+
self,
|
48
|
+
text: Annotated[StrictStr, Field(description="The place name (address, venue name, etc.) to search for.")],
|
49
|
+
focus_point_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None,
|
50
|
+
focus_point_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None,
|
51
|
+
boundary_rect_min_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
52
|
+
boundary_rect_max_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
53
|
+
boundary_rect_min_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
54
|
+
boundary_rect_max_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
55
|
+
boundary_circle_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None,
|
56
|
+
boundary_circle_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None,
|
57
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
58
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
59
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
60
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
61
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
62
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
63
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
64
|
+
_request_timeout: Union[
|
65
|
+
None,
|
66
|
+
Annotated[StrictFloat, Field(gt=0)],
|
67
|
+
Tuple[
|
68
|
+
Annotated[StrictFloat, Field(gt=0)],
|
69
|
+
Annotated[StrictFloat, Field(gt=0)]
|
70
|
+
]
|
71
|
+
] = None,
|
72
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
73
|
+
_content_type: Optional[StrictStr] = None,
|
74
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
75
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
76
|
+
) -> PeliasResponse:
|
77
|
+
"""Search and geocode quickly based on partial input.
|
58
78
|
|
59
|
-
|
60
|
-
>>> result = thread.get()
|
79
|
+
Autocomplete enables interactive search-as-you-type user experiences, suggesting places as you type, along with information that will help your users find the correct place quickly.
|
61
80
|
|
62
81
|
:param text: The place name (address, venue name, etc.) to search for. (required)
|
63
82
|
:type text: str
|
@@ -91,32 +110,101 @@ class GeocodingApi(object):
|
|
91
110
|
:type size: int
|
92
111
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
93
112
|
:type lang: str
|
94
|
-
:param async_req: Whether to execute the request asynchronously.
|
95
|
-
:type async_req: bool, optional
|
96
113
|
:param _request_timeout: timeout setting for this request. If one
|
97
114
|
number provided, it will be total request
|
98
115
|
timeout. It can also be a pair (tuple) of
|
99
116
|
(connection, read) timeouts.
|
117
|
+
:type _request_timeout: int, tuple(int, int), optional
|
118
|
+
:param _request_auth: set to override the auth_settings for an a single
|
119
|
+
request; this effectively ignores the
|
120
|
+
authentication in the spec for a single request.
|
121
|
+
:type _request_auth: dict, optional
|
122
|
+
:param _content_type: force content-type for the request.
|
123
|
+
:type _content_type: str, Optional
|
124
|
+
:param _headers: set to override the headers for a single
|
125
|
+
request; this effectively ignores the headers
|
126
|
+
in the spec for a single request.
|
127
|
+
:type _headers: dict, optional
|
128
|
+
:param _host_index: set to override the host_index for a single
|
129
|
+
request; this effectively ignores the host_index
|
130
|
+
in the spec for a single request.
|
131
|
+
:type _host_index: int, optional
|
100
132
|
:return: Returns the result object.
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
133
|
+
""" # noqa: E501
|
134
|
+
|
135
|
+
_param = self._autocomplete_serialize(
|
136
|
+
text=text,
|
137
|
+
focus_point_lat=focus_point_lat,
|
138
|
+
focus_point_lon=focus_point_lon,
|
139
|
+
boundary_rect_min_lat=boundary_rect_min_lat,
|
140
|
+
boundary_rect_max_lat=boundary_rect_max_lat,
|
141
|
+
boundary_rect_min_lon=boundary_rect_min_lon,
|
142
|
+
boundary_rect_max_lon=boundary_rect_max_lon,
|
143
|
+
boundary_circle_lat=boundary_circle_lat,
|
144
|
+
boundary_circle_lon=boundary_circle_lon,
|
145
|
+
boundary_circle_radius=boundary_circle_radius,
|
146
|
+
boundary_country=boundary_country,
|
147
|
+
boundary_gid=boundary_gid,
|
148
|
+
layers=layers,
|
149
|
+
sources=sources,
|
150
|
+
size=size,
|
151
|
+
lang=lang,
|
152
|
+
_request_auth=_request_auth,
|
153
|
+
_content_type=_content_type,
|
154
|
+
_headers=_headers,
|
155
|
+
_host_index=_host_index
|
156
|
+
)
|
157
|
+
|
158
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
159
|
+
'200': "PeliasResponse",
|
160
|
+
'400': None,
|
161
|
+
}
|
162
|
+
response_data = self.api_client.call_api(
|
163
|
+
*_param,
|
164
|
+
_request_timeout=_request_timeout
|
165
|
+
)
|
166
|
+
response_data.read()
|
167
|
+
return self.api_client.response_deserialize(
|
168
|
+
response_data=response_data,
|
169
|
+
response_types_map=_response_types_map,
|
170
|
+
).data
|
171
|
+
|
172
|
+
|
173
|
+
@validate_call
|
174
|
+
def autocomplete_with_http_info(
|
175
|
+
self,
|
176
|
+
text: Annotated[StrictStr, Field(description="The place name (address, venue name, etc.) to search for.")],
|
177
|
+
focus_point_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None,
|
178
|
+
focus_point_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None,
|
179
|
+
boundary_rect_min_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
180
|
+
boundary_rect_max_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
181
|
+
boundary_rect_min_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
182
|
+
boundary_rect_max_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
183
|
+
boundary_circle_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None,
|
184
|
+
boundary_circle_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None,
|
185
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
186
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
187
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
188
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
189
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
190
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
191
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
192
|
+
_request_timeout: Union[
|
193
|
+
None,
|
194
|
+
Annotated[StrictFloat, Field(gt=0)],
|
195
|
+
Tuple[
|
196
|
+
Annotated[StrictFloat, Field(gt=0)],
|
197
|
+
Annotated[StrictFloat, Field(gt=0)]
|
198
|
+
]
|
199
|
+
] = None,
|
200
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
201
|
+
_content_type: Optional[StrictStr] = None,
|
202
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
203
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
204
|
+
) -> ApiResponse[PeliasResponse]:
|
205
|
+
"""Search and geocode quickly based on partial input.
|
206
|
+
|
207
|
+
Autocomplete enables interactive search-as-you-type user experiences, suggesting places as you type, along with information that will help your users find the correct place quickly.
|
120
208
|
|
121
209
|
:param text: The place name (address, venue name, etc.) to search for. (required)
|
122
210
|
:type text: str
|
@@ -150,326 +238,640 @@ class GeocodingApi(object):
|
|
150
238
|
:type size: int
|
151
239
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
152
240
|
:type lang: str
|
153
|
-
:param async_req: Whether to execute the request asynchronously.
|
154
|
-
:type async_req: bool, optional
|
155
|
-
:param _preload_content: if False, the ApiResponse.data will
|
156
|
-
be set to none and raw_data will store the
|
157
|
-
HTTP response body without reading/decoding.
|
158
|
-
Default is True.
|
159
|
-
:type _preload_content: bool, optional
|
160
|
-
:param _return_http_data_only: response data instead of ApiResponse
|
161
|
-
object with status code, headers, etc
|
162
|
-
:type _return_http_data_only: bool, optional
|
163
241
|
:param _request_timeout: timeout setting for this request. If one
|
164
242
|
number provided, it will be total request
|
165
243
|
timeout. It can also be a pair (tuple) of
|
166
244
|
(connection, read) timeouts.
|
245
|
+
:type _request_timeout: int, tuple(int, int), optional
|
167
246
|
:param _request_auth: set to override the auth_settings for an a single
|
168
|
-
request; this effectively ignores the
|
169
|
-
in the spec for a single request.
|
247
|
+
request; this effectively ignores the
|
248
|
+
authentication in the spec for a single request.
|
170
249
|
:type _request_auth: dict, optional
|
171
|
-
:
|
250
|
+
:param _content_type: force content-type for the request.
|
251
|
+
:type _content_type: str, Optional
|
252
|
+
:param _headers: set to override the headers for a single
|
253
|
+
request; this effectively ignores the headers
|
254
|
+
in the spec for a single request.
|
255
|
+
:type _headers: dict, optional
|
256
|
+
:param _host_index: set to override the host_index for a single
|
257
|
+
request; this effectively ignores the host_index
|
258
|
+
in the spec for a single request.
|
259
|
+
:type _host_index: int, optional
|
172
260
|
:return: Returns the result object.
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
'lang'
|
197
|
-
]
|
198
|
-
_all_params.extend(
|
199
|
-
[
|
200
|
-
'async_req',
|
201
|
-
'_return_http_data_only',
|
202
|
-
'_preload_content',
|
203
|
-
'_request_timeout',
|
204
|
-
'_request_auth',
|
205
|
-
'_content_type',
|
206
|
-
'_headers'
|
207
|
-
]
|
261
|
+
""" # noqa: E501
|
262
|
+
|
263
|
+
_param = self._autocomplete_serialize(
|
264
|
+
text=text,
|
265
|
+
focus_point_lat=focus_point_lat,
|
266
|
+
focus_point_lon=focus_point_lon,
|
267
|
+
boundary_rect_min_lat=boundary_rect_min_lat,
|
268
|
+
boundary_rect_max_lat=boundary_rect_max_lat,
|
269
|
+
boundary_rect_min_lon=boundary_rect_min_lon,
|
270
|
+
boundary_rect_max_lon=boundary_rect_max_lon,
|
271
|
+
boundary_circle_lat=boundary_circle_lat,
|
272
|
+
boundary_circle_lon=boundary_circle_lon,
|
273
|
+
boundary_circle_radius=boundary_circle_radius,
|
274
|
+
boundary_country=boundary_country,
|
275
|
+
boundary_gid=boundary_gid,
|
276
|
+
layers=layers,
|
277
|
+
sources=sources,
|
278
|
+
size=size,
|
279
|
+
lang=lang,
|
280
|
+
_request_auth=_request_auth,
|
281
|
+
_content_type=_content_type,
|
282
|
+
_headers=_headers,
|
283
|
+
_host_index=_host_index
|
208
284
|
)
|
209
285
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
_path_params = {}
|
224
|
-
|
225
|
-
# process the query parameters
|
226
|
-
_query_params = []
|
227
|
-
if _params.get('text') is not None: # noqa: E501
|
228
|
-
_query_params.append(('text', _params['text']))
|
229
|
-
|
230
|
-
if _params.get('focus_point_lat') is not None: # noqa: E501
|
231
|
-
_query_params.append(('focus.point.lat', _params['focus_point_lat']))
|
232
|
-
|
233
|
-
if _params.get('focus_point_lon') is not None: # noqa: E501
|
234
|
-
_query_params.append(('focus.point.lon', _params['focus_point_lon']))
|
235
|
-
|
236
|
-
if _params.get('boundary_rect_min_lat') is not None: # noqa: E501
|
237
|
-
_query_params.append(('boundary.rect.min_lat', _params['boundary_rect_min_lat']))
|
238
|
-
|
239
|
-
if _params.get('boundary_rect_max_lat') is not None: # noqa: E501
|
240
|
-
_query_params.append(('boundary.rect.max_lat', _params['boundary_rect_max_lat']))
|
241
|
-
|
242
|
-
if _params.get('boundary_rect_min_lon') is not None: # noqa: E501
|
243
|
-
_query_params.append(('boundary.rect.min_lon', _params['boundary_rect_min_lon']))
|
244
|
-
|
245
|
-
if _params.get('boundary_rect_max_lon') is not None: # noqa: E501
|
246
|
-
_query_params.append(('boundary.rect.max_lon', _params['boundary_rect_max_lon']))
|
247
|
-
|
248
|
-
if _params.get('boundary_circle_lat') is not None: # noqa: E501
|
249
|
-
_query_params.append(('boundary.circle.lat', _params['boundary_circle_lat']))
|
250
|
-
|
251
|
-
if _params.get('boundary_circle_lon') is not None: # noqa: E501
|
252
|
-
_query_params.append(('boundary.circle.lon', _params['boundary_circle_lon']))
|
253
|
-
|
254
|
-
if _params.get('boundary_circle_radius') is not None: # noqa: E501
|
255
|
-
_query_params.append(('boundary.circle.radius', _params['boundary_circle_radius']))
|
286
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
287
|
+
'200': "PeliasResponse",
|
288
|
+
'400': None,
|
289
|
+
}
|
290
|
+
response_data = self.api_client.call_api(
|
291
|
+
*_param,
|
292
|
+
_request_timeout=_request_timeout
|
293
|
+
)
|
294
|
+
response_data.read()
|
295
|
+
return self.api_client.response_deserialize(
|
296
|
+
response_data=response_data,
|
297
|
+
response_types_map=_response_types_map,
|
298
|
+
)
|
256
299
|
|
257
|
-
if _params.get('boundary_country') is not None: # noqa: E501
|
258
|
-
_query_params.append(('boundary.country', _params['boundary_country']))
|
259
|
-
_collection_formats['boundary.country'] = 'csv'
|
260
300
|
|
261
|
-
|
262
|
-
|
301
|
+
@validate_call
|
302
|
+
def autocomplete_without_preload_content(
|
303
|
+
self,
|
304
|
+
text: Annotated[StrictStr, Field(description="The place name (address, venue name, etc.) to search for.")],
|
305
|
+
focus_point_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None,
|
306
|
+
focus_point_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None,
|
307
|
+
boundary_rect_min_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
308
|
+
boundary_rect_max_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
309
|
+
boundary_rect_min_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
310
|
+
boundary_rect_max_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
311
|
+
boundary_circle_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None,
|
312
|
+
boundary_circle_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None,
|
313
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
314
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
315
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
316
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
317
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
318
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
319
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
320
|
+
_request_timeout: Union[
|
321
|
+
None,
|
322
|
+
Annotated[StrictFloat, Field(gt=0)],
|
323
|
+
Tuple[
|
324
|
+
Annotated[StrictFloat, Field(gt=0)],
|
325
|
+
Annotated[StrictFloat, Field(gt=0)]
|
326
|
+
]
|
327
|
+
] = None,
|
328
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
329
|
+
_content_type: Optional[StrictStr] = None,
|
330
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
331
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
332
|
+
) -> RESTResponseType:
|
333
|
+
"""Search and geocode quickly based on partial input.
|
263
334
|
|
264
|
-
|
265
|
-
_query_params.append(('layers', _params['layers']))
|
266
|
-
_collection_formats['layers'] = 'csv'
|
335
|
+
Autocomplete enables interactive search-as-you-type user experiences, suggesting places as you type, along with information that will help your users find the correct place quickly.
|
267
336
|
|
268
|
-
|
269
|
-
|
270
|
-
|
337
|
+
:param text: The place name (address, venue name, etc.) to search for. (required)
|
338
|
+
:type text: str
|
339
|
+
:param focus_point_lat: The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.
|
340
|
+
:type focus_point_lat: float
|
341
|
+
:param focus_point_lon: The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.
|
342
|
+
:type focus_point_lon: float
|
343
|
+
:param boundary_rect_min_lat: Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
344
|
+
:type boundary_rect_min_lat: float
|
345
|
+
:param boundary_rect_max_lat: Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
346
|
+
:type boundary_rect_max_lat: float
|
347
|
+
:param boundary_rect_min_lon: Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
348
|
+
:type boundary_rect_min_lon: float
|
349
|
+
:param boundary_rect_max_lon: Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
350
|
+
:type boundary_rect_max_lon: float
|
351
|
+
:param boundary_circle_lat: The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.
|
352
|
+
:type boundary_circle_lat: float
|
353
|
+
:param boundary_circle_lon: The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.
|
354
|
+
:type boundary_circle_lon: float
|
355
|
+
:param boundary_circle_radius: The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.
|
356
|
+
:type boundary_circle_radius: float
|
357
|
+
:param boundary_country: A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.
|
358
|
+
:type boundary_country: List[str]
|
359
|
+
:param boundary_gid: The Pelias GID of an area to limit the search to.
|
360
|
+
:type boundary_gid: str
|
361
|
+
:param layers: A list of layers to limit the search to.
|
362
|
+
:type layers: List[PeliasLayer]
|
363
|
+
:param sources: A list of sources to limit the search to.
|
364
|
+
:type sources: List[PeliasSource]
|
365
|
+
:param size: The maximum number of results to return.
|
366
|
+
:type size: int
|
367
|
+
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
368
|
+
:type lang: str
|
369
|
+
:param _request_timeout: timeout setting for this request. If one
|
370
|
+
number provided, it will be total request
|
371
|
+
timeout. It can also be a pair (tuple) of
|
372
|
+
(connection, read) timeouts.
|
373
|
+
:type _request_timeout: int, tuple(int, int), optional
|
374
|
+
:param _request_auth: set to override the auth_settings for an a single
|
375
|
+
request; this effectively ignores the
|
376
|
+
authentication in the spec for a single request.
|
377
|
+
:type _request_auth: dict, optional
|
378
|
+
:param _content_type: force content-type for the request.
|
379
|
+
:type _content_type: str, Optional
|
380
|
+
:param _headers: set to override the headers for a single
|
381
|
+
request; this effectively ignores the headers
|
382
|
+
in the spec for a single request.
|
383
|
+
:type _headers: dict, optional
|
384
|
+
:param _host_index: set to override the host_index for a single
|
385
|
+
request; this effectively ignores the host_index
|
386
|
+
in the spec for a single request.
|
387
|
+
:type _host_index: int, optional
|
388
|
+
:return: Returns the result object.
|
389
|
+
""" # noqa: E501
|
390
|
+
|
391
|
+
_param = self._autocomplete_serialize(
|
392
|
+
text=text,
|
393
|
+
focus_point_lat=focus_point_lat,
|
394
|
+
focus_point_lon=focus_point_lon,
|
395
|
+
boundary_rect_min_lat=boundary_rect_min_lat,
|
396
|
+
boundary_rect_max_lat=boundary_rect_max_lat,
|
397
|
+
boundary_rect_min_lon=boundary_rect_min_lon,
|
398
|
+
boundary_rect_max_lon=boundary_rect_max_lon,
|
399
|
+
boundary_circle_lat=boundary_circle_lat,
|
400
|
+
boundary_circle_lon=boundary_circle_lon,
|
401
|
+
boundary_circle_radius=boundary_circle_radius,
|
402
|
+
boundary_country=boundary_country,
|
403
|
+
boundary_gid=boundary_gid,
|
404
|
+
layers=layers,
|
405
|
+
sources=sources,
|
406
|
+
size=size,
|
407
|
+
lang=lang,
|
408
|
+
_request_auth=_request_auth,
|
409
|
+
_content_type=_content_type,
|
410
|
+
_headers=_headers,
|
411
|
+
_host_index=_host_index
|
412
|
+
)
|
271
413
|
|
272
|
-
|
273
|
-
|
414
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
415
|
+
'200': "PeliasResponse",
|
416
|
+
'400': None,
|
417
|
+
}
|
418
|
+
response_data = self.api_client.call_api(
|
419
|
+
*_param,
|
420
|
+
_request_timeout=_request_timeout
|
421
|
+
)
|
422
|
+
return response_data.response
|
423
|
+
|
424
|
+
|
425
|
+
def _autocomplete_serialize(
|
426
|
+
self,
|
427
|
+
text,
|
428
|
+
focus_point_lat,
|
429
|
+
focus_point_lon,
|
430
|
+
boundary_rect_min_lat,
|
431
|
+
boundary_rect_max_lat,
|
432
|
+
boundary_rect_min_lon,
|
433
|
+
boundary_rect_max_lon,
|
434
|
+
boundary_circle_lat,
|
435
|
+
boundary_circle_lon,
|
436
|
+
boundary_circle_radius,
|
437
|
+
boundary_country,
|
438
|
+
boundary_gid,
|
439
|
+
layers,
|
440
|
+
sources,
|
441
|
+
size,
|
442
|
+
lang,
|
443
|
+
_request_auth,
|
444
|
+
_content_type,
|
445
|
+
_headers,
|
446
|
+
_host_index,
|
447
|
+
) -> RequestSerialized:
|
448
|
+
|
449
|
+
_host = None
|
450
|
+
|
451
|
+
_collection_formats: Dict[str, str] = {
|
452
|
+
'boundary.country': 'csv',
|
453
|
+
'layers': 'csv',
|
454
|
+
'sources': 'csv',
|
455
|
+
}
|
274
456
|
|
275
|
-
|
276
|
-
|
457
|
+
_path_params: Dict[str, str] = {}
|
458
|
+
_query_params: List[Tuple[str, str]] = []
|
459
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
460
|
+
_form_params: List[Tuple[str, str]] = []
|
461
|
+
_files: Dict[str, str] = {}
|
462
|
+
_body_params: Optional[bytes] = None
|
277
463
|
|
464
|
+
# process the path parameters
|
465
|
+
# process the query parameters
|
466
|
+
if text is not None:
|
467
|
+
|
468
|
+
_query_params.append(('text', text))
|
469
|
+
|
470
|
+
if focus_point_lat is not None:
|
471
|
+
|
472
|
+
_query_params.append(('focus.point.lat', focus_point_lat))
|
473
|
+
|
474
|
+
if focus_point_lon is not None:
|
475
|
+
|
476
|
+
_query_params.append(('focus.point.lon', focus_point_lon))
|
477
|
+
|
478
|
+
if boundary_rect_min_lat is not None:
|
479
|
+
|
480
|
+
_query_params.append(('boundary.rect.min_lat', boundary_rect_min_lat))
|
481
|
+
|
482
|
+
if boundary_rect_max_lat is not None:
|
483
|
+
|
484
|
+
_query_params.append(('boundary.rect.max_lat', boundary_rect_max_lat))
|
485
|
+
|
486
|
+
if boundary_rect_min_lon is not None:
|
487
|
+
|
488
|
+
_query_params.append(('boundary.rect.min_lon', boundary_rect_min_lon))
|
489
|
+
|
490
|
+
if boundary_rect_max_lon is not None:
|
491
|
+
|
492
|
+
_query_params.append(('boundary.rect.max_lon', boundary_rect_max_lon))
|
493
|
+
|
494
|
+
if boundary_circle_lat is not None:
|
495
|
+
|
496
|
+
_query_params.append(('boundary.circle.lat', boundary_circle_lat))
|
497
|
+
|
498
|
+
if boundary_circle_lon is not None:
|
499
|
+
|
500
|
+
_query_params.append(('boundary.circle.lon', boundary_circle_lon))
|
501
|
+
|
502
|
+
if boundary_circle_radius is not None:
|
503
|
+
|
504
|
+
_query_params.append(('boundary.circle.radius', boundary_circle_radius))
|
505
|
+
|
506
|
+
if boundary_country is not None:
|
507
|
+
|
508
|
+
_query_params.append(('boundary.country', boundary_country))
|
509
|
+
|
510
|
+
if boundary_gid is not None:
|
511
|
+
|
512
|
+
_query_params.append(('boundary.gid', boundary_gid))
|
513
|
+
|
514
|
+
if layers is not None:
|
515
|
+
|
516
|
+
_query_params.append(('layers', layers))
|
517
|
+
|
518
|
+
if sources is not None:
|
519
|
+
|
520
|
+
_query_params.append(('sources', sources))
|
521
|
+
|
522
|
+
if size is not None:
|
523
|
+
|
524
|
+
_query_params.append(('size', size))
|
525
|
+
|
526
|
+
if lang is not None:
|
527
|
+
|
528
|
+
_query_params.append(('lang', lang))
|
529
|
+
|
278
530
|
# process the header parameters
|
279
|
-
_header_params = dict(_params.get('_headers', {}))
|
280
531
|
# process the form parameters
|
281
|
-
_form_params = []
|
282
|
-
_files = {}
|
283
532
|
# process the body parameter
|
284
|
-
|
533
|
+
|
534
|
+
|
285
535
|
# set the HTTP header `Accept`
|
286
536
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
287
|
-
[
|
537
|
+
[
|
538
|
+
'application/json'
|
539
|
+
]
|
540
|
+
)
|
288
541
|
|
289
|
-
# authentication setting
|
290
|
-
_auth_settings = ['ApiKeyAuth'] # noqa: E501
|
291
542
|
|
292
|
-
|
293
|
-
|
294
|
-
'
|
295
|
-
|
543
|
+
# authentication setting
|
544
|
+
_auth_settings: List[str] = [
|
545
|
+
'ApiKeyAuth'
|
546
|
+
]
|
296
547
|
|
297
|
-
return self.api_client.
|
298
|
-
'
|
299
|
-
|
300
|
-
|
301
|
-
|
548
|
+
return self.api_client.param_serialize(
|
549
|
+
method='GET',
|
550
|
+
resource_path='/geocoding/v1/autocomplete',
|
551
|
+
path_params=_path_params,
|
552
|
+
query_params=_query_params,
|
553
|
+
header_params=_header_params,
|
302
554
|
body=_body_params,
|
303
555
|
post_params=_form_params,
|
304
556
|
files=_files,
|
305
|
-
response_types_map=_response_types_map,
|
306
557
|
auth_settings=_auth_settings,
|
307
|
-
async_req=_params.get('async_req'),
|
308
|
-
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
309
|
-
_preload_content=_params.get('_preload_content', True),
|
310
|
-
_request_timeout=_params.get('_request_timeout'),
|
311
558
|
collection_formats=_collection_formats,
|
312
|
-
|
559
|
+
_host=_host,
|
560
|
+
_request_auth=_request_auth
|
561
|
+
)
|
562
|
+
|
313
563
|
|
314
|
-
@validate_arguments
|
315
|
-
def place(self, ids : Annotated[conlist(StrictStr, min_items=1), Field(..., description="A list of Pelias GIDs to search for.")], lang : Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None, **kwargs) -> PeliasResponse: # noqa: E501
|
316
|
-
"""Retrieve details of a place using its GID. # noqa: E501
|
317
564
|
|
318
|
-
Many search result components include an associated GID field (for example, an address may have a `localadmin_gid`). The place endpoint lets you look up these places directly by ID. Note that these IDs are not stable for all sources. See the [online documentation](https://docs.stadiamaps.com/geocoding-search-autocomplete/place-lookup/) for details. # noqa: E501
|
319
|
-
This method makes a synchronous HTTP request by default. To make an
|
320
|
-
asynchronous HTTP request, please pass async_req=True
|
321
565
|
|
322
|
-
|
323
|
-
|
566
|
+
@validate_call
|
567
|
+
def place(
|
568
|
+
self,
|
569
|
+
ids: Annotated[List[StrictStr], Field(min_length=1, description="A list of Pelias GIDs to search for.")],
|
570
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
571
|
+
_request_timeout: Union[
|
572
|
+
None,
|
573
|
+
Annotated[StrictFloat, Field(gt=0)],
|
574
|
+
Tuple[
|
575
|
+
Annotated[StrictFloat, Field(gt=0)],
|
576
|
+
Annotated[StrictFloat, Field(gt=0)]
|
577
|
+
]
|
578
|
+
] = None,
|
579
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
580
|
+
_content_type: Optional[StrictStr] = None,
|
581
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
582
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
583
|
+
) -> PeliasResponse:
|
584
|
+
"""Retrieve details of a place using its GID.
|
585
|
+
|
586
|
+
Many search result components include an associated GID field (for example, an address may have a `localadmin_gid`). The place endpoint lets you look up these places directly by ID. Note that these IDs are not stable for all sources. See the [online documentation](https://docs.stadiamaps.com/geocoding-search-autocomplete/place-lookup/) for details.
|
324
587
|
|
325
588
|
:param ids: A list of Pelias GIDs to search for. (required)
|
326
589
|
:type ids: List[str]
|
327
590
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
328
591
|
:type lang: str
|
329
|
-
:param async_req: Whether to execute the request asynchronously.
|
330
|
-
:type async_req: bool, optional
|
331
592
|
:param _request_timeout: timeout setting for this request. If one
|
332
593
|
number provided, it will be total request
|
333
594
|
timeout. It can also be a pair (tuple) of
|
334
595
|
(connection, read) timeouts.
|
596
|
+
:type _request_timeout: int, tuple(int, int), optional
|
597
|
+
:param _request_auth: set to override the auth_settings for an a single
|
598
|
+
request; this effectively ignores the
|
599
|
+
authentication in the spec for a single request.
|
600
|
+
:type _request_auth: dict, optional
|
601
|
+
:param _content_type: force content-type for the request.
|
602
|
+
:type _content_type: str, Optional
|
603
|
+
:param _headers: set to override the headers for a single
|
604
|
+
request; this effectively ignores the headers
|
605
|
+
in the spec for a single request.
|
606
|
+
:type _headers: dict, optional
|
607
|
+
:param _host_index: set to override the host_index for a single
|
608
|
+
request; this effectively ignores the host_index
|
609
|
+
in the spec for a single request.
|
610
|
+
:type _host_index: int, optional
|
335
611
|
:return: Returns the result object.
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
612
|
+
""" # noqa: E501
|
613
|
+
|
614
|
+
_param = self._place_serialize(
|
615
|
+
ids=ids,
|
616
|
+
lang=lang,
|
617
|
+
_request_auth=_request_auth,
|
618
|
+
_content_type=_content_type,
|
619
|
+
_headers=_headers,
|
620
|
+
_host_index=_host_index
|
621
|
+
)
|
622
|
+
|
623
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
624
|
+
'200': "PeliasResponse",
|
625
|
+
'400': None,
|
626
|
+
}
|
627
|
+
response_data = self.api_client.call_api(
|
628
|
+
*_param,
|
629
|
+
_request_timeout=_request_timeout
|
630
|
+
)
|
631
|
+
response_data.read()
|
632
|
+
return self.api_client.response_deserialize(
|
633
|
+
response_data=response_data,
|
634
|
+
response_types_map=_response_types_map,
|
635
|
+
).data
|
636
|
+
|
637
|
+
|
638
|
+
@validate_call
|
639
|
+
def place_with_http_info(
|
640
|
+
self,
|
641
|
+
ids: Annotated[List[StrictStr], Field(min_length=1, description="A list of Pelias GIDs to search for.")],
|
642
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
643
|
+
_request_timeout: Union[
|
644
|
+
None,
|
645
|
+
Annotated[StrictFloat, Field(gt=0)],
|
646
|
+
Tuple[
|
647
|
+
Annotated[StrictFloat, Field(gt=0)],
|
648
|
+
Annotated[StrictFloat, Field(gt=0)]
|
649
|
+
]
|
650
|
+
] = None,
|
651
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
652
|
+
_content_type: Optional[StrictStr] = None,
|
653
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
654
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
655
|
+
) -> ApiResponse[PeliasResponse]:
|
656
|
+
"""Retrieve details of a place using its GID.
|
657
|
+
|
658
|
+
Many search result components include an associated GID field (for example, an address may have a `localadmin_gid`). The place endpoint lets you look up these places directly by ID. Note that these IDs are not stable for all sources. See the [online documentation](https://docs.stadiamaps.com/geocoding-search-autocomplete/place-lookup/) for details.
|
355
659
|
|
356
660
|
:param ids: A list of Pelias GIDs to search for. (required)
|
357
661
|
:type ids: List[str]
|
358
662
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
359
663
|
:type lang: str
|
360
|
-
:param async_req: Whether to execute the request asynchronously.
|
361
|
-
:type async_req: bool, optional
|
362
|
-
:param _preload_content: if False, the ApiResponse.data will
|
363
|
-
be set to none and raw_data will store the
|
364
|
-
HTTP response body without reading/decoding.
|
365
|
-
Default is True.
|
366
|
-
:type _preload_content: bool, optional
|
367
|
-
:param _return_http_data_only: response data instead of ApiResponse
|
368
|
-
object with status code, headers, etc
|
369
|
-
:type _return_http_data_only: bool, optional
|
370
664
|
:param _request_timeout: timeout setting for this request. If one
|
371
665
|
number provided, it will be total request
|
372
666
|
timeout. It can also be a pair (tuple) of
|
373
667
|
(connection, read) timeouts.
|
668
|
+
:type _request_timeout: int, tuple(int, int), optional
|
374
669
|
:param _request_auth: set to override the auth_settings for an a single
|
375
|
-
request; this effectively ignores the
|
376
|
-
in the spec for a single request.
|
670
|
+
request; this effectively ignores the
|
671
|
+
authentication in the spec for a single request.
|
377
672
|
:type _request_auth: dict, optional
|
378
|
-
:
|
673
|
+
:param _content_type: force content-type for the request.
|
674
|
+
:type _content_type: str, Optional
|
675
|
+
:param _headers: set to override the headers for a single
|
676
|
+
request; this effectively ignores the headers
|
677
|
+
in the spec for a single request.
|
678
|
+
:type _headers: dict, optional
|
679
|
+
:param _host_index: set to override the host_index for a single
|
680
|
+
request; this effectively ignores the host_index
|
681
|
+
in the spec for a single request.
|
682
|
+
:type _host_index: int, optional
|
379
683
|
:return: Returns the result object.
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
684
|
+
""" # noqa: E501
|
685
|
+
|
686
|
+
_param = self._place_serialize(
|
687
|
+
ids=ids,
|
688
|
+
lang=lang,
|
689
|
+
_request_auth=_request_auth,
|
690
|
+
_content_type=_content_type,
|
691
|
+
_headers=_headers,
|
692
|
+
_host_index=_host_index
|
693
|
+
)
|
384
694
|
|
385
|
-
|
695
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
696
|
+
'200': "PeliasResponse",
|
697
|
+
'400': None,
|
698
|
+
}
|
699
|
+
response_data = self.api_client.call_api(
|
700
|
+
*_param,
|
701
|
+
_request_timeout=_request_timeout
|
702
|
+
)
|
703
|
+
response_data.read()
|
704
|
+
return self.api_client.response_deserialize(
|
705
|
+
response_data=response_data,
|
706
|
+
response_types_map=_response_types_map,
|
707
|
+
)
|
386
708
|
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
'_headers'
|
709
|
+
|
710
|
+
@validate_call
|
711
|
+
def place_without_preload_content(
|
712
|
+
self,
|
713
|
+
ids: Annotated[List[StrictStr], Field(min_length=1, description="A list of Pelias GIDs to search for.")],
|
714
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
715
|
+
_request_timeout: Union[
|
716
|
+
None,
|
717
|
+
Annotated[StrictFloat, Field(gt=0)],
|
718
|
+
Tuple[
|
719
|
+
Annotated[StrictFloat, Field(gt=0)],
|
720
|
+
Annotated[StrictFloat, Field(gt=0)]
|
400
721
|
]
|
722
|
+
] = None,
|
723
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
724
|
+
_content_type: Optional[StrictStr] = None,
|
725
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
726
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
727
|
+
) -> RESTResponseType:
|
728
|
+
"""Retrieve details of a place using its GID.
|
729
|
+
|
730
|
+
Many search result components include an associated GID field (for example, an address may have a `localadmin_gid`). The place endpoint lets you look up these places directly by ID. Note that these IDs are not stable for all sources. See the [online documentation](https://docs.stadiamaps.com/geocoding-search-autocomplete/place-lookup/) for details.
|
731
|
+
|
732
|
+
:param ids: A list of Pelias GIDs to search for. (required)
|
733
|
+
:type ids: List[str]
|
734
|
+
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
735
|
+
:type lang: str
|
736
|
+
:param _request_timeout: timeout setting for this request. If one
|
737
|
+
number provided, it will be total request
|
738
|
+
timeout. It can also be a pair (tuple) of
|
739
|
+
(connection, read) timeouts.
|
740
|
+
:type _request_timeout: int, tuple(int, int), optional
|
741
|
+
:param _request_auth: set to override the auth_settings for an a single
|
742
|
+
request; this effectively ignores the
|
743
|
+
authentication in the spec for a single request.
|
744
|
+
:type _request_auth: dict, optional
|
745
|
+
:param _content_type: force content-type for the request.
|
746
|
+
:type _content_type: str, Optional
|
747
|
+
:param _headers: set to override the headers for a single
|
748
|
+
request; this effectively ignores the headers
|
749
|
+
in the spec for a single request.
|
750
|
+
:type _headers: dict, optional
|
751
|
+
:param _host_index: set to override the host_index for a single
|
752
|
+
request; this effectively ignores the host_index
|
753
|
+
in the spec for a single request.
|
754
|
+
:type _host_index: int, optional
|
755
|
+
:return: Returns the result object.
|
756
|
+
""" # noqa: E501
|
757
|
+
|
758
|
+
_param = self._place_serialize(
|
759
|
+
ids=ids,
|
760
|
+
lang=lang,
|
761
|
+
_request_auth=_request_auth,
|
762
|
+
_content_type=_content_type,
|
763
|
+
_headers=_headers,
|
764
|
+
_host_index=_host_index
|
401
765
|
)
|
402
766
|
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
767
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
768
|
+
'200': "PeliasResponse",
|
769
|
+
'400': None,
|
770
|
+
}
|
771
|
+
response_data = self.api_client.call_api(
|
772
|
+
*_param,
|
773
|
+
_request_timeout=_request_timeout
|
774
|
+
)
|
775
|
+
return response_data.response
|
412
776
|
|
413
|
-
_collection_formats = {}
|
414
777
|
|
415
|
-
|
416
|
-
|
778
|
+
def _place_serialize(
|
779
|
+
self,
|
780
|
+
ids,
|
781
|
+
lang,
|
782
|
+
_request_auth,
|
783
|
+
_content_type,
|
784
|
+
_headers,
|
785
|
+
_host_index,
|
786
|
+
) -> RequestSerialized:
|
417
787
|
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
788
|
+
_host = None
|
789
|
+
|
790
|
+
_collection_formats: Dict[str, str] = {
|
791
|
+
'ids': 'csv',
|
792
|
+
}
|
423
793
|
|
424
|
-
|
425
|
-
|
794
|
+
_path_params: Dict[str, str] = {}
|
795
|
+
_query_params: List[Tuple[str, str]] = []
|
796
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
797
|
+
_form_params: List[Tuple[str, str]] = []
|
798
|
+
_files: Dict[str, str] = {}
|
799
|
+
_body_params: Optional[bytes] = None
|
426
800
|
|
801
|
+
# process the path parameters
|
802
|
+
# process the query parameters
|
803
|
+
if ids is not None:
|
804
|
+
|
805
|
+
_query_params.append(('ids', ids))
|
806
|
+
|
807
|
+
if lang is not None:
|
808
|
+
|
809
|
+
_query_params.append(('lang', lang))
|
810
|
+
|
427
811
|
# process the header parameters
|
428
|
-
_header_params = dict(_params.get('_headers', {}))
|
429
812
|
# process the form parameters
|
430
|
-
_form_params = []
|
431
|
-
_files = {}
|
432
813
|
# process the body parameter
|
433
|
-
|
814
|
+
|
815
|
+
|
434
816
|
# set the HTTP header `Accept`
|
435
817
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
436
|
-
[
|
818
|
+
[
|
819
|
+
'application/json'
|
820
|
+
]
|
821
|
+
)
|
437
822
|
|
438
|
-
# authentication setting
|
439
|
-
_auth_settings = ['ApiKeyAuth'] # noqa: E501
|
440
823
|
|
441
|
-
|
442
|
-
|
443
|
-
'
|
444
|
-
|
824
|
+
# authentication setting
|
825
|
+
_auth_settings: List[str] = [
|
826
|
+
'ApiKeyAuth'
|
827
|
+
]
|
445
828
|
|
446
|
-
return self.api_client.
|
447
|
-
'
|
448
|
-
|
449
|
-
|
450
|
-
|
829
|
+
return self.api_client.param_serialize(
|
830
|
+
method='GET',
|
831
|
+
resource_path='/geocoding/v1/place',
|
832
|
+
path_params=_path_params,
|
833
|
+
query_params=_query_params,
|
834
|
+
header_params=_header_params,
|
451
835
|
body=_body_params,
|
452
836
|
post_params=_form_params,
|
453
837
|
files=_files,
|
454
|
-
response_types_map=_response_types_map,
|
455
838
|
auth_settings=_auth_settings,
|
456
|
-
async_req=_params.get('async_req'),
|
457
|
-
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
458
|
-
_preload_content=_params.get('_preload_content', True),
|
459
|
-
_request_timeout=_params.get('_request_timeout'),
|
460
839
|
collection_formats=_collection_formats,
|
461
|
-
|
840
|
+
_host=_host,
|
841
|
+
_request_auth=_request_auth
|
842
|
+
)
|
462
843
|
|
463
|
-
@validate_arguments
|
464
|
-
def reverse(self, point_lat : Annotated[Union[StrictFloat, StrictInt], Field(..., description="The latitude of the point at which to perform the search.")], point_lon : Annotated[Union[StrictFloat, StrictInt], Field(..., description="The longitude of the point at which to perform the search.")], boundary_circle_radius : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None, layers : Annotated[Optional[conlist(PeliasLayer)], Field(description="A list of layers to limit the search to.")] = None, sources : Annotated[Optional[conlist(PeliasSource)], Field(description="A list of sources to limit the search to.")] = None, boundary_country : Annotated[Optional[conlist(StrictStr)], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None, boundary_gid : Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None, size : Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None, lang : Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None, **kwargs) -> PeliasResponse: # noqa: E501
|
465
|
-
"""Find places and addresses near geographic coordinates (reverse geocoding). # noqa: E501
|
466
844
|
|
467
|
-
Reverse geocoding and search finds places and addresses near any geographic coordinates. # noqa: E501
|
468
|
-
This method makes a synchronous HTTP request by default. To make an
|
469
|
-
asynchronous HTTP request, please pass async_req=True
|
470
845
|
|
471
|
-
|
472
|
-
|
846
|
+
|
847
|
+
@validate_call
|
848
|
+
def reverse(
|
849
|
+
self,
|
850
|
+
point_lat: Annotated[Union[Annotated[float, Field(le=90, strict=True, ge=-90)], Annotated[int, Field(le=90, strict=True, ge=-90)]], Field(description="The latitude of the point at which to perform the search.")],
|
851
|
+
point_lon: Annotated[Union[Annotated[float, Field(le=180, strict=True, ge=-180)], Annotated[int, Field(le=180, strict=True, ge=-180)]], Field(description="The longitude of the point at which to perform the search.")],
|
852
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
853
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
854
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
855
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
856
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
857
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
858
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
859
|
+
_request_timeout: Union[
|
860
|
+
None,
|
861
|
+
Annotated[StrictFloat, Field(gt=0)],
|
862
|
+
Tuple[
|
863
|
+
Annotated[StrictFloat, Field(gt=0)],
|
864
|
+
Annotated[StrictFloat, Field(gt=0)]
|
865
|
+
]
|
866
|
+
] = None,
|
867
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
868
|
+
_content_type: Optional[StrictStr] = None,
|
869
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
870
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
871
|
+
) -> PeliasResponse:
|
872
|
+
"""Find places and addresses near geographic coordinates (reverse geocoding).
|
873
|
+
|
874
|
+
Reverse geocoding and search finds places and addresses near any geographic coordinates.
|
473
875
|
|
474
876
|
:param point_lat: The latitude of the point at which to perform the search. (required)
|
475
877
|
:type point_lat: float
|
@@ -489,32 +891,87 @@ class GeocodingApi(object):
|
|
489
891
|
:type size: int
|
490
892
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
491
893
|
:type lang: str
|
492
|
-
:param async_req: Whether to execute the request asynchronously.
|
493
|
-
:type async_req: bool, optional
|
494
894
|
:param _request_timeout: timeout setting for this request. If one
|
495
895
|
number provided, it will be total request
|
496
896
|
timeout. It can also be a pair (tuple) of
|
497
897
|
(connection, read) timeouts.
|
898
|
+
:type _request_timeout: int, tuple(int, int), optional
|
899
|
+
:param _request_auth: set to override the auth_settings for an a single
|
900
|
+
request; this effectively ignores the
|
901
|
+
authentication in the spec for a single request.
|
902
|
+
:type _request_auth: dict, optional
|
903
|
+
:param _content_type: force content-type for the request.
|
904
|
+
:type _content_type: str, Optional
|
905
|
+
:param _headers: set to override the headers for a single
|
906
|
+
request; this effectively ignores the headers
|
907
|
+
in the spec for a single request.
|
908
|
+
:type _headers: dict, optional
|
909
|
+
:param _host_index: set to override the host_index for a single
|
910
|
+
request; this effectively ignores the host_index
|
911
|
+
in the spec for a single request.
|
912
|
+
:type _host_index: int, optional
|
498
913
|
:return: Returns the result object.
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
914
|
+
""" # noqa: E501
|
915
|
+
|
916
|
+
_param = self._reverse_serialize(
|
917
|
+
point_lat=point_lat,
|
918
|
+
point_lon=point_lon,
|
919
|
+
boundary_circle_radius=boundary_circle_radius,
|
920
|
+
layers=layers,
|
921
|
+
sources=sources,
|
922
|
+
boundary_country=boundary_country,
|
923
|
+
boundary_gid=boundary_gid,
|
924
|
+
size=size,
|
925
|
+
lang=lang,
|
926
|
+
_request_auth=_request_auth,
|
927
|
+
_content_type=_content_type,
|
928
|
+
_headers=_headers,
|
929
|
+
_host_index=_host_index
|
930
|
+
)
|
931
|
+
|
932
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
933
|
+
'200': "PeliasResponse",
|
934
|
+
'400': None,
|
935
|
+
}
|
936
|
+
response_data = self.api_client.call_api(
|
937
|
+
*_param,
|
938
|
+
_request_timeout=_request_timeout
|
939
|
+
)
|
940
|
+
response_data.read()
|
941
|
+
return self.api_client.response_deserialize(
|
942
|
+
response_data=response_data,
|
943
|
+
response_types_map=_response_types_map,
|
944
|
+
).data
|
945
|
+
|
946
|
+
|
947
|
+
@validate_call
|
948
|
+
def reverse_with_http_info(
|
949
|
+
self,
|
950
|
+
point_lat: Annotated[Union[Annotated[float, Field(le=90, strict=True, ge=-90)], Annotated[int, Field(le=90, strict=True, ge=-90)]], Field(description="The latitude of the point at which to perform the search.")],
|
951
|
+
point_lon: Annotated[Union[Annotated[float, Field(le=180, strict=True, ge=-180)], Annotated[int, Field(le=180, strict=True, ge=-180)]], Field(description="The longitude of the point at which to perform the search.")],
|
952
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
953
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
954
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
955
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
956
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
957
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
958
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
959
|
+
_request_timeout: Union[
|
960
|
+
None,
|
961
|
+
Annotated[StrictFloat, Field(gt=0)],
|
962
|
+
Tuple[
|
963
|
+
Annotated[StrictFloat, Field(gt=0)],
|
964
|
+
Annotated[StrictFloat, Field(gt=0)]
|
965
|
+
]
|
966
|
+
] = None,
|
967
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
968
|
+
_content_type: Optional[StrictStr] = None,
|
969
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
970
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
971
|
+
) -> ApiResponse[PeliasResponse]:
|
972
|
+
"""Find places and addresses near geographic coordinates (reverse geocoding).
|
973
|
+
|
974
|
+
Reverse geocoding and search finds places and addresses near any geographic coordinates.
|
518
975
|
|
519
976
|
:param point_lat: The latitude of the point at which to perform the search. (required)
|
520
977
|
:type point_lat: float
|
@@ -534,149 +991,296 @@ class GeocodingApi(object):
|
|
534
991
|
:type size: int
|
535
992
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
536
993
|
:type lang: str
|
537
|
-
:param async_req: Whether to execute the request asynchronously.
|
538
|
-
:type async_req: bool, optional
|
539
|
-
:param _preload_content: if False, the ApiResponse.data will
|
540
|
-
be set to none and raw_data will store the
|
541
|
-
HTTP response body without reading/decoding.
|
542
|
-
Default is True.
|
543
|
-
:type _preload_content: bool, optional
|
544
|
-
:param _return_http_data_only: response data instead of ApiResponse
|
545
|
-
object with status code, headers, etc
|
546
|
-
:type _return_http_data_only: bool, optional
|
547
994
|
:param _request_timeout: timeout setting for this request. If one
|
548
995
|
number provided, it will be total request
|
549
996
|
timeout. It can also be a pair (tuple) of
|
550
997
|
(connection, read) timeouts.
|
998
|
+
:type _request_timeout: int, tuple(int, int), optional
|
551
999
|
:param _request_auth: set to override the auth_settings for an a single
|
552
|
-
request; this effectively ignores the
|
553
|
-
in the spec for a single request.
|
1000
|
+
request; this effectively ignores the
|
1001
|
+
authentication in the spec for a single request.
|
554
1002
|
:type _request_auth: dict, optional
|
555
|
-
:
|
1003
|
+
:param _content_type: force content-type for the request.
|
1004
|
+
:type _content_type: str, Optional
|
1005
|
+
:param _headers: set to override the headers for a single
|
1006
|
+
request; this effectively ignores the headers
|
1007
|
+
in the spec for a single request.
|
1008
|
+
:type _headers: dict, optional
|
1009
|
+
:param _host_index: set to override the host_index for a single
|
1010
|
+
request; this effectively ignores the host_index
|
1011
|
+
in the spec for a single request.
|
1012
|
+
:type _host_index: int, optional
|
556
1013
|
:return: Returns the result object.
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
'lang'
|
574
|
-
]
|
575
|
-
_all_params.extend(
|
576
|
-
[
|
577
|
-
'async_req',
|
578
|
-
'_return_http_data_only',
|
579
|
-
'_preload_content',
|
580
|
-
'_request_timeout',
|
581
|
-
'_request_auth',
|
582
|
-
'_content_type',
|
583
|
-
'_headers'
|
584
|
-
]
|
1014
|
+
""" # noqa: E501
|
1015
|
+
|
1016
|
+
_param = self._reverse_serialize(
|
1017
|
+
point_lat=point_lat,
|
1018
|
+
point_lon=point_lon,
|
1019
|
+
boundary_circle_radius=boundary_circle_radius,
|
1020
|
+
layers=layers,
|
1021
|
+
sources=sources,
|
1022
|
+
boundary_country=boundary_country,
|
1023
|
+
boundary_gid=boundary_gid,
|
1024
|
+
size=size,
|
1025
|
+
lang=lang,
|
1026
|
+
_request_auth=_request_auth,
|
1027
|
+
_content_type=_content_type,
|
1028
|
+
_headers=_headers,
|
1029
|
+
_host_index=_host_index
|
585
1030
|
)
|
586
1031
|
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
_path_params = {}
|
601
|
-
|
602
|
-
# process the query parameters
|
603
|
-
_query_params = []
|
604
|
-
if _params.get('point_lat') is not None: # noqa: E501
|
605
|
-
_query_params.append(('point.lat', _params['point_lat']))
|
606
|
-
|
607
|
-
if _params.get('point_lon') is not None: # noqa: E501
|
608
|
-
_query_params.append(('point.lon', _params['point_lon']))
|
609
|
-
|
610
|
-
if _params.get('boundary_circle_radius') is not None: # noqa: E501
|
611
|
-
_query_params.append(('boundary.circle.radius', _params['boundary_circle_radius']))
|
1032
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1033
|
+
'200': "PeliasResponse",
|
1034
|
+
'400': None,
|
1035
|
+
}
|
1036
|
+
response_data = self.api_client.call_api(
|
1037
|
+
*_param,
|
1038
|
+
_request_timeout=_request_timeout
|
1039
|
+
)
|
1040
|
+
response_data.read()
|
1041
|
+
return self.api_client.response_deserialize(
|
1042
|
+
response_data=response_data,
|
1043
|
+
response_types_map=_response_types_map,
|
1044
|
+
)
|
612
1045
|
|
613
|
-
if _params.get('layers') is not None: # noqa: E501
|
614
|
-
_query_params.append(('layers', _params['layers']))
|
615
|
-
_collection_formats['layers'] = 'csv'
|
616
1046
|
|
617
|
-
|
618
|
-
|
619
|
-
|
1047
|
+
@validate_call
|
1048
|
+
def reverse_without_preload_content(
|
1049
|
+
self,
|
1050
|
+
point_lat: Annotated[Union[Annotated[float, Field(le=90, strict=True, ge=-90)], Annotated[int, Field(le=90, strict=True, ge=-90)]], Field(description="The latitude of the point at which to perform the search.")],
|
1051
|
+
point_lon: Annotated[Union[Annotated[float, Field(le=180, strict=True, ge=-180)], Annotated[int, Field(le=180, strict=True, ge=-180)]], Field(description="The longitude of the point at which to perform the search.")],
|
1052
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
1053
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
1054
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
1055
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
1056
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
1057
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
1058
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
1059
|
+
_request_timeout: Union[
|
1060
|
+
None,
|
1061
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1062
|
+
Tuple[
|
1063
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1064
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1065
|
+
]
|
1066
|
+
] = None,
|
1067
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1068
|
+
_content_type: Optional[StrictStr] = None,
|
1069
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1070
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1071
|
+
) -> RESTResponseType:
|
1072
|
+
"""Find places and addresses near geographic coordinates (reverse geocoding).
|
620
1073
|
|
621
|
-
|
622
|
-
_query_params.append(('boundary.country', _params['boundary_country']))
|
623
|
-
_collection_formats['boundary.country'] = 'csv'
|
1074
|
+
Reverse geocoding and search finds places and addresses near any geographic coordinates.
|
624
1075
|
|
625
|
-
|
626
|
-
|
1076
|
+
:param point_lat: The latitude of the point at which to perform the search. (required)
|
1077
|
+
:type point_lat: float
|
1078
|
+
:param point_lon: The longitude of the point at which to perform the search. (required)
|
1079
|
+
:type point_lon: float
|
1080
|
+
:param boundary_circle_radius: The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.
|
1081
|
+
:type boundary_circle_radius: float
|
1082
|
+
:param layers: A list of layers to limit the search to.
|
1083
|
+
:type layers: List[PeliasLayer]
|
1084
|
+
:param sources: A list of sources to limit the search to.
|
1085
|
+
:type sources: List[PeliasSource]
|
1086
|
+
:param boundary_country: A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.
|
1087
|
+
:type boundary_country: List[str]
|
1088
|
+
:param boundary_gid: The Pelias GID of an area to limit the search to.
|
1089
|
+
:type boundary_gid: str
|
1090
|
+
:param size: The maximum number of results to return.
|
1091
|
+
:type size: int
|
1092
|
+
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
1093
|
+
:type lang: str
|
1094
|
+
:param _request_timeout: timeout setting for this request. If one
|
1095
|
+
number provided, it will be total request
|
1096
|
+
timeout. It can also be a pair (tuple) of
|
1097
|
+
(connection, read) timeouts.
|
1098
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1099
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1100
|
+
request; this effectively ignores the
|
1101
|
+
authentication in the spec for a single request.
|
1102
|
+
:type _request_auth: dict, optional
|
1103
|
+
:param _content_type: force content-type for the request.
|
1104
|
+
:type _content_type: str, Optional
|
1105
|
+
:param _headers: set to override the headers for a single
|
1106
|
+
request; this effectively ignores the headers
|
1107
|
+
in the spec for a single request.
|
1108
|
+
:type _headers: dict, optional
|
1109
|
+
:param _host_index: set to override the host_index for a single
|
1110
|
+
request; this effectively ignores the host_index
|
1111
|
+
in the spec for a single request.
|
1112
|
+
:type _host_index: int, optional
|
1113
|
+
:return: Returns the result object.
|
1114
|
+
""" # noqa: E501
|
1115
|
+
|
1116
|
+
_param = self._reverse_serialize(
|
1117
|
+
point_lat=point_lat,
|
1118
|
+
point_lon=point_lon,
|
1119
|
+
boundary_circle_radius=boundary_circle_radius,
|
1120
|
+
layers=layers,
|
1121
|
+
sources=sources,
|
1122
|
+
boundary_country=boundary_country,
|
1123
|
+
boundary_gid=boundary_gid,
|
1124
|
+
size=size,
|
1125
|
+
lang=lang,
|
1126
|
+
_request_auth=_request_auth,
|
1127
|
+
_content_type=_content_type,
|
1128
|
+
_headers=_headers,
|
1129
|
+
_host_index=_host_index
|
1130
|
+
)
|
627
1131
|
|
628
|
-
|
629
|
-
|
1132
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1133
|
+
'200': "PeliasResponse",
|
1134
|
+
'400': None,
|
1135
|
+
}
|
1136
|
+
response_data = self.api_client.call_api(
|
1137
|
+
*_param,
|
1138
|
+
_request_timeout=_request_timeout
|
1139
|
+
)
|
1140
|
+
return response_data.response
|
1141
|
+
|
1142
|
+
|
1143
|
+
def _reverse_serialize(
|
1144
|
+
self,
|
1145
|
+
point_lat,
|
1146
|
+
point_lon,
|
1147
|
+
boundary_circle_radius,
|
1148
|
+
layers,
|
1149
|
+
sources,
|
1150
|
+
boundary_country,
|
1151
|
+
boundary_gid,
|
1152
|
+
size,
|
1153
|
+
lang,
|
1154
|
+
_request_auth,
|
1155
|
+
_content_type,
|
1156
|
+
_headers,
|
1157
|
+
_host_index,
|
1158
|
+
) -> RequestSerialized:
|
1159
|
+
|
1160
|
+
_host = None
|
1161
|
+
|
1162
|
+
_collection_formats: Dict[str, str] = {
|
1163
|
+
'layers': 'csv',
|
1164
|
+
'sources': 'csv',
|
1165
|
+
'boundary.country': 'csv',
|
1166
|
+
}
|
630
1167
|
|
631
|
-
|
632
|
-
|
1168
|
+
_path_params: Dict[str, str] = {}
|
1169
|
+
_query_params: List[Tuple[str, str]] = []
|
1170
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1171
|
+
_form_params: List[Tuple[str, str]] = []
|
1172
|
+
_files: Dict[str, str] = {}
|
1173
|
+
_body_params: Optional[bytes] = None
|
633
1174
|
|
1175
|
+
# process the path parameters
|
1176
|
+
# process the query parameters
|
1177
|
+
if point_lat is not None:
|
1178
|
+
|
1179
|
+
_query_params.append(('point.lat', point_lat))
|
1180
|
+
|
1181
|
+
if point_lon is not None:
|
1182
|
+
|
1183
|
+
_query_params.append(('point.lon', point_lon))
|
1184
|
+
|
1185
|
+
if boundary_circle_radius is not None:
|
1186
|
+
|
1187
|
+
_query_params.append(('boundary.circle.radius', boundary_circle_radius))
|
1188
|
+
|
1189
|
+
if layers is not None:
|
1190
|
+
|
1191
|
+
_query_params.append(('layers', layers))
|
1192
|
+
|
1193
|
+
if sources is not None:
|
1194
|
+
|
1195
|
+
_query_params.append(('sources', sources))
|
1196
|
+
|
1197
|
+
if boundary_country is not None:
|
1198
|
+
|
1199
|
+
_query_params.append(('boundary.country', boundary_country))
|
1200
|
+
|
1201
|
+
if boundary_gid is not None:
|
1202
|
+
|
1203
|
+
_query_params.append(('boundary.gid', boundary_gid))
|
1204
|
+
|
1205
|
+
if size is not None:
|
1206
|
+
|
1207
|
+
_query_params.append(('size', size))
|
1208
|
+
|
1209
|
+
if lang is not None:
|
1210
|
+
|
1211
|
+
_query_params.append(('lang', lang))
|
1212
|
+
|
634
1213
|
# process the header parameters
|
635
|
-
_header_params = dict(_params.get('_headers', {}))
|
636
1214
|
# process the form parameters
|
637
|
-
_form_params = []
|
638
|
-
_files = {}
|
639
1215
|
# process the body parameter
|
640
|
-
|
1216
|
+
|
1217
|
+
|
641
1218
|
# set the HTTP header `Accept`
|
642
1219
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
643
|
-
[
|
1220
|
+
[
|
1221
|
+
'application/json'
|
1222
|
+
]
|
1223
|
+
)
|
644
1224
|
|
645
|
-
# authentication setting
|
646
|
-
_auth_settings = ['ApiKeyAuth'] # noqa: E501
|
647
1225
|
|
648
|
-
|
649
|
-
|
650
|
-
'
|
651
|
-
|
1226
|
+
# authentication setting
|
1227
|
+
_auth_settings: List[str] = [
|
1228
|
+
'ApiKeyAuth'
|
1229
|
+
]
|
652
1230
|
|
653
|
-
return self.api_client.
|
654
|
-
'
|
655
|
-
|
656
|
-
|
657
|
-
|
1231
|
+
return self.api_client.param_serialize(
|
1232
|
+
method='GET',
|
1233
|
+
resource_path='/geocoding/v1/reverse',
|
1234
|
+
path_params=_path_params,
|
1235
|
+
query_params=_query_params,
|
1236
|
+
header_params=_header_params,
|
658
1237
|
body=_body_params,
|
659
1238
|
post_params=_form_params,
|
660
1239
|
files=_files,
|
661
|
-
response_types_map=_response_types_map,
|
662
1240
|
auth_settings=_auth_settings,
|
663
|
-
async_req=_params.get('async_req'),
|
664
|
-
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
665
|
-
_preload_content=_params.get('_preload_content', True),
|
666
|
-
_request_timeout=_params.get('_request_timeout'),
|
667
1241
|
collection_formats=_collection_formats,
|
668
|
-
|
1242
|
+
_host=_host,
|
1243
|
+
_request_auth=_request_auth
|
1244
|
+
)
|
669
1245
|
|
670
|
-
@validate_arguments
|
671
|
-
def search(self, text : Annotated[StrictStr, Field(..., description="The place name (address, venue name, etc.) to search for.")], focus_point_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None, focus_point_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None, boundary_rect_min_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_rect_max_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_rect_min_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_rect_max_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_circle_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None, boundary_circle_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None, boundary_circle_radius : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None, boundary_country : Annotated[Optional[conlist(StrictStr)], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None, boundary_gid : Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None, layers : Annotated[Optional[conlist(PeliasLayer)], Field(description="A list of layers to limit the search to.")] = None, sources : Annotated[Optional[conlist(PeliasSource)], Field(description="A list of sources to limit the search to.")] = None, size : Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None, lang : Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None, **kwargs) -> PeliasResponse: # noqa: E501
|
672
|
-
"""Search for location and other info using a place name or address (forward geocoding). # noqa: E501
|
673
1246
|
|
674
|
-
The search endpoint lets you search for addresses, points of interest, and administrative areas. This is most commonly used for forward geocoding applications where you need to find the geographic coordinates of an address. # noqa: E501
|
675
|
-
This method makes a synchronous HTTP request by default. To make an
|
676
|
-
asynchronous HTTP request, please pass async_req=True
|
677
1247
|
|
678
|
-
|
679
|
-
|
1248
|
+
|
1249
|
+
@validate_call
|
1250
|
+
def search(
|
1251
|
+
self,
|
1252
|
+
text: Annotated[StrictStr, Field(description="The place name (address, venue name, etc.) to search for.")],
|
1253
|
+
focus_point_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None,
|
1254
|
+
focus_point_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None,
|
1255
|
+
boundary_rect_min_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1256
|
+
boundary_rect_max_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1257
|
+
boundary_rect_min_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1258
|
+
boundary_rect_max_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1259
|
+
boundary_circle_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None,
|
1260
|
+
boundary_circle_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None,
|
1261
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
1262
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
1263
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
1264
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
1265
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
1266
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
1267
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
1268
|
+
_request_timeout: Union[
|
1269
|
+
None,
|
1270
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1271
|
+
Tuple[
|
1272
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1273
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1274
|
+
]
|
1275
|
+
] = None,
|
1276
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1277
|
+
_content_type: Optional[StrictStr] = None,
|
1278
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1279
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1280
|
+
) -> PeliasResponse:
|
1281
|
+
"""Search for location and other info using a place name or address (forward geocoding).
|
1282
|
+
|
1283
|
+
The search endpoint lets you search for addresses, points of interest, and administrative areas. This is most commonly used for forward geocoding applications where you need to find the geographic coordinates of an address.
|
680
1284
|
|
681
1285
|
:param text: The place name (address, venue name, etc.) to search for. (required)
|
682
1286
|
:type text: str
|
@@ -710,32 +1314,101 @@ class GeocodingApi(object):
|
|
710
1314
|
:type size: int
|
711
1315
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
712
1316
|
:type lang: str
|
713
|
-
:param async_req: Whether to execute the request asynchronously.
|
714
|
-
:type async_req: bool, optional
|
715
1317
|
:param _request_timeout: timeout setting for this request. If one
|
716
1318
|
number provided, it will be total request
|
717
1319
|
timeout. It can also be a pair (tuple) of
|
718
1320
|
(connection, read) timeouts.
|
1321
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1322
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1323
|
+
request; this effectively ignores the
|
1324
|
+
authentication in the spec for a single request.
|
1325
|
+
:type _request_auth: dict, optional
|
1326
|
+
:param _content_type: force content-type for the request.
|
1327
|
+
:type _content_type: str, Optional
|
1328
|
+
:param _headers: set to override the headers for a single
|
1329
|
+
request; this effectively ignores the headers
|
1330
|
+
in the spec for a single request.
|
1331
|
+
:type _headers: dict, optional
|
1332
|
+
:param _host_index: set to override the host_index for a single
|
1333
|
+
request; this effectively ignores the host_index
|
1334
|
+
in the spec for a single request.
|
1335
|
+
:type _host_index: int, optional
|
719
1336
|
:return: Returns the result object.
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
1337
|
+
""" # noqa: E501
|
1338
|
+
|
1339
|
+
_param = self._search_serialize(
|
1340
|
+
text=text,
|
1341
|
+
focus_point_lat=focus_point_lat,
|
1342
|
+
focus_point_lon=focus_point_lon,
|
1343
|
+
boundary_rect_min_lat=boundary_rect_min_lat,
|
1344
|
+
boundary_rect_max_lat=boundary_rect_max_lat,
|
1345
|
+
boundary_rect_min_lon=boundary_rect_min_lon,
|
1346
|
+
boundary_rect_max_lon=boundary_rect_max_lon,
|
1347
|
+
boundary_circle_lat=boundary_circle_lat,
|
1348
|
+
boundary_circle_lon=boundary_circle_lon,
|
1349
|
+
boundary_circle_radius=boundary_circle_radius,
|
1350
|
+
boundary_country=boundary_country,
|
1351
|
+
boundary_gid=boundary_gid,
|
1352
|
+
layers=layers,
|
1353
|
+
sources=sources,
|
1354
|
+
size=size,
|
1355
|
+
lang=lang,
|
1356
|
+
_request_auth=_request_auth,
|
1357
|
+
_content_type=_content_type,
|
1358
|
+
_headers=_headers,
|
1359
|
+
_host_index=_host_index
|
1360
|
+
)
|
1361
|
+
|
1362
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1363
|
+
'200': "PeliasResponse",
|
1364
|
+
'400': None,
|
1365
|
+
}
|
1366
|
+
response_data = self.api_client.call_api(
|
1367
|
+
*_param,
|
1368
|
+
_request_timeout=_request_timeout
|
1369
|
+
)
|
1370
|
+
response_data.read()
|
1371
|
+
return self.api_client.response_deserialize(
|
1372
|
+
response_data=response_data,
|
1373
|
+
response_types_map=_response_types_map,
|
1374
|
+
).data
|
1375
|
+
|
1376
|
+
|
1377
|
+
@validate_call
|
1378
|
+
def search_with_http_info(
|
1379
|
+
self,
|
1380
|
+
text: Annotated[StrictStr, Field(description="The place name (address, venue name, etc.) to search for.")],
|
1381
|
+
focus_point_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None,
|
1382
|
+
focus_point_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None,
|
1383
|
+
boundary_rect_min_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1384
|
+
boundary_rect_max_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1385
|
+
boundary_rect_min_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1386
|
+
boundary_rect_max_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1387
|
+
boundary_circle_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None,
|
1388
|
+
boundary_circle_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None,
|
1389
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
1390
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
1391
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
1392
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
1393
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
1394
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
1395
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
1396
|
+
_request_timeout: Union[
|
1397
|
+
None,
|
1398
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1399
|
+
Tuple[
|
1400
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1401
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1402
|
+
]
|
1403
|
+
] = None,
|
1404
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1405
|
+
_content_type: Optional[StrictStr] = None,
|
1406
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1407
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1408
|
+
) -> ApiResponse[PeliasResponse]:
|
1409
|
+
"""Search for location and other info using a place name or address (forward geocoding).
|
1410
|
+
|
1411
|
+
The search endpoint lets you search for addresses, points of interest, and administrative areas. This is most commonly used for forward geocoding applications where you need to find the geographic coordinates of an address.
|
739
1412
|
|
740
1413
|
:param text: The place name (address, venue name, etc.) to search for. (required)
|
741
1414
|
:type text: str
|
@@ -769,177 +1442,373 @@ class GeocodingApi(object):
|
|
769
1442
|
:type size: int
|
770
1443
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
771
1444
|
:type lang: str
|
772
|
-
:param async_req: Whether to execute the request asynchronously.
|
773
|
-
:type async_req: bool, optional
|
774
|
-
:param _preload_content: if False, the ApiResponse.data will
|
775
|
-
be set to none and raw_data will store the
|
776
|
-
HTTP response body without reading/decoding.
|
777
|
-
Default is True.
|
778
|
-
:type _preload_content: bool, optional
|
779
|
-
:param _return_http_data_only: response data instead of ApiResponse
|
780
|
-
object with status code, headers, etc
|
781
|
-
:type _return_http_data_only: bool, optional
|
782
1445
|
:param _request_timeout: timeout setting for this request. If one
|
783
1446
|
number provided, it will be total request
|
784
1447
|
timeout. It can also be a pair (tuple) of
|
785
1448
|
(connection, read) timeouts.
|
1449
|
+
:type _request_timeout: int, tuple(int, int), optional
|
786
1450
|
:param _request_auth: set to override the auth_settings for an a single
|
787
|
-
request; this effectively ignores the
|
788
|
-
in the spec for a single request.
|
1451
|
+
request; this effectively ignores the
|
1452
|
+
authentication in the spec for a single request.
|
789
1453
|
:type _request_auth: dict, optional
|
790
|
-
:
|
1454
|
+
:param _content_type: force content-type for the request.
|
1455
|
+
:type _content_type: str, Optional
|
1456
|
+
:param _headers: set to override the headers for a single
|
1457
|
+
request; this effectively ignores the headers
|
1458
|
+
in the spec for a single request.
|
1459
|
+
:type _headers: dict, optional
|
1460
|
+
:param _host_index: set to override the host_index for a single
|
1461
|
+
request; this effectively ignores the host_index
|
1462
|
+
in the spec for a single request.
|
1463
|
+
:type _host_index: int, optional
|
791
1464
|
:return: Returns the result object.
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
'lang'
|
816
|
-
]
|
817
|
-
_all_params.extend(
|
818
|
-
[
|
819
|
-
'async_req',
|
820
|
-
'_return_http_data_only',
|
821
|
-
'_preload_content',
|
822
|
-
'_request_timeout',
|
823
|
-
'_request_auth',
|
824
|
-
'_content_type',
|
825
|
-
'_headers'
|
826
|
-
]
|
1465
|
+
""" # noqa: E501
|
1466
|
+
|
1467
|
+
_param = self._search_serialize(
|
1468
|
+
text=text,
|
1469
|
+
focus_point_lat=focus_point_lat,
|
1470
|
+
focus_point_lon=focus_point_lon,
|
1471
|
+
boundary_rect_min_lat=boundary_rect_min_lat,
|
1472
|
+
boundary_rect_max_lat=boundary_rect_max_lat,
|
1473
|
+
boundary_rect_min_lon=boundary_rect_min_lon,
|
1474
|
+
boundary_rect_max_lon=boundary_rect_max_lon,
|
1475
|
+
boundary_circle_lat=boundary_circle_lat,
|
1476
|
+
boundary_circle_lon=boundary_circle_lon,
|
1477
|
+
boundary_circle_radius=boundary_circle_radius,
|
1478
|
+
boundary_country=boundary_country,
|
1479
|
+
boundary_gid=boundary_gid,
|
1480
|
+
layers=layers,
|
1481
|
+
sources=sources,
|
1482
|
+
size=size,
|
1483
|
+
lang=lang,
|
1484
|
+
_request_auth=_request_auth,
|
1485
|
+
_content_type=_content_type,
|
1486
|
+
_headers=_headers,
|
1487
|
+
_host_index=_host_index
|
827
1488
|
)
|
828
1489
|
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
_path_params = {}
|
843
|
-
|
844
|
-
# process the query parameters
|
845
|
-
_query_params = []
|
846
|
-
if _params.get('text') is not None: # noqa: E501
|
847
|
-
_query_params.append(('text', _params['text']))
|
848
|
-
|
849
|
-
if _params.get('focus_point_lat') is not None: # noqa: E501
|
850
|
-
_query_params.append(('focus.point.lat', _params['focus_point_lat']))
|
851
|
-
|
852
|
-
if _params.get('focus_point_lon') is not None: # noqa: E501
|
853
|
-
_query_params.append(('focus.point.lon', _params['focus_point_lon']))
|
854
|
-
|
855
|
-
if _params.get('boundary_rect_min_lat') is not None: # noqa: E501
|
856
|
-
_query_params.append(('boundary.rect.min_lat', _params['boundary_rect_min_lat']))
|
857
|
-
|
858
|
-
if _params.get('boundary_rect_max_lat') is not None: # noqa: E501
|
859
|
-
_query_params.append(('boundary.rect.max_lat', _params['boundary_rect_max_lat']))
|
860
|
-
|
861
|
-
if _params.get('boundary_rect_min_lon') is not None: # noqa: E501
|
862
|
-
_query_params.append(('boundary.rect.min_lon', _params['boundary_rect_min_lon']))
|
863
|
-
|
864
|
-
if _params.get('boundary_rect_max_lon') is not None: # noqa: E501
|
865
|
-
_query_params.append(('boundary.rect.max_lon', _params['boundary_rect_max_lon']))
|
866
|
-
|
867
|
-
if _params.get('boundary_circle_lat') is not None: # noqa: E501
|
868
|
-
_query_params.append(('boundary.circle.lat', _params['boundary_circle_lat']))
|
869
|
-
|
870
|
-
if _params.get('boundary_circle_lon') is not None: # noqa: E501
|
871
|
-
_query_params.append(('boundary.circle.lon', _params['boundary_circle_lon']))
|
872
|
-
|
873
|
-
if _params.get('boundary_circle_radius') is not None: # noqa: E501
|
874
|
-
_query_params.append(('boundary.circle.radius', _params['boundary_circle_radius']))
|
1490
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1491
|
+
'200': "PeliasResponse",
|
1492
|
+
'400': None,
|
1493
|
+
}
|
1494
|
+
response_data = self.api_client.call_api(
|
1495
|
+
*_param,
|
1496
|
+
_request_timeout=_request_timeout
|
1497
|
+
)
|
1498
|
+
response_data.read()
|
1499
|
+
return self.api_client.response_deserialize(
|
1500
|
+
response_data=response_data,
|
1501
|
+
response_types_map=_response_types_map,
|
1502
|
+
)
|
875
1503
|
|
876
|
-
if _params.get('boundary_country') is not None: # noqa: E501
|
877
|
-
_query_params.append(('boundary.country', _params['boundary_country']))
|
878
|
-
_collection_formats['boundary.country'] = 'csv'
|
879
1504
|
|
880
|
-
|
881
|
-
|
1505
|
+
@validate_call
|
1506
|
+
def search_without_preload_content(
|
1507
|
+
self,
|
1508
|
+
text: Annotated[StrictStr, Field(description="The place name (address, venue name, etc.) to search for.")],
|
1509
|
+
focus_point_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None,
|
1510
|
+
focus_point_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None,
|
1511
|
+
boundary_rect_min_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1512
|
+
boundary_rect_max_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1513
|
+
boundary_rect_min_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1514
|
+
boundary_rect_max_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1515
|
+
boundary_circle_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None,
|
1516
|
+
boundary_circle_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None,
|
1517
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
1518
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
1519
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
1520
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
1521
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
1522
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
1523
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
1524
|
+
_request_timeout: Union[
|
1525
|
+
None,
|
1526
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1527
|
+
Tuple[
|
1528
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1529
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1530
|
+
]
|
1531
|
+
] = None,
|
1532
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1533
|
+
_content_type: Optional[StrictStr] = None,
|
1534
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1535
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1536
|
+
) -> RESTResponseType:
|
1537
|
+
"""Search for location and other info using a place name or address (forward geocoding).
|
882
1538
|
|
883
|
-
|
884
|
-
_query_params.append(('layers', _params['layers']))
|
885
|
-
_collection_formats['layers'] = 'csv'
|
1539
|
+
The search endpoint lets you search for addresses, points of interest, and administrative areas. This is most commonly used for forward geocoding applications where you need to find the geographic coordinates of an address.
|
886
1540
|
|
887
|
-
|
888
|
-
|
889
|
-
|
1541
|
+
:param text: The place name (address, venue name, etc.) to search for. (required)
|
1542
|
+
:type text: str
|
1543
|
+
:param focus_point_lat: The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.
|
1544
|
+
:type focus_point_lat: float
|
1545
|
+
:param focus_point_lon: The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.
|
1546
|
+
:type focus_point_lon: float
|
1547
|
+
:param boundary_rect_min_lat: Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
1548
|
+
:type boundary_rect_min_lat: float
|
1549
|
+
:param boundary_rect_max_lat: Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
1550
|
+
:type boundary_rect_max_lat: float
|
1551
|
+
:param boundary_rect_min_lon: Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
1552
|
+
:type boundary_rect_min_lon: float
|
1553
|
+
:param boundary_rect_max_lon: Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
1554
|
+
:type boundary_rect_max_lon: float
|
1555
|
+
:param boundary_circle_lat: The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.
|
1556
|
+
:type boundary_circle_lat: float
|
1557
|
+
:param boundary_circle_lon: The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.
|
1558
|
+
:type boundary_circle_lon: float
|
1559
|
+
:param boundary_circle_radius: The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.
|
1560
|
+
:type boundary_circle_radius: float
|
1561
|
+
:param boundary_country: A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.
|
1562
|
+
:type boundary_country: List[str]
|
1563
|
+
:param boundary_gid: The Pelias GID of an area to limit the search to.
|
1564
|
+
:type boundary_gid: str
|
1565
|
+
:param layers: A list of layers to limit the search to.
|
1566
|
+
:type layers: List[PeliasLayer]
|
1567
|
+
:param sources: A list of sources to limit the search to.
|
1568
|
+
:type sources: List[PeliasSource]
|
1569
|
+
:param size: The maximum number of results to return.
|
1570
|
+
:type size: int
|
1571
|
+
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
1572
|
+
:type lang: str
|
1573
|
+
:param _request_timeout: timeout setting for this request. If one
|
1574
|
+
number provided, it will be total request
|
1575
|
+
timeout. It can also be a pair (tuple) of
|
1576
|
+
(connection, read) timeouts.
|
1577
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1578
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1579
|
+
request; this effectively ignores the
|
1580
|
+
authentication in the spec for a single request.
|
1581
|
+
:type _request_auth: dict, optional
|
1582
|
+
:param _content_type: force content-type for the request.
|
1583
|
+
:type _content_type: str, Optional
|
1584
|
+
:param _headers: set to override the headers for a single
|
1585
|
+
request; this effectively ignores the headers
|
1586
|
+
in the spec for a single request.
|
1587
|
+
:type _headers: dict, optional
|
1588
|
+
:param _host_index: set to override the host_index for a single
|
1589
|
+
request; this effectively ignores the host_index
|
1590
|
+
in the spec for a single request.
|
1591
|
+
:type _host_index: int, optional
|
1592
|
+
:return: Returns the result object.
|
1593
|
+
""" # noqa: E501
|
1594
|
+
|
1595
|
+
_param = self._search_serialize(
|
1596
|
+
text=text,
|
1597
|
+
focus_point_lat=focus_point_lat,
|
1598
|
+
focus_point_lon=focus_point_lon,
|
1599
|
+
boundary_rect_min_lat=boundary_rect_min_lat,
|
1600
|
+
boundary_rect_max_lat=boundary_rect_max_lat,
|
1601
|
+
boundary_rect_min_lon=boundary_rect_min_lon,
|
1602
|
+
boundary_rect_max_lon=boundary_rect_max_lon,
|
1603
|
+
boundary_circle_lat=boundary_circle_lat,
|
1604
|
+
boundary_circle_lon=boundary_circle_lon,
|
1605
|
+
boundary_circle_radius=boundary_circle_radius,
|
1606
|
+
boundary_country=boundary_country,
|
1607
|
+
boundary_gid=boundary_gid,
|
1608
|
+
layers=layers,
|
1609
|
+
sources=sources,
|
1610
|
+
size=size,
|
1611
|
+
lang=lang,
|
1612
|
+
_request_auth=_request_auth,
|
1613
|
+
_content_type=_content_type,
|
1614
|
+
_headers=_headers,
|
1615
|
+
_host_index=_host_index
|
1616
|
+
)
|
890
1617
|
|
891
|
-
|
892
|
-
|
1618
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1619
|
+
'200': "PeliasResponse",
|
1620
|
+
'400': None,
|
1621
|
+
}
|
1622
|
+
response_data = self.api_client.call_api(
|
1623
|
+
*_param,
|
1624
|
+
_request_timeout=_request_timeout
|
1625
|
+
)
|
1626
|
+
return response_data.response
|
1627
|
+
|
1628
|
+
|
1629
|
+
def _search_serialize(
|
1630
|
+
self,
|
1631
|
+
text,
|
1632
|
+
focus_point_lat,
|
1633
|
+
focus_point_lon,
|
1634
|
+
boundary_rect_min_lat,
|
1635
|
+
boundary_rect_max_lat,
|
1636
|
+
boundary_rect_min_lon,
|
1637
|
+
boundary_rect_max_lon,
|
1638
|
+
boundary_circle_lat,
|
1639
|
+
boundary_circle_lon,
|
1640
|
+
boundary_circle_radius,
|
1641
|
+
boundary_country,
|
1642
|
+
boundary_gid,
|
1643
|
+
layers,
|
1644
|
+
sources,
|
1645
|
+
size,
|
1646
|
+
lang,
|
1647
|
+
_request_auth,
|
1648
|
+
_content_type,
|
1649
|
+
_headers,
|
1650
|
+
_host_index,
|
1651
|
+
) -> RequestSerialized:
|
1652
|
+
|
1653
|
+
_host = None
|
1654
|
+
|
1655
|
+
_collection_formats: Dict[str, str] = {
|
1656
|
+
'boundary.country': 'csv',
|
1657
|
+
'layers': 'csv',
|
1658
|
+
'sources': 'csv',
|
1659
|
+
}
|
893
1660
|
|
894
|
-
|
895
|
-
|
1661
|
+
_path_params: Dict[str, str] = {}
|
1662
|
+
_query_params: List[Tuple[str, str]] = []
|
1663
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
1664
|
+
_form_params: List[Tuple[str, str]] = []
|
1665
|
+
_files: Dict[str, str] = {}
|
1666
|
+
_body_params: Optional[bytes] = None
|
896
1667
|
|
1668
|
+
# process the path parameters
|
1669
|
+
# process the query parameters
|
1670
|
+
if text is not None:
|
1671
|
+
|
1672
|
+
_query_params.append(('text', text))
|
1673
|
+
|
1674
|
+
if focus_point_lat is not None:
|
1675
|
+
|
1676
|
+
_query_params.append(('focus.point.lat', focus_point_lat))
|
1677
|
+
|
1678
|
+
if focus_point_lon is not None:
|
1679
|
+
|
1680
|
+
_query_params.append(('focus.point.lon', focus_point_lon))
|
1681
|
+
|
1682
|
+
if boundary_rect_min_lat is not None:
|
1683
|
+
|
1684
|
+
_query_params.append(('boundary.rect.min_lat', boundary_rect_min_lat))
|
1685
|
+
|
1686
|
+
if boundary_rect_max_lat is not None:
|
1687
|
+
|
1688
|
+
_query_params.append(('boundary.rect.max_lat', boundary_rect_max_lat))
|
1689
|
+
|
1690
|
+
if boundary_rect_min_lon is not None:
|
1691
|
+
|
1692
|
+
_query_params.append(('boundary.rect.min_lon', boundary_rect_min_lon))
|
1693
|
+
|
1694
|
+
if boundary_rect_max_lon is not None:
|
1695
|
+
|
1696
|
+
_query_params.append(('boundary.rect.max_lon', boundary_rect_max_lon))
|
1697
|
+
|
1698
|
+
if boundary_circle_lat is not None:
|
1699
|
+
|
1700
|
+
_query_params.append(('boundary.circle.lat', boundary_circle_lat))
|
1701
|
+
|
1702
|
+
if boundary_circle_lon is not None:
|
1703
|
+
|
1704
|
+
_query_params.append(('boundary.circle.lon', boundary_circle_lon))
|
1705
|
+
|
1706
|
+
if boundary_circle_radius is not None:
|
1707
|
+
|
1708
|
+
_query_params.append(('boundary.circle.radius', boundary_circle_radius))
|
1709
|
+
|
1710
|
+
if boundary_country is not None:
|
1711
|
+
|
1712
|
+
_query_params.append(('boundary.country', boundary_country))
|
1713
|
+
|
1714
|
+
if boundary_gid is not None:
|
1715
|
+
|
1716
|
+
_query_params.append(('boundary.gid', boundary_gid))
|
1717
|
+
|
1718
|
+
if layers is not None:
|
1719
|
+
|
1720
|
+
_query_params.append(('layers', layers))
|
1721
|
+
|
1722
|
+
if sources is not None:
|
1723
|
+
|
1724
|
+
_query_params.append(('sources', sources))
|
1725
|
+
|
1726
|
+
if size is not None:
|
1727
|
+
|
1728
|
+
_query_params.append(('size', size))
|
1729
|
+
|
1730
|
+
if lang is not None:
|
1731
|
+
|
1732
|
+
_query_params.append(('lang', lang))
|
1733
|
+
|
897
1734
|
# process the header parameters
|
898
|
-
_header_params = dict(_params.get('_headers', {}))
|
899
1735
|
# process the form parameters
|
900
|
-
_form_params = []
|
901
|
-
_files = {}
|
902
1736
|
# process the body parameter
|
903
|
-
|
1737
|
+
|
1738
|
+
|
904
1739
|
# set the HTTP header `Accept`
|
905
1740
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
906
|
-
[
|
1741
|
+
[
|
1742
|
+
'application/json'
|
1743
|
+
]
|
1744
|
+
)
|
907
1745
|
|
908
|
-
# authentication setting
|
909
|
-
_auth_settings = ['ApiKeyAuth'] # noqa: E501
|
910
1746
|
|
911
|
-
|
912
|
-
|
913
|
-
'
|
914
|
-
|
1747
|
+
# authentication setting
|
1748
|
+
_auth_settings: List[str] = [
|
1749
|
+
'ApiKeyAuth'
|
1750
|
+
]
|
915
1751
|
|
916
|
-
return self.api_client.
|
917
|
-
'
|
918
|
-
|
919
|
-
|
920
|
-
|
1752
|
+
return self.api_client.param_serialize(
|
1753
|
+
method='GET',
|
1754
|
+
resource_path='/geocoding/v1/search',
|
1755
|
+
path_params=_path_params,
|
1756
|
+
query_params=_query_params,
|
1757
|
+
header_params=_header_params,
|
921
1758
|
body=_body_params,
|
922
1759
|
post_params=_form_params,
|
923
1760
|
files=_files,
|
924
|
-
response_types_map=_response_types_map,
|
925
1761
|
auth_settings=_auth_settings,
|
926
|
-
async_req=_params.get('async_req'),
|
927
|
-
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
928
|
-
_preload_content=_params.get('_preload_content', True),
|
929
|
-
_request_timeout=_params.get('_request_timeout'),
|
930
1762
|
collection_formats=_collection_formats,
|
931
|
-
|
1763
|
+
_host=_host,
|
1764
|
+
_request_auth=_request_auth
|
1765
|
+
)
|
932
1766
|
|
933
|
-
@validate_arguments
|
934
|
-
def search_structured(self, address : Annotated[Optional[StrictStr], Field(description="A street name, optionally with a house number.")] = None, neighbourhood : Annotated[Optional[StrictStr], Field(description="Varies by area, but has a locally specific meaning (NOT always an official administrative unit).")] = None, borough : Annotated[Optional[StrictStr], Field(description="A unit within a city (not widely used, but present in places like NYC and Mexico City).")] = None, locality : Annotated[Optional[StrictStr], Field(description="The city, village, town, etc. that the place/address is part of.")] = None, county : Annotated[Optional[StrictStr], Field(description="Administrative divisions between localities and regions. Not commonly used as input to structured geocoding.")] = None, region : Annotated[Optional[StrictStr], Field(description="Typically the first administrative division within a country. For example, a US state or a Canadian province.")] = None, postalcode : Annotated[Optional[StrictStr], Field(description="A mail sorting code.")] = None, country : Annotated[Optional[StrictStr], Field(description="A full name (ex: Canada), or a 2 or 3 character ISO code. Prefer ISO codes when possible.")] = None, focus_point_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None, focus_point_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None, boundary_rect_min_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_rect_max_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_rect_min_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_rect_max_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None, boundary_circle_lat : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None, boundary_circle_lon : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None, boundary_circle_radius : Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None, boundary_country : Annotated[Optional[conlist(StrictStr)], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None, boundary_gid : Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None, layers : Annotated[Optional[conlist(PeliasLayer)], Field(description="A list of layers to limit the search to.")] = None, sources : Annotated[Optional[conlist(PeliasSource)], Field(description="A list of sources to limit the search to.")] = None, size : Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None, lang : Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None, **kwargs) -> PeliasResponse: # noqa: E501
|
935
|
-
"""Find locations matching components (structured forward geocoding). # noqa: E501
|
936
1767
|
|
937
|
-
The structured search endpoint lets you search for addresses, points of interest, and administrative areas. Rather than a single string which the API must infer meaning from, the structured search endpoint allows you to specify the known components upfront, which is useful in many forward geocoding workflows. # noqa: E501
|
938
|
-
This method makes a synchronous HTTP request by default. To make an
|
939
|
-
asynchronous HTTP request, please pass async_req=True
|
940
1768
|
|
941
|
-
|
942
|
-
|
1769
|
+
|
1770
|
+
@validate_call
|
1771
|
+
def search_structured(
|
1772
|
+
self,
|
1773
|
+
address: Annotated[Optional[StrictStr], Field(description="A street name, optionally with a house number.")] = None,
|
1774
|
+
neighbourhood: Annotated[Optional[StrictStr], Field(description="Varies by area, but has a locally specific meaning (NOT always an official administrative unit).")] = None,
|
1775
|
+
borough: Annotated[Optional[StrictStr], Field(description="A unit within a city (not widely used, but present in places like NYC and Mexico City).")] = None,
|
1776
|
+
locality: Annotated[Optional[StrictStr], Field(description="The city, village, town, etc. that the place/address is part of.")] = None,
|
1777
|
+
county: Annotated[Optional[StrictStr], Field(description="Administrative divisions between localities and regions. Not commonly used as input to structured geocoding.")] = None,
|
1778
|
+
region: Annotated[Optional[StrictStr], Field(description="Typically the first administrative division within a country. For example, a US state or a Canadian province.")] = None,
|
1779
|
+
postalcode: Annotated[Optional[StrictStr], Field(description="A mail sorting code.")] = None,
|
1780
|
+
country: Annotated[Optional[StrictStr], Field(description="A full name (ex: Canada), or a 2 or 3 character ISO code. Prefer ISO codes when possible.")] = None,
|
1781
|
+
focus_point_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None,
|
1782
|
+
focus_point_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None,
|
1783
|
+
boundary_rect_min_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1784
|
+
boundary_rect_max_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1785
|
+
boundary_rect_min_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1786
|
+
boundary_rect_max_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1787
|
+
boundary_circle_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None,
|
1788
|
+
boundary_circle_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None,
|
1789
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
1790
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
1791
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
1792
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
1793
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
1794
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
1795
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
1796
|
+
_request_timeout: Union[
|
1797
|
+
None,
|
1798
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1799
|
+
Tuple[
|
1800
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1801
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1802
|
+
]
|
1803
|
+
] = None,
|
1804
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1805
|
+
_content_type: Optional[StrictStr] = None,
|
1806
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1807
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1808
|
+
) -> PeliasResponse:
|
1809
|
+
"""Find locations matching components (structured forward geocoding).
|
1810
|
+
|
1811
|
+
The structured search endpoint lets you search for addresses, points of interest, and administrative areas. Rather than a single string which the API must infer meaning from, the structured search endpoint allows you to specify the known components upfront, which is useful in many forward geocoding workflows.
|
943
1812
|
|
944
1813
|
:param address: A street name, optionally with a house number.
|
945
1814
|
:type address: str
|
@@ -987,32 +1856,115 @@ class GeocodingApi(object):
|
|
987
1856
|
:type size: int
|
988
1857
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
989
1858
|
:type lang: str
|
990
|
-
:param async_req: Whether to execute the request asynchronously.
|
991
|
-
:type async_req: bool, optional
|
992
1859
|
:param _request_timeout: timeout setting for this request. If one
|
993
1860
|
number provided, it will be total request
|
994
1861
|
timeout. It can also be a pair (tuple) of
|
995
1862
|
(connection, read) timeouts.
|
1863
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1864
|
+
:param _request_auth: set to override the auth_settings for an a single
|
1865
|
+
request; this effectively ignores the
|
1866
|
+
authentication in the spec for a single request.
|
1867
|
+
:type _request_auth: dict, optional
|
1868
|
+
:param _content_type: force content-type for the request.
|
1869
|
+
:type _content_type: str, Optional
|
1870
|
+
:param _headers: set to override the headers for a single
|
1871
|
+
request; this effectively ignores the headers
|
1872
|
+
in the spec for a single request.
|
1873
|
+
:type _headers: dict, optional
|
1874
|
+
:param _host_index: set to override the host_index for a single
|
1875
|
+
request; this effectively ignores the host_index
|
1876
|
+
in the spec for a single request.
|
1877
|
+
:type _host_index: int, optional
|
996
1878
|
:return: Returns the result object.
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1879
|
+
""" # noqa: E501
|
1880
|
+
|
1881
|
+
_param = self._search_structured_serialize(
|
1882
|
+
address=address,
|
1883
|
+
neighbourhood=neighbourhood,
|
1884
|
+
borough=borough,
|
1885
|
+
locality=locality,
|
1886
|
+
county=county,
|
1887
|
+
region=region,
|
1888
|
+
postalcode=postalcode,
|
1889
|
+
country=country,
|
1890
|
+
focus_point_lat=focus_point_lat,
|
1891
|
+
focus_point_lon=focus_point_lon,
|
1892
|
+
boundary_rect_min_lat=boundary_rect_min_lat,
|
1893
|
+
boundary_rect_max_lat=boundary_rect_max_lat,
|
1894
|
+
boundary_rect_min_lon=boundary_rect_min_lon,
|
1895
|
+
boundary_rect_max_lon=boundary_rect_max_lon,
|
1896
|
+
boundary_circle_lat=boundary_circle_lat,
|
1897
|
+
boundary_circle_lon=boundary_circle_lon,
|
1898
|
+
boundary_circle_radius=boundary_circle_radius,
|
1899
|
+
boundary_country=boundary_country,
|
1900
|
+
boundary_gid=boundary_gid,
|
1901
|
+
layers=layers,
|
1902
|
+
sources=sources,
|
1903
|
+
size=size,
|
1904
|
+
lang=lang,
|
1905
|
+
_request_auth=_request_auth,
|
1906
|
+
_content_type=_content_type,
|
1907
|
+
_headers=_headers,
|
1908
|
+
_host_index=_host_index
|
1909
|
+
)
|
1910
|
+
|
1911
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
1912
|
+
'200': "PeliasResponse",
|
1913
|
+
'400': None,
|
1914
|
+
}
|
1915
|
+
response_data = self.api_client.call_api(
|
1916
|
+
*_param,
|
1917
|
+
_request_timeout=_request_timeout
|
1918
|
+
)
|
1919
|
+
response_data.read()
|
1920
|
+
return self.api_client.response_deserialize(
|
1921
|
+
response_data=response_data,
|
1922
|
+
response_types_map=_response_types_map,
|
1923
|
+
).data
|
1924
|
+
|
1925
|
+
|
1926
|
+
@validate_call
|
1927
|
+
def search_structured_with_http_info(
|
1928
|
+
self,
|
1929
|
+
address: Annotated[Optional[StrictStr], Field(description="A street name, optionally with a house number.")] = None,
|
1930
|
+
neighbourhood: Annotated[Optional[StrictStr], Field(description="Varies by area, but has a locally specific meaning (NOT always an official administrative unit).")] = None,
|
1931
|
+
borough: Annotated[Optional[StrictStr], Field(description="A unit within a city (not widely used, but present in places like NYC and Mexico City).")] = None,
|
1932
|
+
locality: Annotated[Optional[StrictStr], Field(description="The city, village, town, etc. that the place/address is part of.")] = None,
|
1933
|
+
county: Annotated[Optional[StrictStr], Field(description="Administrative divisions between localities and regions. Not commonly used as input to structured geocoding.")] = None,
|
1934
|
+
region: Annotated[Optional[StrictStr], Field(description="Typically the first administrative division within a country. For example, a US state or a Canadian province.")] = None,
|
1935
|
+
postalcode: Annotated[Optional[StrictStr], Field(description="A mail sorting code.")] = None,
|
1936
|
+
country: Annotated[Optional[StrictStr], Field(description="A full name (ex: Canada), or a 2 or 3 character ISO code. Prefer ISO codes when possible.")] = None,
|
1937
|
+
focus_point_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None,
|
1938
|
+
focus_point_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None,
|
1939
|
+
boundary_rect_min_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1940
|
+
boundary_rect_max_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1941
|
+
boundary_rect_min_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1942
|
+
boundary_rect_max_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
1943
|
+
boundary_circle_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None,
|
1944
|
+
boundary_circle_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None,
|
1945
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
1946
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
1947
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
1948
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
1949
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
1950
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
1951
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
1952
|
+
_request_timeout: Union[
|
1953
|
+
None,
|
1954
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1955
|
+
Tuple[
|
1956
|
+
Annotated[StrictFloat, Field(gt=0)],
|
1957
|
+
Annotated[StrictFloat, Field(gt=0)]
|
1958
|
+
]
|
1959
|
+
] = None,
|
1960
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
1961
|
+
_content_type: Optional[StrictStr] = None,
|
1962
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1963
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1964
|
+
) -> ApiResponse[PeliasResponse]:
|
1965
|
+
"""Find locations matching components (structured forward geocoding).
|
1966
|
+
|
1967
|
+
The structured search endpoint lets you search for addresses, points of interest, and administrative areas. Rather than a single string which the API must infer meaning from, the structured search endpoint allows you to specify the known components upfront, which is useful in many forward geocoding workflows.
|
1016
1968
|
|
1017
1969
|
:param address: A street name, optionally with a house number.
|
1018
1970
|
:type address: str
|
@@ -1060,191 +2012,396 @@ class GeocodingApi(object):
|
|
1060
2012
|
:type size: int
|
1061
2013
|
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
1062
2014
|
:type lang: str
|
1063
|
-
:param async_req: Whether to execute the request asynchronously.
|
1064
|
-
:type async_req: bool, optional
|
1065
|
-
:param _preload_content: if False, the ApiResponse.data will
|
1066
|
-
be set to none and raw_data will store the
|
1067
|
-
HTTP response body without reading/decoding.
|
1068
|
-
Default is True.
|
1069
|
-
:type _preload_content: bool, optional
|
1070
|
-
:param _return_http_data_only: response data instead of ApiResponse
|
1071
|
-
object with status code, headers, etc
|
1072
|
-
:type _return_http_data_only: bool, optional
|
1073
2015
|
:param _request_timeout: timeout setting for this request. If one
|
1074
2016
|
number provided, it will be total request
|
1075
2017
|
timeout. It can also be a pair (tuple) of
|
1076
2018
|
(connection, read) timeouts.
|
2019
|
+
:type _request_timeout: int, tuple(int, int), optional
|
1077
2020
|
:param _request_auth: set to override the auth_settings for an a single
|
1078
|
-
request; this effectively ignores the
|
1079
|
-
in the spec for a single request.
|
2021
|
+
request; this effectively ignores the
|
2022
|
+
authentication in the spec for a single request.
|
1080
2023
|
:type _request_auth: dict, optional
|
1081
|
-
:
|
2024
|
+
:param _content_type: force content-type for the request.
|
2025
|
+
:type _content_type: str, Optional
|
2026
|
+
:param _headers: set to override the headers for a single
|
2027
|
+
request; this effectively ignores the headers
|
2028
|
+
in the spec for a single request.
|
2029
|
+
:type _headers: dict, optional
|
2030
|
+
:param _host_index: set to override the host_index for a single
|
2031
|
+
request; this effectively ignores the host_index
|
2032
|
+
in the spec for a single request.
|
2033
|
+
:type _host_index: int, optional
|
1082
2034
|
:return: Returns the result object.
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
'lang'
|
1114
|
-
]
|
1115
|
-
_all_params.extend(
|
1116
|
-
[
|
1117
|
-
'async_req',
|
1118
|
-
'_return_http_data_only',
|
1119
|
-
'_preload_content',
|
1120
|
-
'_request_timeout',
|
1121
|
-
'_request_auth',
|
1122
|
-
'_content_type',
|
1123
|
-
'_headers'
|
1124
|
-
]
|
2035
|
+
""" # noqa: E501
|
2036
|
+
|
2037
|
+
_param = self._search_structured_serialize(
|
2038
|
+
address=address,
|
2039
|
+
neighbourhood=neighbourhood,
|
2040
|
+
borough=borough,
|
2041
|
+
locality=locality,
|
2042
|
+
county=county,
|
2043
|
+
region=region,
|
2044
|
+
postalcode=postalcode,
|
2045
|
+
country=country,
|
2046
|
+
focus_point_lat=focus_point_lat,
|
2047
|
+
focus_point_lon=focus_point_lon,
|
2048
|
+
boundary_rect_min_lat=boundary_rect_min_lat,
|
2049
|
+
boundary_rect_max_lat=boundary_rect_max_lat,
|
2050
|
+
boundary_rect_min_lon=boundary_rect_min_lon,
|
2051
|
+
boundary_rect_max_lon=boundary_rect_max_lon,
|
2052
|
+
boundary_circle_lat=boundary_circle_lat,
|
2053
|
+
boundary_circle_lon=boundary_circle_lon,
|
2054
|
+
boundary_circle_radius=boundary_circle_radius,
|
2055
|
+
boundary_country=boundary_country,
|
2056
|
+
boundary_gid=boundary_gid,
|
2057
|
+
layers=layers,
|
2058
|
+
sources=sources,
|
2059
|
+
size=size,
|
2060
|
+
lang=lang,
|
2061
|
+
_request_auth=_request_auth,
|
2062
|
+
_content_type=_content_type,
|
2063
|
+
_headers=_headers,
|
2064
|
+
_host_index=_host_index
|
1125
2065
|
)
|
1126
2066
|
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
_path_params = {}
|
1141
|
-
|
1142
|
-
# process the query parameters
|
1143
|
-
_query_params = []
|
1144
|
-
if _params.get('address') is not None: # noqa: E501
|
1145
|
-
_query_params.append(('address', _params['address']))
|
1146
|
-
|
1147
|
-
if _params.get('neighbourhood') is not None: # noqa: E501
|
1148
|
-
_query_params.append(('neighbourhood', _params['neighbourhood']))
|
1149
|
-
|
1150
|
-
if _params.get('borough') is not None: # noqa: E501
|
1151
|
-
_query_params.append(('borough', _params['borough']))
|
1152
|
-
|
1153
|
-
if _params.get('locality') is not None: # noqa: E501
|
1154
|
-
_query_params.append(('locality', _params['locality']))
|
1155
|
-
|
1156
|
-
if _params.get('county') is not None: # noqa: E501
|
1157
|
-
_query_params.append(('county', _params['county']))
|
1158
|
-
|
1159
|
-
if _params.get('region') is not None: # noqa: E501
|
1160
|
-
_query_params.append(('region', _params['region']))
|
1161
|
-
|
1162
|
-
if _params.get('postalcode') is not None: # noqa: E501
|
1163
|
-
_query_params.append(('postalcode', _params['postalcode']))
|
1164
|
-
|
1165
|
-
if _params.get('country') is not None: # noqa: E501
|
1166
|
-
_query_params.append(('country', _params['country']))
|
1167
|
-
|
1168
|
-
if _params.get('focus_point_lat') is not None: # noqa: E501
|
1169
|
-
_query_params.append(('focus.point.lat', _params['focus_point_lat']))
|
1170
|
-
|
1171
|
-
if _params.get('focus_point_lon') is not None: # noqa: E501
|
1172
|
-
_query_params.append(('focus.point.lon', _params['focus_point_lon']))
|
1173
|
-
|
1174
|
-
if _params.get('boundary_rect_min_lat') is not None: # noqa: E501
|
1175
|
-
_query_params.append(('boundary.rect.min_lat', _params['boundary_rect_min_lat']))
|
1176
|
-
|
1177
|
-
if _params.get('boundary_rect_max_lat') is not None: # noqa: E501
|
1178
|
-
_query_params.append(('boundary.rect.max_lat', _params['boundary_rect_max_lat']))
|
1179
|
-
|
1180
|
-
if _params.get('boundary_rect_min_lon') is not None: # noqa: E501
|
1181
|
-
_query_params.append(('boundary.rect.min_lon', _params['boundary_rect_min_lon']))
|
1182
|
-
|
1183
|
-
if _params.get('boundary_rect_max_lon') is not None: # noqa: E501
|
1184
|
-
_query_params.append(('boundary.rect.max_lon', _params['boundary_rect_max_lon']))
|
1185
|
-
|
1186
|
-
if _params.get('boundary_circle_lat') is not None: # noqa: E501
|
1187
|
-
_query_params.append(('boundary.circle.lat', _params['boundary_circle_lat']))
|
1188
|
-
|
1189
|
-
if _params.get('boundary_circle_lon') is not None: # noqa: E501
|
1190
|
-
_query_params.append(('boundary.circle.lon', _params['boundary_circle_lon']))
|
1191
|
-
|
1192
|
-
if _params.get('boundary_circle_radius') is not None: # noqa: E501
|
1193
|
-
_query_params.append(('boundary.circle.radius', _params['boundary_circle_radius']))
|
2067
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2068
|
+
'200': "PeliasResponse",
|
2069
|
+
'400': None,
|
2070
|
+
}
|
2071
|
+
response_data = self.api_client.call_api(
|
2072
|
+
*_param,
|
2073
|
+
_request_timeout=_request_timeout
|
2074
|
+
)
|
2075
|
+
response_data.read()
|
2076
|
+
return self.api_client.response_deserialize(
|
2077
|
+
response_data=response_data,
|
2078
|
+
response_types_map=_response_types_map,
|
2079
|
+
)
|
1194
2080
|
|
1195
|
-
if _params.get('boundary_country') is not None: # noqa: E501
|
1196
|
-
_query_params.append(('boundary.country', _params['boundary_country']))
|
1197
|
-
_collection_formats['boundary.country'] = 'csv'
|
1198
2081
|
|
1199
|
-
|
1200
|
-
|
2082
|
+
@validate_call
|
2083
|
+
def search_structured_without_preload_content(
|
2084
|
+
self,
|
2085
|
+
address: Annotated[Optional[StrictStr], Field(description="A street name, optionally with a house number.")] = None,
|
2086
|
+
neighbourhood: Annotated[Optional[StrictStr], Field(description="Varies by area, but has a locally specific meaning (NOT always an official administrative unit).")] = None,
|
2087
|
+
borough: Annotated[Optional[StrictStr], Field(description="A unit within a city (not widely used, but present in places like NYC and Mexico City).")] = None,
|
2088
|
+
locality: Annotated[Optional[StrictStr], Field(description="The city, village, town, etc. that the place/address is part of.")] = None,
|
2089
|
+
county: Annotated[Optional[StrictStr], Field(description="Administrative divisions between localities and regions. Not commonly used as input to structured geocoding.")] = None,
|
2090
|
+
region: Annotated[Optional[StrictStr], Field(description="Typically the first administrative division within a country. For example, a US state or a Canadian province.")] = None,
|
2091
|
+
postalcode: Annotated[Optional[StrictStr], Field(description="A mail sorting code.")] = None,
|
2092
|
+
country: Annotated[Optional[StrictStr], Field(description="A full name (ex: Canada), or a 2 or 3 character ISO code. Prefer ISO codes when possible.")] = None,
|
2093
|
+
focus_point_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.")] = None,
|
2094
|
+
focus_point_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.")] = None,
|
2095
|
+
boundary_rect_min_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
2096
|
+
boundary_rect_max_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
2097
|
+
boundary_rect_min_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
2098
|
+
boundary_rect_max_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.")] = None,
|
2099
|
+
boundary_circle_lat: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.")] = None,
|
2100
|
+
boundary_circle_lon: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.")] = None,
|
2101
|
+
boundary_circle_radius: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.")] = None,
|
2102
|
+
boundary_country: Annotated[Optional[List[StrictStr]], Field(description="A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.")] = None,
|
2103
|
+
boundary_gid: Annotated[Optional[StrictStr], Field(description="The Pelias GID of an area to limit the search to.")] = None,
|
2104
|
+
layers: Annotated[Optional[List[PeliasLayer]], Field(description="A list of layers to limit the search to.")] = None,
|
2105
|
+
sources: Annotated[Optional[List[PeliasSource]], Field(description="A list of sources to limit the search to.")] = None,
|
2106
|
+
size: Annotated[Optional[StrictInt], Field(description="The maximum number of results to return.")] = None,
|
2107
|
+
lang: Annotated[Optional[StrictStr], Field(description="A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.")] = None,
|
2108
|
+
_request_timeout: Union[
|
2109
|
+
None,
|
2110
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2111
|
+
Tuple[
|
2112
|
+
Annotated[StrictFloat, Field(gt=0)],
|
2113
|
+
Annotated[StrictFloat, Field(gt=0)]
|
2114
|
+
]
|
2115
|
+
] = None,
|
2116
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
2117
|
+
_content_type: Optional[StrictStr] = None,
|
2118
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
2119
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
2120
|
+
) -> RESTResponseType:
|
2121
|
+
"""Find locations matching components (structured forward geocoding).
|
1201
2122
|
|
1202
|
-
|
1203
|
-
_query_params.append(('layers', _params['layers']))
|
1204
|
-
_collection_formats['layers'] = 'csv'
|
2123
|
+
The structured search endpoint lets you search for addresses, points of interest, and administrative areas. Rather than a single string which the API must infer meaning from, the structured search endpoint allows you to specify the known components upfront, which is useful in many forward geocoding workflows.
|
1205
2124
|
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
2125
|
+
:param address: A street name, optionally with a house number.
|
2126
|
+
:type address: str
|
2127
|
+
:param neighbourhood: Varies by area, but has a locally specific meaning (NOT always an official administrative unit).
|
2128
|
+
:type neighbourhood: str
|
2129
|
+
:param borough: A unit within a city (not widely used, but present in places like NYC and Mexico City).
|
2130
|
+
:type borough: str
|
2131
|
+
:param locality: The city, village, town, etc. that the place/address is part of.
|
2132
|
+
:type locality: str
|
2133
|
+
:param county: Administrative divisions between localities and regions. Not commonly used as input to structured geocoding.
|
2134
|
+
:type county: str
|
2135
|
+
:param region: Typically the first administrative division within a country. For example, a US state or a Canadian province.
|
2136
|
+
:type region: str
|
2137
|
+
:param postalcode: A mail sorting code.
|
2138
|
+
:type postalcode: str
|
2139
|
+
:param country: A full name (ex: Canada), or a 2 or 3 character ISO code. Prefer ISO codes when possible.
|
2140
|
+
:type country: str
|
2141
|
+
:param focus_point_lat: The latitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lon`.
|
2142
|
+
:type focus_point_lat: float
|
2143
|
+
:param focus_point_lon: The longitude of the point to focus the search on. This will bias results toward the focus point. Requires `focus.point.lat`.
|
2144
|
+
:type focus_point_lon: float
|
2145
|
+
:param boundary_rect_min_lat: Defines the min latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
2146
|
+
:type boundary_rect_min_lat: float
|
2147
|
+
:param boundary_rect_max_lat: Defines the max latitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
2148
|
+
:type boundary_rect_max_lat: float
|
2149
|
+
:param boundary_rect_min_lon: Defines the min longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
2150
|
+
:type boundary_rect_min_lon: float
|
2151
|
+
:param boundary_rect_max_lon: Defines the max longitude component of a bounding box to limit the search to. Requires all other `boundary.rect` parameters to be specified.
|
2152
|
+
:type boundary_rect_max_lon: float
|
2153
|
+
:param boundary_circle_lat: The latitude of the center of a circle to limit the search to. Requires `boundary.circle.lon`.
|
2154
|
+
:type boundary_circle_lat: float
|
2155
|
+
:param boundary_circle_lon: The longitude of the center of a circle to limit the search to. Requires `boundary.circle.lat`.
|
2156
|
+
:type boundary_circle_lon: float
|
2157
|
+
:param boundary_circle_radius: The radius of the circle (in kilometers) to limit the search to. Defaults to 50km if unspecified.
|
2158
|
+
:type boundary_circle_radius: float
|
2159
|
+
:param boundary_country: A list of countries to limit the search to. These may be either full names (ex: Canada), or an ISO 3116-1 alpha-2 or alpha-3 code. Prefer ISO codes when possible.
|
2160
|
+
:type boundary_country: List[str]
|
2161
|
+
:param boundary_gid: The Pelias GID of an area to limit the search to.
|
2162
|
+
:type boundary_gid: str
|
2163
|
+
:param layers: A list of layers to limit the search to.
|
2164
|
+
:type layers: List[PeliasLayer]
|
2165
|
+
:param sources: A list of sources to limit the search to.
|
2166
|
+
:type sources: List[PeliasSource]
|
2167
|
+
:param size: The maximum number of results to return.
|
2168
|
+
:type size: int
|
2169
|
+
:param lang: A BCP47 language tag which specifies a preference for localization of results. By default, results are in the default locale of the source data, but specifying a language will attempt to localize the results. Note that while a `langtag` (in RFC 5646 terms) can contain script, region, etc., only the `language` portion, an ISO 639 code, will be considered. So `en-US` and `en-GB` will both be treated as English.
|
2170
|
+
:type lang: str
|
2171
|
+
:param _request_timeout: timeout setting for this request. If one
|
2172
|
+
number provided, it will be total request
|
2173
|
+
timeout. It can also be a pair (tuple) of
|
2174
|
+
(connection, read) timeouts.
|
2175
|
+
:type _request_timeout: int, tuple(int, int), optional
|
2176
|
+
:param _request_auth: set to override the auth_settings for an a single
|
2177
|
+
request; this effectively ignores the
|
2178
|
+
authentication in the spec for a single request.
|
2179
|
+
:type _request_auth: dict, optional
|
2180
|
+
:param _content_type: force content-type for the request.
|
2181
|
+
:type _content_type: str, Optional
|
2182
|
+
:param _headers: set to override the headers for a single
|
2183
|
+
request; this effectively ignores the headers
|
2184
|
+
in the spec for a single request.
|
2185
|
+
:type _headers: dict, optional
|
2186
|
+
:param _host_index: set to override the host_index for a single
|
2187
|
+
request; this effectively ignores the host_index
|
2188
|
+
in the spec for a single request.
|
2189
|
+
:type _host_index: int, optional
|
2190
|
+
:return: Returns the result object.
|
2191
|
+
""" # noqa: E501
|
2192
|
+
|
2193
|
+
_param = self._search_structured_serialize(
|
2194
|
+
address=address,
|
2195
|
+
neighbourhood=neighbourhood,
|
2196
|
+
borough=borough,
|
2197
|
+
locality=locality,
|
2198
|
+
county=county,
|
2199
|
+
region=region,
|
2200
|
+
postalcode=postalcode,
|
2201
|
+
country=country,
|
2202
|
+
focus_point_lat=focus_point_lat,
|
2203
|
+
focus_point_lon=focus_point_lon,
|
2204
|
+
boundary_rect_min_lat=boundary_rect_min_lat,
|
2205
|
+
boundary_rect_max_lat=boundary_rect_max_lat,
|
2206
|
+
boundary_rect_min_lon=boundary_rect_min_lon,
|
2207
|
+
boundary_rect_max_lon=boundary_rect_max_lon,
|
2208
|
+
boundary_circle_lat=boundary_circle_lat,
|
2209
|
+
boundary_circle_lon=boundary_circle_lon,
|
2210
|
+
boundary_circle_radius=boundary_circle_radius,
|
2211
|
+
boundary_country=boundary_country,
|
2212
|
+
boundary_gid=boundary_gid,
|
2213
|
+
layers=layers,
|
2214
|
+
sources=sources,
|
2215
|
+
size=size,
|
2216
|
+
lang=lang,
|
2217
|
+
_request_auth=_request_auth,
|
2218
|
+
_content_type=_content_type,
|
2219
|
+
_headers=_headers,
|
2220
|
+
_host_index=_host_index
|
2221
|
+
)
|
1209
2222
|
|
1210
|
-
|
1211
|
-
|
2223
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
2224
|
+
'200': "PeliasResponse",
|
2225
|
+
'400': None,
|
2226
|
+
}
|
2227
|
+
response_data = self.api_client.call_api(
|
2228
|
+
*_param,
|
2229
|
+
_request_timeout=_request_timeout
|
2230
|
+
)
|
2231
|
+
return response_data.response
|
2232
|
+
|
2233
|
+
|
2234
|
+
def _search_structured_serialize(
|
2235
|
+
self,
|
2236
|
+
address,
|
2237
|
+
neighbourhood,
|
2238
|
+
borough,
|
2239
|
+
locality,
|
2240
|
+
county,
|
2241
|
+
region,
|
2242
|
+
postalcode,
|
2243
|
+
country,
|
2244
|
+
focus_point_lat,
|
2245
|
+
focus_point_lon,
|
2246
|
+
boundary_rect_min_lat,
|
2247
|
+
boundary_rect_max_lat,
|
2248
|
+
boundary_rect_min_lon,
|
2249
|
+
boundary_rect_max_lon,
|
2250
|
+
boundary_circle_lat,
|
2251
|
+
boundary_circle_lon,
|
2252
|
+
boundary_circle_radius,
|
2253
|
+
boundary_country,
|
2254
|
+
boundary_gid,
|
2255
|
+
layers,
|
2256
|
+
sources,
|
2257
|
+
size,
|
2258
|
+
lang,
|
2259
|
+
_request_auth,
|
2260
|
+
_content_type,
|
2261
|
+
_headers,
|
2262
|
+
_host_index,
|
2263
|
+
) -> RequestSerialized:
|
2264
|
+
|
2265
|
+
_host = None
|
2266
|
+
|
2267
|
+
_collection_formats: Dict[str, str] = {
|
2268
|
+
'boundary.country': 'csv',
|
2269
|
+
'layers': 'csv',
|
2270
|
+
'sources': 'csv',
|
2271
|
+
}
|
1212
2272
|
|
1213
|
-
|
1214
|
-
|
2273
|
+
_path_params: Dict[str, str] = {}
|
2274
|
+
_query_params: List[Tuple[str, str]] = []
|
2275
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
2276
|
+
_form_params: List[Tuple[str, str]] = []
|
2277
|
+
_files: Dict[str, str] = {}
|
2278
|
+
_body_params: Optional[bytes] = None
|
1215
2279
|
|
2280
|
+
# process the path parameters
|
2281
|
+
# process the query parameters
|
2282
|
+
if address is not None:
|
2283
|
+
|
2284
|
+
_query_params.append(('address', address))
|
2285
|
+
|
2286
|
+
if neighbourhood is not None:
|
2287
|
+
|
2288
|
+
_query_params.append(('neighbourhood', neighbourhood))
|
2289
|
+
|
2290
|
+
if borough is not None:
|
2291
|
+
|
2292
|
+
_query_params.append(('borough', borough))
|
2293
|
+
|
2294
|
+
if locality is not None:
|
2295
|
+
|
2296
|
+
_query_params.append(('locality', locality))
|
2297
|
+
|
2298
|
+
if county is not None:
|
2299
|
+
|
2300
|
+
_query_params.append(('county', county))
|
2301
|
+
|
2302
|
+
if region is not None:
|
2303
|
+
|
2304
|
+
_query_params.append(('region', region))
|
2305
|
+
|
2306
|
+
if postalcode is not None:
|
2307
|
+
|
2308
|
+
_query_params.append(('postalcode', postalcode))
|
2309
|
+
|
2310
|
+
if country is not None:
|
2311
|
+
|
2312
|
+
_query_params.append(('country', country))
|
2313
|
+
|
2314
|
+
if focus_point_lat is not None:
|
2315
|
+
|
2316
|
+
_query_params.append(('focus.point.lat', focus_point_lat))
|
2317
|
+
|
2318
|
+
if focus_point_lon is not None:
|
2319
|
+
|
2320
|
+
_query_params.append(('focus.point.lon', focus_point_lon))
|
2321
|
+
|
2322
|
+
if boundary_rect_min_lat is not None:
|
2323
|
+
|
2324
|
+
_query_params.append(('boundary.rect.min_lat', boundary_rect_min_lat))
|
2325
|
+
|
2326
|
+
if boundary_rect_max_lat is not None:
|
2327
|
+
|
2328
|
+
_query_params.append(('boundary.rect.max_lat', boundary_rect_max_lat))
|
2329
|
+
|
2330
|
+
if boundary_rect_min_lon is not None:
|
2331
|
+
|
2332
|
+
_query_params.append(('boundary.rect.min_lon', boundary_rect_min_lon))
|
2333
|
+
|
2334
|
+
if boundary_rect_max_lon is not None:
|
2335
|
+
|
2336
|
+
_query_params.append(('boundary.rect.max_lon', boundary_rect_max_lon))
|
2337
|
+
|
2338
|
+
if boundary_circle_lat is not None:
|
2339
|
+
|
2340
|
+
_query_params.append(('boundary.circle.lat', boundary_circle_lat))
|
2341
|
+
|
2342
|
+
if boundary_circle_lon is not None:
|
2343
|
+
|
2344
|
+
_query_params.append(('boundary.circle.lon', boundary_circle_lon))
|
2345
|
+
|
2346
|
+
if boundary_circle_radius is not None:
|
2347
|
+
|
2348
|
+
_query_params.append(('boundary.circle.radius', boundary_circle_radius))
|
2349
|
+
|
2350
|
+
if boundary_country is not None:
|
2351
|
+
|
2352
|
+
_query_params.append(('boundary.country', boundary_country))
|
2353
|
+
|
2354
|
+
if boundary_gid is not None:
|
2355
|
+
|
2356
|
+
_query_params.append(('boundary.gid', boundary_gid))
|
2357
|
+
|
2358
|
+
if layers is not None:
|
2359
|
+
|
2360
|
+
_query_params.append(('layers', layers))
|
2361
|
+
|
2362
|
+
if sources is not None:
|
2363
|
+
|
2364
|
+
_query_params.append(('sources', sources))
|
2365
|
+
|
2366
|
+
if size is not None:
|
2367
|
+
|
2368
|
+
_query_params.append(('size', size))
|
2369
|
+
|
2370
|
+
if lang is not None:
|
2371
|
+
|
2372
|
+
_query_params.append(('lang', lang))
|
2373
|
+
|
1216
2374
|
# process the header parameters
|
1217
|
-
_header_params = dict(_params.get('_headers', {}))
|
1218
2375
|
# process the form parameters
|
1219
|
-
_form_params = []
|
1220
|
-
_files = {}
|
1221
2376
|
# process the body parameter
|
1222
|
-
|
2377
|
+
|
2378
|
+
|
1223
2379
|
# set the HTTP header `Accept`
|
1224
2380
|
_header_params['Accept'] = self.api_client.select_header_accept(
|
1225
|
-
[
|
2381
|
+
[
|
2382
|
+
'application/json'
|
2383
|
+
]
|
2384
|
+
)
|
1226
2385
|
|
1227
|
-
# authentication setting
|
1228
|
-
_auth_settings = ['ApiKeyAuth'] # noqa: E501
|
1229
2386
|
|
1230
|
-
|
1231
|
-
|
1232
|
-
'
|
1233
|
-
|
2387
|
+
# authentication setting
|
2388
|
+
_auth_settings: List[str] = [
|
2389
|
+
'ApiKeyAuth'
|
2390
|
+
]
|
1234
2391
|
|
1235
|
-
return self.api_client.
|
1236
|
-
'
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
2392
|
+
return self.api_client.param_serialize(
|
2393
|
+
method='GET',
|
2394
|
+
resource_path='/geocoding/v1/search/structured',
|
2395
|
+
path_params=_path_params,
|
2396
|
+
query_params=_query_params,
|
2397
|
+
header_params=_header_params,
|
1240
2398
|
body=_body_params,
|
1241
2399
|
post_params=_form_params,
|
1242
2400
|
files=_files,
|
1243
|
-
response_types_map=_response_types_map,
|
1244
2401
|
auth_settings=_auth_settings,
|
1245
|
-
async_req=_params.get('async_req'),
|
1246
|
-
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
|
1247
|
-
_preload_content=_params.get('_preload_content', True),
|
1248
|
-
_request_timeout=_params.get('_request_timeout'),
|
1249
2402
|
collection_formats=_collection_formats,
|
1250
|
-
|
2403
|
+
_host=_host,
|
2404
|
+
_request_auth=_request_auth
|
2405
|
+
)
|
2406
|
+
|
2407
|
+
|