1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
use crate::{Value, Version};
use serde_json::Value as JsonValue;
use thiserror::Error;
/// Error enum for crate-specific errors.
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum Error {
/// [arrow_schema::ArrowError]
#[error(transparent)]
#[cfg(feature = "geoarrow")]
Arrow(#[from] arrow_schema::ArrowError),
/// [chrono::ParseError]
#[error(transparent)]
ChronoParse(#[from] chrono::ParseError),
/// [gdal::errors::GdalError]
#[cfg(feature = "gdal")]
#[error(transparent)]
GdalError(#[from] gdal::errors::GdalError),
/// A required feature is not enabled.
#[error("{0} is not enabled")]
FeatureNotEnabled(&'static str),
/// [geoarrow::error::GeoArrowError]
#[error(transparent)]
#[cfg(feature = "geoarrow")]
GeoArrow(#[from] geoarrow::error::GeoArrowError),
/// [geojson::Error]
#[error(transparent)]
Geojson(#[from] geojson::Error),
/// [std::io::Error]
#[error(transparent)]
Io(#[from] std::io::Error),
/// Returned when the `type` field of a STAC object is not a [String].
#[error("invalid \"type\" field: {0}")]
InvalidTypeField(JsonValue),
/// Returned when a property name conflicts with a top-level STAC field, or
/// it's an invalid top-level field name.
#[error("invalid attribute name: {0}")]
InvalidAttribute(String),
/// Returned when a STAC object has the wrong type field.
#[error("incorrect type: expected={expected}, actual={actual}")]
IncorrectType {
/// The actual type field on the object.
actual: String,
/// The expected value.
expected: String,
},
/// This vector is not a valid bounding box.
#[error("invalid bbox: {0:?}")]
InvalidBbox(Vec<f64>),
/// This string is not a valid datetime interval.
#[error("invalid datetime: {0}")]
InvalidDatetime(String),
/// Returned when there is not a `id` field on a STAC object
#[error("no \"id\" field in the JSON object")]
MissingId,
/// Returned when a geometry is missing but is required.
#[error("no geometry field")]
MissingGeometry,
/// Returned when there is not a `type` field on a STAC object
#[error("no \"type\" field in the JSON object")]
MissingType,
/// Returned when an object is expected to have an href, but it doesn't.
#[error("object has no href")]
MissingHref,
/// There are no items, when items are required.
#[error("no items")]
NoItems,
/// There is not an href, when an href is required.
#[error("no href")]
NoHref,
/// This value is not an item.
#[error("value is not an item")]
NotAnItem(Value),
/// This value is not a catalog.
#[error("value is not a catalog")]
NotACatalog(Value),
/// This value is not a collection.
#[error("value is not a collection")]
NotACollection(Value),
/// This value is not an object.
#[error("not an object")]
NotAnObject(serde_json::Value),
/// [object_store::Error]
#[error(transparent)]
#[cfg(feature = "object-store")]
ObjectStore(#[from] object_store::Error),
/// [object_store::path::Error]
#[error(transparent)]
#[cfg(feature = "object-store")]
ObjectStorePath(#[from] object_store::path::Error),
/// [parquet::errors::ParquetError]
#[error(transparent)]
#[cfg(feature = "geoparquet")]
Parquet(#[from] parquet::errors::ParquetError),
/// [reqwest::Error]
#[cfg(feature = "reqwest")]
#[error(transparent)]
Reqwest(#[from] reqwest::Error),
/// [serde_json::Error]
#[error(transparent)]
SerdeJson(#[from] serde_json::Error),
/// [std::num::TryFromIntError]
#[error(transparent)]
TryFromInt(#[from] std::num::TryFromIntError),
/// Returned when the `type` field of a STAC object does not equal `"Feature"`, `"Catalog"`, or `"Collection"`.
#[error("unknown \"type\": {0}")]
UnknownType(String),
/// Unsupported version.
#[error("unsupported version: {0}")]
UnsupportedVersion(String),
/// Unsupported migration.
#[error("unsupported migration: {0} to {1}")]
UnsupportedMigration(Version, Version),
/// Unsupported file format.
#[error("unsupported format: {0}")]
UnsupportedFormat(String),
/// Unsupported geoparquet type
#[error("unsupported geoparquet type")]
UnsupportedGeoparquetType,
/// [url::ParseError]
#[error(transparent)]
Url(#[from] url::ParseError),
}