Skip to content

Commit

Permalink
Moon.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Jan 14, 2025
1 parent 746dd65 commit 66689f4
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/rocky/AzureImageLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ AzureImageLayer::openImplementation(const IOOptions& io)

// copy this so we can add headers
_uriContext = mapTileApiUrl->context();
_uriContext.headers.emplace("subscription-key", subscriptionKey.value());
_uriContext.headers.emplace_back("subscription-key", subscriptionKey.value());

// test fetch to make sure the API key is valid
TileKey test(1, 0, 0, profile);
Expand Down
2 changes: 1 addition & 1 deletion src/rocky/GDAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ GDAL::Driver::createHeightfield(const TileKey& key, unsigned tileSize, const IOO
if (read_error != CE_None)
{
//OE_WARN << LC << "RasterIO failed.\n";
return nullptr;
return Status(Status::ResourceUnavailable, "GDAL RasterIO failed");
}

// Calculate the actual extents of the pixel data in buffer, which will be slightly
Expand Down
2 changes: 2 additions & 0 deletions src/rocky/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ Profile::setup(const std::string& name)
}
else if (util::ciEquals(name, "moon"))
{
_shared->_wellKnownName = name;

setup(
SRS("moon"),
Box(-180.0, -90.0, 180.0, 90.0),
Expand Down
1 change: 1 addition & 0 deletions src/rocky/Profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace ROCKY_NAMESPACE
static const Profile GLOBAL_GEODETIC;
static const Profile SPHERICAL_MERCATOR;
static const Profile PLATE_CARREE;
static const Profile MOON;

public:
//! Construct an empty, invalid profile
Expand Down
3 changes: 3 additions & 0 deletions src/rocky/SRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ namespace ROCKY_NAMESPACE
//! https://proj.org/operations/projections/eqc.html
static const SRS PLATE_CARREE;

//! Earth's Moon, Geographic coords.
static const SRS MOON;

//! Empty invalid SRS
static const SRS EMPTY;

Expand Down
3 changes: 1 addition & 2 deletions src/rocky/URI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,8 @@ namespace ROCKY_NAMESPACE
if (j.contains("headers")) {
auto headers = j.at("headers");
if (headers.is_array()) {
// correct??
for (auto i = headers.begin(); i != headers.end(); ++i)
context.headers[i.key()] = i.value();
context.headers.emplace_back(i.key(), i.value());
}
}
obj = URI(base, context);
Expand Down
10 changes: 6 additions & 4 deletions src/rocky/URI.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@

#include <iostream>
#include <string>
#include <vector>

namespace ROCKY_NAMESPACE
{
class URI;
class IOControl;

using Headers = std::unordered_map<std::string, std::string>;
using Headers = std::vector<std::pair<std::string, std::string>>;

/**
* Context for resolving relative URIs.
Expand Down Expand Up @@ -126,14 +127,15 @@ namespace ROCKY_NAMESPACE
}


public: // Static convenience methods
public:

/** Encodes text to URL safe test. Escapes special charaters */
inline static std::string urlEncode(const std::string& value);
//! Encodes text to URL safe test. Escapes special charaters
static std::string urlEncode(const std::string& value);

//! Try to infer a content-type from a string of bytes.
static std::string inferContentType(const std::string& value);


protected:
std::string _baseURI;
std::string _fullURI;
Expand Down
2 changes: 2 additions & 0 deletions src/rocky/static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ const SRS SRS::WGS84("wgs84");
const SRS SRS::ECEF("geocentric");
const SRS SRS::SPHERICAL_MERCATOR("spherical-mercator");
const SRS SRS::PLATE_CARREE("plate-carree");
const SRS SRS::MOON("moon");
const SRS SRS::EMPTY;
std::function<void(int level, const char* msg)> SRS::projMessageCallback = nullptr;

const Profile Profile::GLOBAL_GEODETIC("global-geodetic");
const Profile Profile::SPHERICAL_MERCATOR("spherical-mercator");
const Profile Profile::PLATE_CARREE("plate-carree");
const Profile Profile::MOON("moon");

//Status Context::_global_status(Status::GeneralError);

Expand Down
6 changes: 1 addition & 5 deletions src/rocky/vsg/MapManipulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1085,14 +1085,10 @@ MapManipulator::apply(vsg::MoveEvent& moveEvent)
if (handleMouseAction(_lastAction, _previousMove.value(), moveEvent))
_dirty = true;

if (_continuous > 0 && !wasContinuous)
if (_continuous > 0) // && !wasContinuous)
{
_continuousAction = _lastAction;
_context->requestFrame();
}

if (_continuous > 0)
{
_dirty = true;
}

Expand Down

0 comments on commit 66689f4

Please sign in to comment.