stadiamaps 4.0.0__py3-none-any.whl → 6.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 +32 -14
- stadiamaps/api/geocoding_api.py +976 -153
- stadiamaps/api/geospatial_api.py +7 -3
- stadiamaps/api/routing_api.py +22 -8
- stadiamaps/api_client.py +15 -6
- stadiamaps/configuration.py +156 -40
- stadiamaps/exceptions.py +18 -1
- stadiamaps/models/__init__.py +31 -13
- stadiamaps/models/access.py +1 -1
- stadiamaps/models/addendum_v2.py +143 -0
- stadiamaps/models/address_components_v2.py +134 -0
- stadiamaps/models/admin_region.py +1 -1
- stadiamaps/models/administrative.py +1 -1
- stadiamaps/models/annotation_filters.py +1 -1
- stadiamaps/models/auto_costing_options.py +1 -1
- stadiamaps/models/base_costing_options.py +1 -1
- stadiamaps/models/base_trace_request.py +4 -4
- stadiamaps/models/bicycle_costing_options.py +1 -1
- stadiamaps/models/bike_network.py +1 -1
- stadiamaps/models/bulk_request.py +1 -1
- stadiamaps/models/bulk_request_query.py +1 -1
- stadiamaps/models/bulk_search_response.py +4 -4
- stadiamaps/models/context.py +119 -0
- stadiamaps/models/contour.py +1 -1
- stadiamaps/models/coordinate.py +1 -1
- stadiamaps/models/costing_model.py +1 -1
- stadiamaps/models/costing_options.py +1 -1
- stadiamaps/models/directions_options.py +4 -4
- stadiamaps/models/distance_unit.py +1 -1
- stadiamaps/models/edge_sign.py +1 -1
- stadiamaps/models/edge_use.py +1 -1
- stadiamaps/models/end_node.py +1 -1
- stadiamaps/models/extended_directions_options.py +1 -1
- stadiamaps/models/feature_properties_v2.py +126 -0
- stadiamaps/models/feature_properties_v2_properties.py +184 -0
- stadiamaps/models/foursquare_addendum.py +113 -0
- stadiamaps/models/geo_attributes.py +1 -1
- stadiamaps/models/geo_json_geometry.py +1 -1
- stadiamaps/models/geo_json_geometry_base.py +1 -1
- stadiamaps/models/geo_json_line_string.py +1 -1
- stadiamaps/models/geo_json_point.py +1 -1
- stadiamaps/models/geo_json_polygon.py +1 -1
- stadiamaps/models/{pelias_response.py → geocode_response.py} +8 -8
- stadiamaps/models/geocode_response_envelope_properties_v2.py +125 -0
- stadiamaps/models/{pelias_geo_json_feature.py → geocoding_geo_json_feature.py} +8 -8
- stadiamaps/models/{pelias_geo_json_properties.py → geocoding_geo_json_properties.py} +43 -15
- stadiamaps/models/{pelias_geo_json_properties_addendum.py → geocoding_geo_json_properties_addendum.py} +7 -7
- stadiamaps/models/{pelias_geo_json_properties_addendum_osm.py → geocoding_geo_json_properties_addendum_osm.py} +5 -5
- stadiamaps/models/{pelias_layer.py → geocoding_layer.py} +3 -3
- stadiamaps/models/geocoding_meta.py +108 -0
- stadiamaps/models/geocoding_object.py +1 -1
- stadiamaps/models/{pelias_source.py → geocoding_source.py} +4 -3
- stadiamaps/models/geonames_addendum.py +101 -0
- stadiamaps/models/height_request.py +1 -1
- stadiamaps/models/height_response.py +1 -1
- stadiamaps/models/highway_classification.py +1 -1
- stadiamaps/models/intersecting_edge.py +1 -1
- stadiamaps/models/isochrone_costing_model.py +1 -1
- stadiamaps/models/isochrone_feature.py +1 -1
- stadiamaps/models/isochrone_properties.py +1 -1
- stadiamaps/models/isochrone_request.py +1 -1
- stadiamaps/models/isochrone_response.py +1 -1
- stadiamaps/models/layer_id.py +57 -0
- stadiamaps/models/locate_detailed_edge.py +1 -1
- stadiamaps/models/locate_edge.py +1 -1
- stadiamaps/models/locate_edge_info.py +1 -1
- stadiamaps/models/locate_node.py +1 -1
- stadiamaps/models/locate_object.py +1 -1
- stadiamaps/models/low_speed_vehicle_costing_options.py +1 -1
- stadiamaps/models/maneuver_sign.py +1 -1
- stadiamaps/models/maneuver_sign_element.py +1 -1
- stadiamaps/models/map_match_costing_model.py +1 -1
- stadiamaps/models/map_match_request.py +10 -8
- stadiamaps/models/map_match_route_response.py +1 -1
- stadiamaps/models/map_match_trace_options.py +1 -1
- stadiamaps/models/map_match_waypoint.py +3 -3
- stadiamaps/models/match_type.py +39 -0
- stadiamaps/models/matched_point.py +1 -1
- stadiamaps/models/matrix_costing_model.py +1 -1
- stadiamaps/models/matrix_distance.py +1 -1
- stadiamaps/models/matrix_request.py +4 -4
- stadiamaps/models/matrix_response.py +4 -4
- stadiamaps/models/matrix_waypoint.py +1 -1
- stadiamaps/models/motor_scooter_costing_options.py +1 -1
- stadiamaps/models/motorcycle_costing_options.py +1 -1
- stadiamaps/models/nearest_roads_request.py +4 -4
- stadiamaps/models/node_id.py +1 -1
- stadiamaps/models/node_type.py +1 -1
- stadiamaps/models/open_street_map_addendum.py +162 -0
- stadiamaps/models/optimized_route_request.py +10 -8
- stadiamaps/models/osrm_admin.py +1 -1
- stadiamaps/models/osrm_annotation.py +1 -1
- stadiamaps/models/osrm_banner_component.py +1 -1
- stadiamaps/models/osrm_banner_content.py +1 -1
- stadiamaps/models/osrm_banner_instruction.py +1 -1
- stadiamaps/models/osrm_base_api_response.py +1 -1
- stadiamaps/models/osrm_guidance_modifier.py +1 -1
- stadiamaps/models/osrm_intersection.py +1 -1
- stadiamaps/models/osrm_lane.py +1 -1
- stadiamaps/models/osrm_route.py +1 -1
- stadiamaps/models/osrm_route_leg.py +1 -1
- stadiamaps/models/osrm_route_response.py +1 -1
- stadiamaps/models/osrm_route_step.py +1 -1
- stadiamaps/models/osrm_speed_limit.py +1 -1
- stadiamaps/models/osrm_step_maneuver.py +1 -1
- stadiamaps/models/osrm_via_waypoint.py +1 -1
- stadiamaps/models/osrm_voice_instruction.py +1 -1
- stadiamaps/models/osrm_waypoint.py +1 -1
- stadiamaps/models/pedestrian_costing_options.py +8 -5
- stadiamaps/models/pedestrian_type.py +39 -0
- stadiamaps/models/point.py +104 -0
- stadiamaps/models/precision.py +38 -0
- stadiamaps/models/properties_v2.py +184 -0
- stadiamaps/models/restrictions.py +11 -11
- stadiamaps/models/road_class.py +1 -1
- stadiamaps/models/route200_response.py +1 -1
- stadiamaps/models/route_leg.py +1 -1
- stadiamaps/models/route_maneuver.py +1 -1
- stadiamaps/models/route_request.py +5 -5
- stadiamaps/models/route_response.py +1 -1
- stadiamaps/models/route_response_alternates_inner.py +1 -1
- stadiamaps/models/route_summary.py +1 -1
- stadiamaps/models/route_trip.py +7 -7
- stadiamaps/models/{valhalla_languages.py → routing_languages.py} +4 -4
- stadiamaps/models/{valhalla_long_units.py → routing_long_units.py} +4 -4
- stadiamaps/models/routing_response_waypoint.py +3 -3
- stadiamaps/models/routing_waypoint.py +3 -3
- stadiamaps/models/routing_waypoint_all_of_search_filter.py +1 -1
- stadiamaps/models/search_query.py +7 -7
- stadiamaps/models/search_structured_query.py +8 -8
- stadiamaps/models/simple_routing_waypoint.py +3 -3
- stadiamaps/models/source_attribution.py +110 -0
- stadiamaps/models/source_id.py +41 -0
- stadiamaps/models/speeds.py +1 -1
- stadiamaps/models/trace_attribute_filter_options.py +1 -1
- stadiamaps/models/trace_attribute_key.py +1 -1
- stadiamaps/models/trace_attributes_base_response.py +1 -1
- stadiamaps/models/trace_attributes_request.py +10 -8
- stadiamaps/models/trace_attributes_response.py +4 -9
- stadiamaps/models/trace_edge.py +2 -7
- stadiamaps/models/travel_mode.py +1 -1
- stadiamaps/models/traversability.py +1 -1
- stadiamaps/models/truck_costing_options.py +1 -1
- stadiamaps/models/tz_response.py +1 -1
- stadiamaps/models/warning.py +1 -1
- stadiamaps/models/whos_on_first_concordances.py +246 -0
- stadiamaps/models/wof_context.py +210 -0
- stadiamaps/models/wof_context_component.py +110 -0
- stadiamaps/rest.py +2 -2
- stadiamaps-6.0.0.dist-info/METADATA +117 -0
- stadiamaps-6.0.0.dist-info/RECORD +183 -0
- {stadiamaps-4.0.0.dist-info → stadiamaps-6.0.0.dist-info}/WHEEL +1 -1
- {stadiamaps-4.0.0.dist-info → stadiamaps-6.0.0.dist-info}/top_level.txt +1 -0
- test/integration/__init__.py +0 -0
- test/integration/test_eu_endpoint.py +21 -0
- test/integration/test_gecoding.py +112 -0
- test/integration/test_geospatial.py +43 -0
- test/integration/test_routing.py +282 -0
- stadiamaps/models/pelias_response_geocoding.py +0 -89
- stadiamaps/models/route_response_trip.py +0 -117
- stadiamaps/models/trace_attributes_response_all_of.py +0 -96
- stadiamaps-4.0.0.dist-info/METADATA +0 -79
- stadiamaps-4.0.0.dist-info/RECORD +0 -160
- {stadiamaps-4.0.0.dist-info → stadiamaps-6.0.0.dist-info/licenses}/LICENSE.txt +0 -0
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 8.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -21,18 +21,18 @@ import json
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
23
|
from typing_extensions import Annotated
|
24
|
+
from stadiamaps.models.geocoding_geo_json_feature import GeocodingGeoJSONFeature
|
24
25
|
from stadiamaps.models.geocoding_object import GeocodingObject
|
25
|
-
from stadiamaps.models.pelias_geo_json_feature import PeliasGeoJSONFeature
|
26
26
|
from typing import Optional, Set
|
27
27
|
from typing_extensions import Self
|
28
28
|
|
29
|
-
class
|
29
|
+
class GeocodeResponse(BaseModel):
|
30
30
|
"""
|
31
|
-
|
31
|
+
GeocodeResponse
|
32
32
|
""" # noqa: E501
|
33
33
|
geocoding: GeocodingObject
|
34
34
|
bbox: Optional[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=4, max_length=4)]] = Field(default=None, description="An array of 4 floating point numbers representing the (W, S, E, N) extremes of the features found.")
|
35
|
-
features: List[
|
35
|
+
features: List[GeocodingGeoJSONFeature]
|
36
36
|
additional_properties: Dict[str, Any] = {}
|
37
37
|
__properties: ClassVar[List[str]] = ["geocoding", "bbox", "features"]
|
38
38
|
|
@@ -54,7 +54,7 @@ class PeliasResponse(BaseModel):
|
|
54
54
|
|
55
55
|
@classmethod
|
56
56
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
57
|
-
"""Create an instance of
|
57
|
+
"""Create an instance of GeocodeResponse from a JSON string"""
|
58
58
|
return cls.from_dict(json.loads(json_str))
|
59
59
|
|
60
60
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -96,7 +96,7 @@ class PeliasResponse(BaseModel):
|
|
96
96
|
|
97
97
|
@classmethod
|
98
98
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
99
|
-
"""Create an instance of
|
99
|
+
"""Create an instance of GeocodeResponse from a dict"""
|
100
100
|
if obj is None:
|
101
101
|
return None
|
102
102
|
|
@@ -106,7 +106,7 @@ class PeliasResponse(BaseModel):
|
|
106
106
|
_obj = cls.model_validate({
|
107
107
|
"geocoding": GeocodingObject.from_dict(obj["geocoding"]) if obj.get("geocoding") is not None else None,
|
108
108
|
"bbox": obj.get("bbox"),
|
109
|
-
"features": [
|
109
|
+
"features": [GeocodingGeoJSONFeature.from_dict(_item) for _item in obj["features"]] if obj.get("features") is not None else None
|
110
110
|
})
|
111
111
|
# store additional fields in additional_properties
|
112
112
|
for _key in obj.keys():
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Stadia Maps Geospatial APIs
|
5
|
+
|
6
|
+
The Stadia Maps Geospatial APIs provide you with the data you need to build awesome applications.
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 9.0.0
|
9
|
+
Contact: support@stadiamaps.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from stadiamaps.models.feature_properties_v2 import FeaturePropertiesV2
|
25
|
+
from stadiamaps.models.geocoding_meta import GeocodingMeta
|
26
|
+
from typing import Optional, Set
|
27
|
+
from typing_extensions import Self
|
28
|
+
|
29
|
+
class GeocodeResponseEnvelopePropertiesV2(BaseModel):
|
30
|
+
"""
|
31
|
+
The GeoJSON response envelope. This is parameterized over the feature properties type to allow for changes between versions.
|
32
|
+
""" # noqa: E501
|
33
|
+
bbox: Optional[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=4, max_length=4)]] = Field(default=None, description="The geographic bounding box covering all features in the result set. This is empty for autocomplete results.")
|
34
|
+
features: List[FeaturePropertiesV2]
|
35
|
+
geocoding: GeocodingMeta
|
36
|
+
type: StrictStr = Field(description="The GeoJSON object type as defined in RFC 7946. NOTE: This is always FeatureCollection, as the response envelope is designed to hold multiple results.")
|
37
|
+
additional_properties: Dict[str, Any] = {}
|
38
|
+
__properties: ClassVar[List[str]] = ["bbox", "features", "geocoding", "type"]
|
39
|
+
|
40
|
+
model_config = ConfigDict(
|
41
|
+
populate_by_name=True,
|
42
|
+
validate_assignment=True,
|
43
|
+
protected_namespaces=(),
|
44
|
+
)
|
45
|
+
|
46
|
+
|
47
|
+
def to_str(self) -> str:
|
48
|
+
"""Returns the string representation of the model using alias"""
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
50
|
+
|
51
|
+
def to_json(self) -> str:
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
54
|
+
return json.dumps(self.to_dict())
|
55
|
+
|
56
|
+
@classmethod
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
58
|
+
"""Create an instance of GeocodeResponseEnvelopePropertiesV2 from a JSON string"""
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
60
|
+
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
63
|
+
|
64
|
+
This has the following differences from calling pydantic's
|
65
|
+
`self.model_dump(by_alias=True)`:
|
66
|
+
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
68
|
+
were set at model initialization. Other fields with value `None`
|
69
|
+
are ignored.
|
70
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
71
|
+
"""
|
72
|
+
excluded_fields: Set[str] = set([
|
73
|
+
"additional_properties",
|
74
|
+
])
|
75
|
+
|
76
|
+
_dict = self.model_dump(
|
77
|
+
by_alias=True,
|
78
|
+
exclude=excluded_fields,
|
79
|
+
exclude_none=True,
|
80
|
+
)
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in features (list)
|
82
|
+
_items = []
|
83
|
+
if self.features:
|
84
|
+
for _item_features in self.features:
|
85
|
+
if _item_features:
|
86
|
+
_items.append(_item_features.to_dict())
|
87
|
+
_dict['features'] = _items
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of geocoding
|
89
|
+
if self.geocoding:
|
90
|
+
_dict['geocoding'] = self.geocoding.to_dict()
|
91
|
+
# puts key-value pairs in additional_properties in the top level
|
92
|
+
if self.additional_properties is not None:
|
93
|
+
for _key, _value in self.additional_properties.items():
|
94
|
+
_dict[_key] = _value
|
95
|
+
|
96
|
+
# set to None if bbox (nullable) is None
|
97
|
+
# and model_fields_set contains the field
|
98
|
+
if self.bbox is None and "bbox" in self.model_fields_set:
|
99
|
+
_dict['bbox'] = None
|
100
|
+
|
101
|
+
return _dict
|
102
|
+
|
103
|
+
@classmethod
|
104
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
105
|
+
"""Create an instance of GeocodeResponseEnvelopePropertiesV2 from a dict"""
|
106
|
+
if obj is None:
|
107
|
+
return None
|
108
|
+
|
109
|
+
if not isinstance(obj, dict):
|
110
|
+
return cls.model_validate(obj)
|
111
|
+
|
112
|
+
_obj = cls.model_validate({
|
113
|
+
"bbox": obj.get("bbox"),
|
114
|
+
"features": [FeaturePropertiesV2.from_dict(_item) for _item in obj["features"]] if obj.get("features") is not None else None,
|
115
|
+
"geocoding": GeocodingMeta.from_dict(obj["geocoding"]) if obj.get("geocoding") is not None else None,
|
116
|
+
"type": obj.get("type")
|
117
|
+
})
|
118
|
+
# store additional fields in additional_properties
|
119
|
+
for _key in obj.keys():
|
120
|
+
if _key not in cls.__properties:
|
121
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
122
|
+
|
123
|
+
return _obj
|
124
|
+
|
125
|
+
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -22,17 +22,17 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, Stric
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
23
|
from typing_extensions import Annotated
|
24
24
|
from stadiamaps.models.geo_json_point import GeoJSONPoint
|
25
|
-
from stadiamaps.models.
|
25
|
+
from stadiamaps.models.geocoding_geo_json_properties import GeocodingGeoJSONProperties
|
26
26
|
from typing import Optional, Set
|
27
27
|
from typing_extensions import Self
|
28
28
|
|
29
|
-
class
|
29
|
+
class GeocodingGeoJSONFeature(BaseModel):
|
30
30
|
"""
|
31
|
-
|
31
|
+
GeocodingGeoJSONFeature
|
32
32
|
""" # noqa: E501
|
33
33
|
type: StrictStr
|
34
34
|
geometry: GeoJSONPoint
|
35
|
-
properties: Optional[
|
35
|
+
properties: Optional[GeocodingGeoJSONProperties] = None
|
36
36
|
bbox: Optional[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=4, max_length=4)]] = Field(default=None, description="An array of 4 floating point numbers representing the (W, S, E, N) extremes of the features found.")
|
37
37
|
additional_properties: Dict[str, Any] = {}
|
38
38
|
__properties: ClassVar[List[str]] = ["type", "geometry", "properties", "bbox"]
|
@@ -62,7 +62,7 @@ class PeliasGeoJSONFeature(BaseModel):
|
|
62
62
|
|
63
63
|
@classmethod
|
64
64
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
65
|
-
"""Create an instance of
|
65
|
+
"""Create an instance of GeocodingGeoJSONFeature from a JSON string"""
|
66
66
|
return cls.from_dict(json.loads(json_str))
|
67
67
|
|
68
68
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -100,7 +100,7 @@ class PeliasGeoJSONFeature(BaseModel):
|
|
100
100
|
|
101
101
|
@classmethod
|
102
102
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
103
|
-
"""Create an instance of
|
103
|
+
"""Create an instance of GeocodingGeoJSONFeature from a dict"""
|
104
104
|
if obj is None:
|
105
105
|
return None
|
106
106
|
|
@@ -110,7 +110,7 @@ class PeliasGeoJSONFeature(BaseModel):
|
|
110
110
|
_obj = cls.model_validate({
|
111
111
|
"type": obj.get("type"),
|
112
112
|
"geometry": GeoJSONPoint.from_dict(obj["geometry"]) if obj.get("geometry") is not None else None,
|
113
|
-
"properties":
|
113
|
+
"properties": GeocodingGeoJSONProperties.from_dict(obj["properties"]) if obj.get("properties") is not None else None,
|
114
114
|
"bbox": obj.get("bbox")
|
115
115
|
})
|
116
116
|
# store additional fields in additional_properties
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -19,26 +19,29 @@ import re # noqa: F401
|
|
19
19
|
import json
|
20
20
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
-
from
|
24
|
-
from stadiamaps.models.
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
23
|
+
from typing_extensions import Annotated
|
24
|
+
from stadiamaps.models.geocoding_geo_json_properties_addendum import GeocodingGeoJSONPropertiesAddendum
|
25
25
|
from typing import Optional, Set
|
26
26
|
from typing_extensions import Self
|
27
27
|
|
28
|
-
class
|
28
|
+
class GeocodingGeoJSONProperties(BaseModel):
|
29
29
|
"""
|
30
|
-
|
30
|
+
GeocodingGeoJSONProperties
|
31
31
|
""" # noqa: E501
|
32
|
-
gid: Optional[StrictStr] = Field(default=None, description="A scoped GID for this result. This can be passed to the place endpoint. Note that these are not always stable
|
32
|
+
gid: Optional[StrictStr] = Field(default=None, description="A scoped GID for this result. This can be passed to the place endpoint. Note that these are not always stable long-term.")
|
33
33
|
source_id: Optional[StrictStr] = Field(default=None, description="An ID referencing the original data source (specified via source) for the result. These IDs are specific to the source that they originated from. For example, in the case of OSM, these typically look like way/123 or point/123.")
|
34
34
|
label: Optional[StrictStr] = Field(default=None, description="A full, human-readable label. However, you may not necessarily want to use this; be sure to read the docs for name, locality, and region before making a decision. This field is mostly localized. The order of components is generally locally correct (ex: for an address in South Korea, the house number appears after the street name). However, components will use a request language equivalent if one exists (ex: Seoul instead of 서울 if lang=en).")
|
35
|
-
layer: Optional[
|
35
|
+
layer: Optional[StrictStr] = Field(default=None, description="The data layer containing the place (e.g. \"address\" or \"venue\").")
|
36
|
+
source: Optional[StrictStr] = Field(default=None, description="The ID of the data source that the result came from.")
|
36
37
|
name: Optional[StrictStr] = Field(default=None, description="The name of the place, the street address including house number, or label of similar relevance. If your app is localized to a specific region, you may get better display results by combining name, locality OR region (or neither?), and postal code together in the local format. Experiment with what works best for your use case.")
|
37
38
|
accuracy: Optional[StrictStr] = Field(default=None, description="The accuracy of the geographic coordinates in the result. This value is a property of the result itself and won't change based on the query. A point result means that the record can reasonably be represented by a single geographic point. Addresses, venues, or interpolated addresses usually have point accuracy. Larger areas, such as a city or country, cannot be represented by a single point, so a centroid is given instead.")
|
38
|
-
addendum: Optional[
|
39
|
+
addendum: Optional[GeocodingGeoJSONPropertiesAddendum] = None
|
39
40
|
continent: Optional[StrictStr] = None
|
40
41
|
continent_gid: Optional[StrictStr] = None
|
41
42
|
country: Optional[StrictStr] = None
|
43
|
+
country_a: Optional[StrictStr] = Field(default=None, description="The ISO 3166-1 alpha-3 code for the country the place is located in.")
|
44
|
+
country_code: Optional[StrictStr] = Field(default=None, description="The ISO 3166-1 alpha-2 code for the country the place is located in.")
|
42
45
|
country_gid: Optional[StrictStr] = None
|
43
46
|
neighbourhood: Optional[StrictStr] = None
|
44
47
|
neighbourhood_gid: Optional[StrictStr] = None
|
@@ -50,10 +53,16 @@ class PeliasGeoJSONProperties(BaseModel):
|
|
50
53
|
locality: Optional[StrictStr] = Field(default=None, description="The city, village, town, etc. that the place / address is part of. Note that values may not always match postal or local conventions perfectly.")
|
51
54
|
locality_gid: Optional[StrictStr] = None
|
52
55
|
county: Optional[StrictStr] = Field(default=None, description="Administrative divisions between localities and regions. Useful for disambiguating nearby results with similar names.")
|
56
|
+
county_gid: Optional[StrictStr] = None
|
53
57
|
region: Optional[StrictStr] = Field(default=None, description="Typically the first administrative division within a country. For example, a US state or a Canadian province.")
|
54
|
-
region_a: Optional[StrictStr] = Field(default=None, description="The abbreviation for the region.")
|
58
|
+
region_a: Optional[StrictStr] = Field(default=None, description="The abbreviation for the region (e.g. PA for the US state of Pennsylvania).")
|
59
|
+
region_gid: Optional[StrictStr] = None
|
60
|
+
localadmin: Optional[StrictStr] = Field(default=None, description="In many countries, this is the lowest level of government. Sometimes interchangeable with locality.")
|
61
|
+
localadmin_gid: Optional[StrictStr] = None
|
62
|
+
match_type: Optional[StrictStr] = Field(default=None, description="For search and structured search results, the type of match.")
|
63
|
+
confidence: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="The level of confidence that the result matches what the user searched for. Only available on forward geocoding endpoints.")
|
55
64
|
additional_properties: Dict[str, Any] = {}
|
56
|
-
__properties: ClassVar[List[str]] = ["gid", "source_id", "label", "layer", "name", "accuracy", "addendum", "continent", "continent_gid", "country", "country_gid", "neighbourhood", "neighbourhood_gid", "borough", "borough_gid", "postalcode", "street", "housenumber", "locality", "locality_gid", "county", "region", "region_a"]
|
65
|
+
__properties: ClassVar[List[str]] = ["gid", "source_id", "label", "layer", "source", "name", "accuracy", "addendum", "continent", "continent_gid", "country", "country_a", "country_code", "country_gid", "neighbourhood", "neighbourhood_gid", "borough", "borough_gid", "postalcode", "street", "housenumber", "locality", "locality_gid", "county", "county_gid", "region", "region_a", "region_gid", "localadmin", "localadmin_gid", "match_type", "confidence"]
|
57
66
|
|
58
67
|
@field_validator('accuracy')
|
59
68
|
def accuracy_validate_enum(cls, value):
|
@@ -65,6 +74,16 @@ class PeliasGeoJSONProperties(BaseModel):
|
|
65
74
|
raise ValueError("must be one of enum values ('point', 'centroid')")
|
66
75
|
return value
|
67
76
|
|
77
|
+
@field_validator('match_type')
|
78
|
+
def match_type_validate_enum(cls, value):
|
79
|
+
"""Validates the enum"""
|
80
|
+
if value is None:
|
81
|
+
return value
|
82
|
+
|
83
|
+
if value not in set(['exact', 'interpolated', 'fallback']):
|
84
|
+
raise ValueError("must be one of enum values ('exact', 'interpolated', 'fallback')")
|
85
|
+
return value
|
86
|
+
|
68
87
|
model_config = ConfigDict(
|
69
88
|
populate_by_name=True,
|
70
89
|
validate_assignment=True,
|
@@ -83,7 +102,7 @@ class PeliasGeoJSONProperties(BaseModel):
|
|
83
102
|
|
84
103
|
@classmethod
|
85
104
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
86
|
-
"""Create an instance of
|
105
|
+
"""Create an instance of GeocodingGeoJSONProperties from a JSON string"""
|
87
106
|
return cls.from_dict(json.loads(json_str))
|
88
107
|
|
89
108
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -118,7 +137,7 @@ class PeliasGeoJSONProperties(BaseModel):
|
|
118
137
|
|
119
138
|
@classmethod
|
120
139
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
121
|
-
"""Create an instance of
|
140
|
+
"""Create an instance of GeocodingGeoJSONProperties from a dict"""
|
122
141
|
if obj is None:
|
123
142
|
return None
|
124
143
|
|
@@ -130,12 +149,15 @@ class PeliasGeoJSONProperties(BaseModel):
|
|
130
149
|
"source_id": obj.get("source_id"),
|
131
150
|
"label": obj.get("label"),
|
132
151
|
"layer": obj.get("layer"),
|
152
|
+
"source": obj.get("source"),
|
133
153
|
"name": obj.get("name"),
|
134
154
|
"accuracy": obj.get("accuracy"),
|
135
|
-
"addendum":
|
155
|
+
"addendum": GeocodingGeoJSONPropertiesAddendum.from_dict(obj["addendum"]) if obj.get("addendum") is not None else None,
|
136
156
|
"continent": obj.get("continent"),
|
137
157
|
"continent_gid": obj.get("continent_gid"),
|
138
158
|
"country": obj.get("country"),
|
159
|
+
"country_a": obj.get("country_a"),
|
160
|
+
"country_code": obj.get("country_code"),
|
139
161
|
"country_gid": obj.get("country_gid"),
|
140
162
|
"neighbourhood": obj.get("neighbourhood"),
|
141
163
|
"neighbourhood_gid": obj.get("neighbourhood_gid"),
|
@@ -147,8 +169,14 @@ class PeliasGeoJSONProperties(BaseModel):
|
|
147
169
|
"locality": obj.get("locality"),
|
148
170
|
"locality_gid": obj.get("locality_gid"),
|
149
171
|
"county": obj.get("county"),
|
172
|
+
"county_gid": obj.get("county_gid"),
|
150
173
|
"region": obj.get("region"),
|
151
|
-
"region_a": obj.get("region_a")
|
174
|
+
"region_a": obj.get("region_a"),
|
175
|
+
"region_gid": obj.get("region_gid"),
|
176
|
+
"localadmin": obj.get("localadmin"),
|
177
|
+
"localadmin_gid": obj.get("localadmin_gid"),
|
178
|
+
"match_type": obj.get("match_type"),
|
179
|
+
"confidence": obj.get("confidence")
|
152
180
|
})
|
153
181
|
# store additional fields in additional_properties
|
154
182
|
for _key in obj.keys():
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -20,15 +20,15 @@ import json
|
|
20
20
|
|
21
21
|
from pydantic import BaseModel, ConfigDict
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
-
from stadiamaps.models.
|
23
|
+
from stadiamaps.models.geocoding_geo_json_properties_addendum_osm import GeocodingGeoJSONPropertiesAddendumOsm
|
24
24
|
from typing import Optional, Set
|
25
25
|
from typing_extensions import Self
|
26
26
|
|
27
|
-
class
|
27
|
+
class GeocodingGeoJSONPropertiesAddendum(BaseModel):
|
28
28
|
"""
|
29
29
|
Optional additional information from the underlying data source (ex: OSM). This includes select fields. The most useful fields are mapped in the definition here, but others may be available.
|
30
30
|
""" # noqa: E501
|
31
|
-
osm: Optional[
|
31
|
+
osm: Optional[GeocodingGeoJSONPropertiesAddendumOsm] = None
|
32
32
|
additional_properties: Dict[str, Any] = {}
|
33
33
|
__properties: ClassVar[List[str]] = ["osm"]
|
34
34
|
|
@@ -50,7 +50,7 @@ class PeliasGeoJSONPropertiesAddendum(BaseModel):
|
|
50
50
|
|
51
51
|
@classmethod
|
52
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
53
|
-
"""Create an instance of
|
53
|
+
"""Create an instance of GeocodingGeoJSONPropertiesAddendum from a JSON string"""
|
54
54
|
return cls.from_dict(json.loads(json_str))
|
55
55
|
|
56
56
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -85,7 +85,7 @@ class PeliasGeoJSONPropertiesAddendum(BaseModel):
|
|
85
85
|
|
86
86
|
@classmethod
|
87
87
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
88
|
-
"""Create an instance of
|
88
|
+
"""Create an instance of GeocodingGeoJSONPropertiesAddendum from a dict"""
|
89
89
|
if obj is None:
|
90
90
|
return None
|
91
91
|
|
@@ -93,7 +93,7 @@ class PeliasGeoJSONPropertiesAddendum(BaseModel):
|
|
93
93
|
return cls.model_validate(obj)
|
94
94
|
|
95
95
|
_obj = cls.model_validate({
|
96
|
-
"osm":
|
96
|
+
"osm": GeocodingGeoJSONPropertiesAddendumOsm.from_dict(obj["osm"]) if obj.get("osm") is not None else None
|
97
97
|
})
|
98
98
|
# store additional fields in additional_properties
|
99
99
|
for _key in obj.keys():
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -23,9 +23,9 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
-
class
|
26
|
+
class GeocodingGeoJSONPropertiesAddendumOsm(BaseModel):
|
27
27
|
"""
|
28
|
-
|
28
|
+
GeocodingGeoJSONPropertiesAddendumOsm
|
29
29
|
""" # noqa: E501
|
30
30
|
website: Optional[StrictStr] = None
|
31
31
|
wikipedia: Optional[StrictStr] = None
|
@@ -52,7 +52,7 @@ class PeliasGeoJSONPropertiesAddendumOsm(BaseModel):
|
|
52
52
|
|
53
53
|
@classmethod
|
54
54
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
-
"""Create an instance of
|
55
|
+
"""Create an instance of GeocodingGeoJSONPropertiesAddendumOsm from a JSON string"""
|
56
56
|
return cls.from_dict(json.loads(json_str))
|
57
57
|
|
58
58
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -84,7 +84,7 @@ class PeliasGeoJSONPropertiesAddendumOsm(BaseModel):
|
|
84
84
|
|
85
85
|
@classmethod
|
86
86
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
-
"""Create an instance of
|
87
|
+
"""Create an instance of GeocodingGeoJSONPropertiesAddendumOsm from a dict"""
|
88
88
|
if obj is None:
|
89
89
|
return None
|
90
90
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
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: 9.0.0
|
9
9
|
Contact: support@stadiamaps.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -19,7 +19,7 @@ from enum import Enum
|
|
19
19
|
from typing_extensions import Self
|
20
20
|
|
21
21
|
|
22
|
-
class
|
22
|
+
class GeocodingLayer(str, Enum):
|
23
23
|
"""
|
24
24
|
Our database is organized into several layers (in the GIS sense of the term) as follows: - `venue`: Points of interest, businesses, and things with walls - `address`: Places with a street address - `street`: Streets, roads, highways - `county`: Places that issue passports, nations, nation-states - `macroregion`: A related group of regions (mostly in Europe) - `region`: The first administrative division within a country (usually states and provinces) - `macrocounty`: A related group of counties (mostly in Europe) - `county`: Official governmental areas; usually bigger than a locality, but almost always smaller than a region - `locality`: Towns, hamlets, cities, etc. - `localadmin`: Local administrative boundaries - `borough`: Local administrative boundaries within cities (not widely used, but present in places such as NYC and Mexico City) - `neighbourhood`: Social communities and neighborhoods (note the British spelling in the API!) - `postalcode`: Postal codes used by mail services (note: not used for reverse geocoding) - `coarse`: An alias for simultaneously using all administrative layers (everything except `venue` and `address`) - `marinearea`: Places with fishes and boats. - `ocean`: A really big marine area.
|
25
25
|
"""
|
@@ -51,7 +51,7 @@ class PeliasLayer(str, Enum):
|
|
51
51
|
|
52
52
|
@classmethod
|
53
53
|
def from_json(cls, json_str: str) -> Self:
|
54
|
-
"""Create an instance of
|
54
|
+
"""Create an instance of GeocodingLayer from a JSON string"""
|
55
55
|
return cls(json.loads(json_str))
|
56
56
|
|
57
57
|
|