Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
Frank Villaro-Dixon 2024-04-21 15:18:24 +02:00
parent c00c8bdebc
commit 6c5f2d05ca
2 changed files with 9 additions and 11 deletions

View file

@ -1,7 +1,7 @@
use std::sync::Arc;
use gdal::errors::GdalError;
use gdal::Dataset;
use gdal::{errors::GdalError, GeoTransformEx};
use tracing::{debug, debug_span, error, info};
@ -42,7 +42,7 @@ impl DatasetRepository {
return None;
}
Ok(ds) => {
let mds = Arc::new(MyDataset { ds: ds });
let mds = Arc::new(MyDataset { ds });
self.cache.insert(full_filename.clone(), mds).await;
}
}

View file

@ -2,25 +2,23 @@ mod dem;
use axum::{
extract::{Extension, Path, Query, State},
http::{response, StatusCode},
http::StatusCode,
response::{IntoResponse, Response},
routing::get,
Json, Router,
};
use axum_macros::debug_handler;
use std::{borrow::Borrow, fmt};
use std::{env, str::FromStr};
use tokio::sync::mpsc::error;
use std::env;
use serde::ser::{SerializeSeq, Serializer};
use serde::{Deserialize, Deserializer, Serialize};
use serde_qs::axum::{QsQuery, QsQueryConfig, QsQueryRejection};
use serde_qs::axum::{QsQueryConfig, QsQueryRejection};
use tower_http::trace::TraceLayer;
use tower_http::{
services::ServeDir,
trace::{self, DefaultMakeSpan},
trace::{self},
};
use tracing::{error, info, Level, Span};
use tracing::{error, info, Level};
use dem::DatasetRepository;
@ -153,9 +151,9 @@ async fn get_elevation(
if query_opts.json {
let r = Ele { elevation: ele };
return Json(r).into_response();
Json(r).into_response()
} else {
return format!("{}", ele).into_response();
format!("{}", ele).into_response()
}
}