fmt
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
This commit is contained in:
parent
f976e5578a
commit
c00c8bdebc
3 changed files with 5 additions and 6 deletions
|
@ -54,7 +54,7 @@
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<h1>Free Elevation API Service</h1>
|
<h1>Free Elevation API Service</h1>
|
||||||
<p>Get the elevation of every point on earth. So fast, much good!</p>
|
<p>Get the elevation of every point on Earth.</p>
|
||||||
</header>
|
</header>
|
||||||
<section>
|
<section>
|
||||||
<h2>About This Service</h2>
|
<h2>About This Service</h2>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use gdal::errors::GdalError;
|
|
||||||
use gdal::Dataset;
|
use gdal::Dataset;
|
||||||
|
use gdal::{errors::GdalError, GeoTransformEx};
|
||||||
|
|
||||||
use tracing::{debug, debug_span, error, info};
|
use tracing::{debug, debug_span, error, info};
|
||||||
|
|
||||||
|
|
|
@ -107,8 +107,8 @@ async fn main() {
|
||||||
.with_state(cache)
|
.with_state(cache)
|
||||||
.layer(
|
.layer(
|
||||||
TraceLayer::new_for_http()
|
TraceLayer::new_for_http()
|
||||||
.make_span_with(trace::DefaultMakeSpan::new().level(Level::INFO))
|
.make_span_with(trace::DefaultMakeSpan::new().level(Level::DEBUG))
|
||||||
.on_response(trace::DefaultOnResponse::new().level(Level::INFO)),
|
.on_response(trace::DefaultOnResponse::new().level(Level::DEBUG)),
|
||||||
)
|
)
|
||||||
.layer(Extension(QsQueryConfig::new(5, false).error_handler(
|
.layer(Extension(QsQueryConfig::new(5, false).error_handler(
|
||||||
|err| {
|
|err| {
|
||||||
|
@ -137,10 +137,9 @@ async fn get_elevation(
|
||||||
|
|
||||||
let ele;
|
let ele;
|
||||||
match dem::elevation_from_coordinates(&dsr, lat, lon).await {
|
match dem::elevation_from_coordinates(&dsr, lat, lon).await {
|
||||||
//None => return (StatusCode::NOT_IMPLEMENTED, "".to_string()),
|
|
||||||
Ok(x) => match x {
|
Ok(x) => match x {
|
||||||
Some(el) => ele = el,
|
Some(el) => ele = el,
|
||||||
None => ele = -1.0,
|
None => ele = 0.,
|
||||||
},
|
},
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
return e.to_string().into_response();
|
return e.to_string().into_response();
|
||||||
|
|
Loading…
Reference in a new issue