Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for usage in tile-grid #18

Merged
merged 3 commits into from
Aug 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ services:
/bin/sh -c "
/usr/bin/mc alias set myminio http://minio:9000 minioadmin minioadmin;
/usr/bin/mc mb myminio/${AWS_S3_BUCKET_NAME};
/usr/bin/mc policy set public myminio/${AWS_S3_BUCKET_NAME};
/usr/bin/mc anonymous set public myminio/${AWS_S3_BUCKET_NAME};
/usr/bin/mc admin user add myminio ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY};
/usr/bin/mc admin policy set myminio readwrite user=${AWS_ACCESS_KEY_ID};
/usr/bin/mc admin policy attach myminio readwrite --user ${AWS_ACCESS_KEY_ID};
exit 0;
"
2 changes: 1 addition & 1 deletion ogcapi-services/src/routes/processes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async fn processes(
}
}

summaries.iter_mut().for_each(|mut p| {
summaries.iter_mut().for_each(|p| {
p.links = vec![
Link::new(format!("{}/{}", &url[..Position::AfterPath], p.id), SELF)
.mediatype(JSON)
Expand Down
2 changes: 1 addition & 1 deletion ogcapi-services/tests/edr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async fn edr() -> anyhow::Result<()> {
let body = hyper::body::to_bytes(res.into_body()).await?;
let mut fc: FeatureCollection = serde_json::from_slice(&body)?;

for mut feature in fc.features.iter_mut() {
for feature in fc.features.iter_mut() {
feature.geometry = Geometry::new(Value::Point(vec![0.0, 0.0]));
}

Expand Down
Empty file modified ogcapi-types/src/common/collection.rs
100755 → 100644
Empty file.
5 changes: 5 additions & 0 deletions ogcapi-types/src/common/crs.rs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ impl Crs {
Authority::EPSG => self.code.parse().unwrap(),
}
}

/// "AUTHORITY:CODE", like "EPSG:25832"
pub fn as_known_crs(&self) -> String {
format!("{}:{}", self.authority, self.code)
}
}

impl fmt::Display for Crs {
Expand Down
Empty file modified ogcapi-types/src/common/datetime.rs
100755 → 100644
Empty file.
Empty file modified ogcapi-types/src/common/link.rs
100755 → 100644
Empty file.
Empty file modified ogcapi-types/src/common/links.rs
100755 → 100644
Empty file.
9 changes: 2 additions & 7 deletions ogcapi-types/src/edr/parameter_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@ pub struct ParameterNames {
pub measurement_type: Option<MeasurementType>,
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
#[derive(Serialize, Deserialize, Default, Debug, PartialEq, Eq, Clone)]
pub enum Type {
#[default]
Parameter,
}

impl Default for Type {
fn default() -> Self {
Type::Parameter
}
}

#[derive(Serialize, Deserialize, Debug, PartialEq, Eq, Clone)]
#[serde(rename_all = "lowercase")]
pub enum DataType {
Expand Down
9 changes: 2 additions & 7 deletions ogcapi-types/src/features/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ use serde_json::{Map, Value};

use crate::common::Links;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq, Eq)]
pub enum Type {
#[default]
Feature,
}

impl Default for Type {
fn default() -> Self {
Type::Feature
}
}

/// Abstraction of real world phenomena (ISO 19101-1:2014)
#[serde_with::skip_serializing_none]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
Expand Down
9 changes: 2 additions & 7 deletions ogcapi-types/src/features/feature_collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ use crate::common::Links;

use super::Feature;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq, Eq)]
pub enum Type {
#[default]
FeatureCollection,
}

impl Default for Type {
fn default() -> Self {
Type::FeatureCollection
}
}

/// A set of Features from a dataset
#[serde_with::skip_serializing_none]
#[derive(Serialize, Deserialize, Debug, Default, PartialEq)]
Expand Down
9 changes: 2 additions & 7 deletions ogcapi-types/src/features/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,10 @@ pub struct Query {
pub additional_parameters: HashMap<String, String>,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Default, Debug, Clone)]
#[serde(rename_all = "kebab-case")]
pub enum FilterLang {
#[default]
CqlText,
CqlJson,
}

impl std::default::Default for FilterLang {
fn default() -> Self {
FilterLang::CqlText
}
}
18 changes: 4 additions & 14 deletions ogcapi-types/src/processes/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,22 @@ pub enum Schema {
Object(Map<String, Value>),
}

#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Default, Debug)]
#[serde(rename_all = "lowercase")]
pub enum TransmissionMode {
#[default]
Value,
Reference,
}

impl Default for TransmissionMode {
fn default() -> Self {
TransmissionMode::Value
}
}

#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Default, Debug)]
#[serde(rename_all = "lowercase")]
pub enum Response {
#[default]
Raw,
Document,
}

impl Default for Response {
fn default() -> Self {
Response::Raw
}
}

#[derive(Serialize, Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Subscriber {
Expand Down
6 changes: 4 additions & 2 deletions ogcapi-types/src/tiles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ use crate::common::Crs;
type Point2D = [f64; 2];

/// Ordered list of names of the dimensions defined in the CRS
type OrderedAxes = [String; 2];
// https://docs.ogc.org/is/17-083r4/17-083r4.html#5-3-3-%C2%A0-boundingbox
// According to JSON schema length must be >= 1
pub type OrderedAxes = Vec<String>;

#[serde_with::serde_as]
#[serde_with::skip_serializing_none]
Expand Down Expand Up @@ -45,5 +47,5 @@ pub struct BoundingBox2D {
#[serde(default)]
#[serde_as(as = "Option<DisplayFromStr>")]
pub crs: Option<Crs>,
pub orderd_axes: Option<OrderedAxes>,
pub ordered_axes: Option<OrderedAxes>,
}
Loading