#include <carta-protobuf/remote_file_request.pb.h>
#include <string>
|
bool | GenerateUrlFromRequest (const CARTA::RemoteFileRequest &request, std::string &url, std::string &error_message) |
| Generates a URL for a remote file request based on provided parameters.
|
|
◆ GenerateUrlFromRequest()
bool GenerateUrlFromRequest |
( |
const CARTA::RemoteFileRequest & |
request, |
|
|
std::string & |
url, |
|
|
std::string & |
error_message |
|
) |
| |
Generates a URL for a remote file request based on provided parameters.
- Parameters
-
request | The CARTA::RemoteFileRequest containing the request parameters. |
url | The generated URL to be returned if the request is valid. |
error_message | A message indicating the reason for failure if the request is invalid. |
- Returns
true
if the URL was successfully generated, false
otherwise.
This function validates the CARTA::RemoteFileRequest
parameters and constructs a URL to fetch an image from the HiPS service. If any required parameters are missing or invalid, it returns false
and provides an appropriate error message.
- Note
- The function ensures that all required parameters are present and valid before constructing the URL. If
wcs
is not provided, additional fields such as coordsys
, projection
, fov
, and object
or (ra, dec)
must be specified.
◆ HIPS_BASE_URL
const auto HIPS_BASE_URL = "https://alasky.cds.unistra.fr/hips-image-services/hips2fits" |
◆ HIPS_MAX_PIXELS
const auto HIPS_MAX_PIXELS = 50e6 |