-
Notifications
You must be signed in to change notification settings - Fork 658
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
GeoTIFF serialization for isochrones #4594
GeoTIFF serialization for isochrones #4594
Conversation
src/loki/worker.cc
Outdated
@@ -357,6 +357,12 @@ loki_worker_t::work(const std::list<zmq::message_t>& job, | |||
result.messages.emplace_back(request.SerializeAsString()); | |||
break; | |||
case Options::isochrone: | |||
// return early if geotiff was requested but GDAL isn't enabled | |||
#ifndef ENABLE_GDAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be prepared to see plenty of these... I'm open to any suggestions that reduce these wherever possible
src/thor/worker.cc
Outdated
#ifdef ENABLE_GDAL | ||
#include <gdal_priv.h> | ||
#endif | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tyr
has no way to maintain state, so thor_worker_t
will hold the geotiff driver and pass an opaque pointer to it to the serializer function (note that GDAL is not thread-safe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great stuff, thanks!
not sure I'll join tmrw for the meeting so I left some comments here. maybe there's some way to hide the gdal headers in the implementation instead of exposing them in our headers. anyways, kevin is the master pimpl'er here :D
maybe @dnesbitt61 you want to look at this too, kevin mentioned you had this idea before too:) |
This reverts commit 657aa59.
…hor, update tests, activate gdal flag on all ci builds
so it seems debian & fedora based distros install gdal headers to |
|
uh oh, windows is failing with some msvc specific stuff 😨 |
Is tidy hallucinating or am I? |
Co-authored-by: Nils <nilsnolde@proton.me>
Issue
Adds GeoTIFF as an output format to the isochrones endpoint, which returns the 2-D grid as a raster instead of contours.
The rough idea is this: when a user requests a raster output by specifing
"format": "geotiff"
in the request JSON, once the 2-D expansion grid is calculated, the grid is serialized as a GeoTIFF dataset and returned as raw bytes, instead of running the contouring algorithm.Implementation Summary
ENABLE_GDAL
(OFF
by default)uint16_t
gives plenty range for distance and time metrics, so I decided to scale the values to seconds (which maxes out at ~18 hours) and 10 meter steps (~650 kms)For more info, see the initial discussion: #4581.
TODO
There are still one or two things left to do:
find out why raster values in the added tests are unexpectedly high (probably related to type casting)Future steps
This is a basic first step, but it doesn't have to be the end of it. One could
show_locations
)Tasklist