Deep Learning SDK for Geospatial Data
 1.0.0+
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Imagery

Detailed Description

Contains image functionality which includes Gdal functionality, Pyramid Processing and calculation of sliding windows.

Modules

 Processing
 Imagery-related processing pipeline components.
 

Namespaces

 dg::deepcore::imagery
 Contains image-handling functionality.
 
 dg::deepcore::imagery::PixelType
 

Classes

struct  dg::deepcore::geometry::AffineTransformation
 Represents a six-parameter Affine transformation. More...
 
struct  dg::deepcore::geometry::IdentityTransformation
 Represents an identity transformation. More...
 
struct  dg::deepcore::geometry::Transformation
 Represents a coordinate transformation. More...
 
class  dg::deepcore::imagery::MapBoxClient
 A client for the MapBox tile service. More...
 
struct  dg::deepcore::imagery::ows::Exception
 Represents an ExceptionReport as defined in OGC 06-121r9, Chapter 8. More...
 
struct  dg::deepcore::imagery::ows::ExceptionReport
 Represents an ExceptionReport as defined in OGC 06-121r3, Chapter 8. More...
 
class  dg::deepcore::imagery::ows::Error
 A DeepCore Error wrapper for an ows::ExceptionReport. More...
 
struct  dg::deepcore::imagery::SizeStep
 Holds a window size and a step size. More...
 
class  dg::deepcore::imagery::SlidingWindow
 Assists in calculation of sliding windows. More...
 
class  dg::deepcore::imagery::SlidingWindowIterator
 Iterates over a SlidingWindow. More...
 
class  dg::deepcore::imagery::SlidingWindowChipper
 Chips an image into subsets with a sliding window strategy. More...
 
class  dg::deepcore::imagery::SlidingWindowChipperIterator
 Iterates over the sliding window subsets. More...
 
struct  dg::deepcore::imagery::Subset
 Represents an image subset. More...
 
struct  dg::deepcore::imagery::SubsetRequest
 Represents a request for an image subset. More...
 
struct  dg::deepcore::imagery::SubsetBatch
 Stores the batched subset data and the original subset bounding boxes. More...
 
class  dg::deepcore::imagery::SubsetBatcher
 Batches subsets into a contiguous memory block. More...
 
class  dg::deepcore::imagery::SubsetBatchIterator
 Iterates through subset batches. More...
 
class  dg::deepcore::imagery::TileJsonClient
 A client for a TileJSON tile service. More...
 
class  boost::program_options::cvRect_typed_value< T, charT >
 Extends boost::program_options::bounded_typed_value to supoort cv::Rect and cv::Rect2d command line parameters. More...
 
class  boost::program_options::cvCoord_typed_value< coordT, charT >
 Extends boost::program_options::bounded_typed_value to supoort cv::Point, cv::Point2d, cv::Size, and cv::Size2d command line parameters. More...
 
class  dg::deepcore::geometry::SpatialReference
 Represents a geographic or projected coordinate system. More...
 
class  dg::deepcore::imagery::DgWmtsClient
 A base class for DigitalGlobe WMTS services. More...
 
class  dg::deepcore::imagery::GdalImage
 Represents a geo-registered image read using GDAL. More...
 
class  dg::deepcore::imagery::GeoImage
 An abstract base class for geo-registered images. More...
 
class  dg::deepcore::imagery::MapServiceClient
 A base class for asynchronous web service clients. More...
 
class  dg::deepcore::imagery::MapServiceImage
 Represents an image back by a web map service. More...
 
struct  dg::deepcore::imagery::TileJson
 Represents a TileJSON response. Currently supported version is 2.0.0. Reference: More...
 
struct  dg::deepcore::imagery::wmts::TileMatrix
 Represents a TileMatrix node in a WMTS GetCapabilities request. More...
 
struct  dg::deepcore::imagery::wmts::TileMatrixSet
 Represents a TileMatrixSet node in a WMTS GetCapabilities request. More...
 
struct  dg::deepcore::imagery::wmts::Layer
 Represents a Layer node in a WMTS GetCapabilities request. More...
 
struct  dg::deepcore::imagery::wmts::Operation
 Represents an ows:Operation node in a WMTS GetCapabilities request. More...
 
struct  dg::deepcore::imagery::wmts::Contents
 Represents a Contents node in a WMTS GetCapabilities request. More...
 
struct  dg::deepcore::imagery::wmts::Capabilities
 Represents a WMTS GetCapabilities request. More...
 
class  dg::deepcore::imagery::WmtsClient
 A client for a WMTS service. Currently only the KVP encoding scheme is supported. More...
 

Macros

#define DG_OWS_ERROR_THROW(report)   throw dg::deepcore::imagery::ows::Error(__FILENAME__, __LINE__, __FUNCTION__, report)
 Throws an ows::Error with a given ows::ExceptionReport for the current position in code. More...
 

Typedefs

using dg::deepcore::imagery::SizeSteps = std::vector< SizeStep >
 An std::vector of SizeStep. More...
 
using dg::deepcore::imagery::Subsets = std::vector< Subset >
 An std::vector of Subset. More...
 
using dg::deepcore::imagery::SubsetRequests = std::vector< SubsetRequest >
 An std::vector of SubsetRequest. More...
 
using dg::deepcore::imagery::PreprocessFunc = std::function< void(cv::Mat &dest, const cv::Mat &src)>
 A function that performs an operation on a cv::Mat object and writes the result to another cv::Mat object. More...
 
using dg::deepcore::imagery::BlockReadFunc = std::function< bool(const cv::Point &origin, cv::Mat &&block)>
 Callback for block read. More...
 

Enumerations

enum  dg::deepcore::imagery::EdgeBehavior { dg::deepcore::imagery::EdgeBehavior::DROP, dg::deepcore::imagery::EdgeBehavior::CROP, dg::deepcore::imagery::EdgeBehavior::FILL }
 Represents behavior of sliding windows at image edges when a window cannot evenly fit into the image. More...
 
enum  dg::deepcore::imagery::ImageReadMode {
  dg::deepcore::imagery::ImageReadMode::UNCHANGED = -1, dg::deepcore::imagery::ImageReadMode::GRAYSCALE = 0, dg::deepcore::imagery::ImageReadMode::COLOR = 1, dg::deepcore::imagery::ImageReadMode::ANYDEPTH = 2,
  dg::deepcore::imagery::ImageReadMode::ANYCOLOR = 4
}
 Image read mode. More...
 

Functions

template<class charT = char>
cvRect_typed_value< int, charT > * boost::program_options::cvRect_value (cv::Rect *store_to=nullptr)
 Creates a new instance of cvRect_typed_value for cv::Rect. More...
 
template<class charT = char>
cvRect_typed_value< double,
charT > * 
boost::program_options::cvRect2d_value (cv::Rect2d *store_to=nullptr)
 Creates a new instance of cvRect_typed_value for cv::Rect2d. More...
 
template<class charT = char>
cvCoord_typed_value< cv::Point,
charT > * 
boost::program_options::cvPoint_value (cv::Point *store_to=nullptr)
 Creates a new instance of cvCoord_typed_value for cv::Point. Optionally, min_tokens can be set to 1 in which case x and y coordinates will be the same. More...
 
template<class charT = char>
cvCoord_typed_value
< cv::Point2d, charT > * 
boost::program_options::cvPoint2d_value (cv::Point2d *store_to=nullptr)
 Creates a new instance of cvCoord_typed_value for cv::Point2d. Optionally, min_tokens can be set to 1 in which case x and y coordinates will be the same. More...
 
template<class charT = char>
cvCoord_typed_value< cv::Size,
charT > * 
boost::program_options::cvSize_value (cv::Size *store_to=nullptr)
 Creates a new instance of cvCoord_typed_value for cv::Size. Optionally, min_tokens can be set to 1 in which case width and height will be the same. More...
 
template<class charT = char>
cvCoord_typed_value
< cv::Size2d, charT > * 
boost::program_options::cvSize2d_value (cv::Size2d *store_to=nullptr)
 Creates a new instance of cvCoord_typed_value for cv::Size2d. Optionally, min_tokens can be set to 1 in which case width and height will be the same. More...
 
template<class T >
boost::log::formatting_ostream & cv::operator<< (boost::log::formatting_ostream &os, const Point_< T > &p)
 Allows logging a cv::Point_<T> with DG_LOG. More...
 
template<class T >
boost::log::formatting_ostream & cv::operator<< (boost::log::formatting_ostream &os, const Size_< T > &s)
 Allows logging a cv::Size_<T> with DG_LOG. More...
 
template<class T >
boost::log::formatting_ostream & cv::operator<< (boost::log::formatting_ostream &os, const Rect_< T > &r)
 Allows logging a cv::Rect_<T> with DG_LOG. More...
 
virtual const
geometry::SpatialReference & 
dg::deepcore::imagery::MapServiceClient::spatialReference ()=0
 Gets the spatial coordinate reference for the web service. May cause MapServiceClient::connect() to be called. More...
 
virtual const wmts::TileMatrix & dg::deepcore::imagery::MapServiceClient::tileMatrix ()=0
 Gets the current tile matrix parameters. More...
 
virtual const std::vector
< std::string > & 
dg::deepcore::imagery::MapServiceClient::imageFormats ()=0
 Gets the supported image formats for the current layer, tile matrix set, and tile matrix. More...
 
virtual int dg::deepcore::imagery::MapServiceClient::numBands ()=0
 Gets the number of raster bands in the image. More...
 
virtual PixelType::Type dg::deepcore::imagery::MapServiceClient::pixelType ()=0
 Gets the image pixel type as a cv::Mat type i.e. CV_8U, CV_8S, CV_32F, etc. More...
 
virtual const std::vector
< std::string > & 
dg::deepcore::imagery::MapServiceClient::layers ()=0
 Gets the available layer names. More...
 
virtual const std::vector
< std::string > & 
dg::deepcore::imagery::MapServiceClient::tileMatrixSets ()=0
 Gets the the available tile matrix sets for the current layer. More...
 
virtual const std::vector
< std::string > & 
dg::deepcore::imagery::MapServiceClient::tileMatrixIds ()=0
 Gets the available tile matrix ids for the current tile matrix set. More...
 
virtual std::string dg::deepcore::imagery::MapServiceClient::urlTemplate ()=0
 Gets the URL template for the current layer, tile matrix set, and tile matrix. The template must contain {x} and {y} placeholders for the tile coordinate. More...
 
virtual void dg::deepcore::imagery::MapServiceClient::connectInternal ()=0
 Connects to the server and performs a "GetCapabilities" request. Throws an exception if anything went wrong. This may also set an intelligent default for layer, tile matrix set, and tile matrix if possible. More...
 
virtual bool dg::deepcore::imagery::MapServiceClient::layerNamesRestricted () const noexcept=0
 Gets whether the layer names are restricted. If true, layer name must be in the vector returned by MapServiceImage(), if false, layer names can be arbitrary. More...
 
std::ostream & dg::deepcore::imagery::operator<< (std::ostream &os, PixelType::Type t)
 Outputs the PixelType::Type string representation to a std::ostream. More...
 
Transformation * dg::deepcore::geometry::new_clone (const Transformation &rhs)
 Creates a copy of the given Transformation objects. More...
 
cv::Mat dg::deepcore::imagery::matchNumberOfChannels (const cv::Mat &image, int numChannels)
 If the input image number of channels is different from the specified number of channels, transform the image to match. More...
 
static SpatialReference dg::deepcore::geometry::SpatialReference::fromEpsg (int epsg)
 Creates a SpatialReference from an EPSG code. More...
 
static SpatialReference dg::deepcore::geometry::SpatialReference::fromWkt (const char *wkt)
 Creates a SpatialReference from a WKT string. More...
 
static SpatialReference dg::deepcore::geometry::SpatialReference::fromWkt (const std::string &wkt)
 Creates a SpatialReference from a WKT string. More...
 
static SpatialReference dg::deepcore::geometry::SpatialReference::fromUrn (const std::string &urn)
 Creates a SpatialReference from a URN string. i.e. "urn:ogc:def:crs:EPSG::4326". More...
 
 dg::deepcore::geometry::SpatialReference::SpatialReference ()
 Constructs a default SpatialReference with a local coordinate system. More...
 
 dg::deepcore::geometry::SpatialReference::SpatialReference (const OGRSpatialReference &ogrSr)
 Constructs a SpatialReference for a OGRSpatialReference. More...
 
 dg::deepcore::geometry::SpatialReference::SpatialReference (OGRSpatialReference *ogrSr)
 Constructs a SpatialReference for a OGRSpatialReference. More...
 
 dg::deepcore::geometry::SpatialReference::SpatialReference (const SpatialReference &rhs)
 The copy constructor. More...
 
SpatialReference & dg::deepcore::geometry::SpatialReference::operator= (const SpatialReference &rhs)
 The copy assignment operator. More...
 
const OGRSpatialReference * dg::deepcore::geometry::SpatialReference::ref () const
 return a pointer to the OGRSpatialReference this object references. More...
 
bool dg::deepcore::geometry::SpatialReference::isGeographic () const
 Gets whether this is a geographic coordinate system. More...
 
bool dg::deepcore::geometry::SpatialReference::isProjected () const
 Gets whether this is a projected coordinate system. More...
 
bool dg::deepcore::geometry::SpatialReference::isLocal () const
 Gets whether this is a local coordinate system. More...
 
std::string dg::deepcore::geometry::SpatialReference::units () const
 Gets the projection units. More...
 
double dg::deepcore::geometry::SpatialReference::unitsCoefficient () const
 Gets the multiplier to convert the projection units to meters for linear units and radians for angular units. More...
 
std::string dg::deepcore::geometry::SpatialReference::wkt () const
 Gets the WKT string describing this SpatialReference. More...
 
bool dg::deepcore::geometry::SpatialReference::operator== (const SpatialReference &rhs) const
 The equality operator. More...
 
const geometry::SpatialReference & dg::deepcore::imagery::GeoImage::spatialReference () const noexcept
 Gets the image's spatial reference system. More...
 
cv::Point2d dg::deepcore::imagery::GeoImage::origin () const
 Gets the origin in the image's native coordinate system. The origin is the north-west corner. More...
 
cv::Size2d dg::deepcore::imagery::GeoImage::pixelSize () const
 Gets the pixel size in the image's native coordinate system. More...
 
const cv::Size & dg::deepcore::imagery::GeoImage::size () const
 Gets the image pixel size. More...
 
const cv::Size & dg::deepcore::imagery::GeoImage::blockSize () const
 Gets the image block size. More...
 
int dg::deepcore::imagery::GeoImage::numBands () const
 Gets the number of raster bands in the image. More...
 
PixelType::Type dg::deepcore::imagery::GeoImage::pixelType () const
 Gets the image pixel type. More...
 
 dg::deepcore::imagery::MapBoxClient::MapBoxClient (const std::string &mapId, const std::string &accessToken, bool useTiles=false)
 Constructs a MapBoxClient. More...
 
const std::string & dg::deepcore::imagery::MapBoxClient::accessToken () const noexcept
 Gets the access token. More...
 
void dg::deepcore::imagery::MapBoxClient::setAccessToken (const std::string &accessToken)
 Sets the access token. Will terminate the current connection if connected. More...
 
virtual dg::deepcore::imagery::MapServiceClient::~MapServiceClient ()
 The virtual destructor. More...
 
void dg::deepcore::imagery::MapServiceClient::connect ()
 Connects to the server and performs a "GetCapabilities" request. Throws an exception if anything went wrong. This may also set an intelligent default for layer, tile matrix set, and tile matrix if possible. More...
 
void dg::deepcore::imagery::MapServiceClient::connectIfNotConnected ()
 Calls connect() only if isConnected() == false. More...
 
const std::string & dg::deepcore::imagery::MapServiceClient::baseUrl () const noexcept
 Gets the base URL. More...
 
void dg::deepcore::imagery::MapServiceClient::setBaseUrl (const std::string &baseUrl)
 Sets the base URL. Will terminate the current connection if connected. More...
 
bool dg::deepcore::imagery::MapServiceClient::isConnected () const noexcept
 Return whether the MapBoxClient is connected. More...
 
virtual void dg::deepcore::imagery::MapServiceClient::setConnected (bool connected)
 Sets whether we're connected to the web service. Inheriting classes may override this, but be sure to call the base classe's method as well. More...
 
const std::string & dg::deepcore::imagery::MapServiceClient::credentials () const noexcept
 Gets the credentials. More...
 
void dg::deepcore::imagery::MapServiceClient::setCredentials (const std::string &credentials)
 Sets the credentials. Will terminate the current connection if connected. More...
 
virtual const std::string & dg::deepcore::imagery::MapServiceClient::layer ()
 Gets the current layer. More...
 
virtual bool dg::deepcore::imagery::MapServiceClient::setLayer (const std::string &layer)
 Sets the current layer. Does not cause the connection to be terminated, but inheriting classes may do so. More...
 
const std::string & dg::deepcore::imagery::MapServiceClient::tileMatrixSet ()
 Gets the tile matrix set. More...
 
virtual bool dg::deepcore::imagery::MapServiceClient::setTileMatrixSet (const std::string &tileMatrixSet)
 Sets the tile matrix set. More...
 
const std::string & dg::deepcore::imagery::MapServiceClient::tileMatrixId ()
 Gets the tile matrix id. More...
 
virtual bool dg::deepcore::imagery::MapServiceClient::setTileMatrixId (const std::string &tileMatrixId)
 Sets the tile matrix id. Does not cause the connection to be terminated, but inheriting classes may do so. More...
 
const std::string & dg::deepcore::imagery::MapServiceClient::imageFormat ()
 Gets the image format as MIME type. More...
 
virtual bool dg::deepcore::imagery::MapServiceClient::setImageFormat (const std::string &imageFormat)
 Sets the image format. Does not cause the connection to be terminated, but inheriting classes may do so. More...
 
const std::map< std::string,
std::string > & 
dg::deepcore::imagery::MapServiceClient::additionalArguments ()
 Gets additional URL arguments to be added to each request. More...
 
virtual void dg::deepcore::imagery::MapServiceClient::setAdditionalArguments (const std::map< std::string, std::string > &arguments)
 Gets additional URL arguments to be added to each request. Does not cause the connection to be terminated, but inheriting classes may do so. More...
 
int dg::deepcore::imagery::MapServiceImage::maxConnections () const noexcept
 Gets the number of simultaneous connections to use. More...
 
void dg::deepcore::imagery::MapServiceImage::setMaxConnections (int connections)
 Sets the number of simultaneous connections to use. More...
 
Subset dg::deepcore::imagery::SubsetBatch::subset (size_t index) const
 Returns a Subset that contains an image represented by the batch data at the given index. This function will combine individual channels of multi-band images, so the data may be copied. This function is provided for convenience and testing. More...
 
static TileJson dg::deepcore::imagery::TileJson::fromJson (const std::string &json)
 Create a TileJson object from a JSON string. More...
 
 dg::deepcore::imagery::TileJsonClient::TileJsonClient (const std::string &url, const std::string &credentials="", bool useTiles=false)
 Constructs a TileJsonClient for the given URL. More...
 

Variables

static const SpatialReference dg::deepcore::geometry::SpatialReference::WGS84 = SpatialReference::fromEpsg(4326)
 WGS84 geographic coordinate system (EPSG:4326) More...
 
static const SpatialReference dg::deepcore::geometry::SpatialReference::WEB_MERCATOR = SpatialReference::fromEpsg(3857)
 WGS 84 / Pseudo-Mercator projected coordinate system (EPSG:3857) More...
 
static const SpatialReference dg::deepcore::geometry::SpatialReference::WORLD_MERCATOR = SpatialReference::fromEpsg(3395)
 WGS 84 / World Mercator projected coordinate system (EPSG:3395) More...
 

Macro Definition Documentation

#define DG_OWS_ERROR_THROW (   report)    throw dg::deepcore::imagery::ows::Error(__FILENAME__, __LINE__, __FUNCTION__, report)

Throws an ows::Error with a given ows::ExceptionReport for the current position in code.

Parameters
[in]reportThe ExceptionReport to throw.

Typedef Documentation

Callback for block read.

Parameters
originThe top-left corner of the block read.
blockThe image block read.
Returns
Whether the operation should continue. Return false for cancellation.
using dg::deepcore::imagery::PreprocessFunc = typedef std::function<void(cv::Mat& dest, const cv::Mat& src)>

A function that performs an operation on a cv::Mat object and writes the result to another cv::Mat object.

Parameters
[out]destThe destination object to write to.
[in]srcThe source object to read from and transform.
using dg::deepcore::imagery::SizeSteps = typedef std::vector<SizeStep>

An std::vector of SizeStep.

using dg::deepcore::imagery::SubsetRequests = typedef std::vector<SubsetRequest>

An std::vector of SubsetRequest.

using dg::deepcore::imagery::Subsets = typedef std::vector<Subset>

An std::vector of Subset.

Enumeration Type Documentation

Represents behavior of sliding windows at image edges when a window cannot evenly fit into the image.

Enumerator
DROP 
CROP 

If a window does not fit inside the image, it will not be generated.

FILL 

If a window does not fit inside the image, it will be cropped to fit.

If a window does not fit inside the image, it will have boundaries outside the image.

Image read mode.

Enumerator
UNCHANGED 

If set, return the loaded image as is (with alpha channel, otherwise it gets cropped).

GRAYSCALE 

If set, always convert image to the single channel grayscale image.

COLOR 

If set, always convert image to the 3 channel BGR color image.

ANYDEPTH 

If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.

ANYCOLOR 

If set, the image is read in any possible color format.

Function Documentation

dg::deepcore::imagery::MapBoxClient::MapBoxClient ( const std::string &  mapId,
const std::string &  accessToken,
bool  useTiles = false 
)

Constructs a MapBoxClient.

Parameters
[in]mapIdThe mapId to use.
[in]accessTokenThe access token to use.
[in]useTilesIf true, TileJsonClient will use the tiles entries of TileJSON metadata as its URL template. If false, it will use the base URL.
dg::deepcore::geometry::SpatialReference::SpatialReference ( )

Constructs a default SpatialReference with a local coordinate system.

dg::deepcore::geometry::SpatialReference::SpatialReference ( const OGRSpatialReference &  ogrSr)

Constructs a SpatialReference for a OGRSpatialReference.

Parameters
[in]ogrSrThe OGRSpatialReference.
dg::deepcore::geometry::SpatialReference::SpatialReference ( OGRSpatialReference *  ogrSr)

Constructs a SpatialReference for a OGRSpatialReference.

Parameters
[in]ogrSrThe OGRSpatialReference, SpatialReference takes ownership of the pointer.
dg::deepcore::geometry::SpatialReference::SpatialReference ( const SpatialReference sr)

The copy constructor.

Parameters
[in]srThe SpatialReference to copy.
dg::deepcore::imagery::TileJsonClient::TileJsonClient ( const std::string &  url,
const std::string &  credentials = "",
bool  useTiles = false 
)
explicit

Constructs a TileJsonClient for the given URL.

Parameters
[in]urlBase URL for the tile server or a TileJSON descriptor.
[in]credentialsHTTP credentials, if required.
[in]useTilesIf true, TileJsonClient will use the tiles entries of TileJSON metadata as its URL template. If false, it will use the base URL.

Rules for Base URL Derivation

There are two ways a server URL can be set up:

  1. A path to a JSON file is specified i.e. https://myserver.com/mymapid/tiles.json.

    In this case the base URL will be set to https://myserver.com, layer name will be set to "mymapid", and the TileJSON metadata will be obtained from https://myserver.com/mymapid/tiles.json.

  2. A path to a REST endpoint is specified i.e. https://myserver.com/mymapid.

    In this case the base URL will be set to https://myserver.com, layer name will be set to "mymapid", and the TileJSON metadata will be obtained from https://myserver.com/mymapid.json.

Rules for URL Template Derivation

For this example we'll use the https://myserver.com/mymapid or https://myserver.com/mymapid/tiles.json as the url parameter.

  1. If useTiles parameter is set to true, the template will be obtained from the tiles entries of the TileJSON metadata.
  2. If useTiles parameter is set to false, the template will be https://myserver.com/mymapid/{z}/{x}/{y}.jpg. Note that extension is taken from the format entry of the TileJSON metadata, so it's not always jpg.
dg::deepcore::imagery::MapServiceClient::~MapServiceClient ( )
virtual

The virtual destructor.

const string & dg::deepcore::imagery::MapBoxClient::accessToken ( ) const
noexcept

Gets the access token.

Returns
The access token.
const map< string, string > & dg::deepcore::imagery::MapServiceClient::additionalArguments ( )

Gets additional URL arguments to be added to each request.

Returns
The additional arguments.
const string & dg::deepcore::imagery::MapServiceClient::baseUrl ( ) const
noexcept

Gets the base URL.

Returns
The base URL.
const cv::Size & dg::deepcore::imagery::GeoImage::blockSize ( ) const

Gets the image block size.

Returns
The image block size.
void dg::deepcore::imagery::MapServiceClient::connect ( )

Connects to the server and performs a "GetCapabilities" request. Throws an exception if anything went wrong. This may also set an intelligent default for layer, tile matrix set, and tile matrix if possible.

void dg::deepcore::imagery::MapServiceClient::connectIfNotConnected ( )

Calls connect() only if isConnected() == false.

virtual void dg::deepcore::imagery::MapServiceClient::connectInternal ( )
protectedpure virtual

Connects to the server and performs a "GetCapabilities" request. Throws an exception if anything went wrong. This may also set an intelligent default for layer, tile matrix set, and tile matrix if possible.

Implemented in dg::deepcore::imagery::TileJsonClient, dg::deepcore::imagery::WmtsClient, dg::deepcore::imagery::DgWmtsClient, and dg::deepcore::imagery::MapBoxClient.

const string & dg::deepcore::imagery::MapServiceClient::credentials ( ) const
noexcept

Gets the credentials.

Returns
The credentials.
template<class charT = char>
cvCoord_typed_value<cv::Point2d, charT>* boost::program_options::cvPoint2d_value ( cv::Point2d *  store_to = nullptr)

Creates a new instance of cvCoord_typed_value for cv::Point2d. Optionally, min_tokens can be set to 1 in which case x and y coordinates will be the same.

Parameters
[in,out]store_toPointer to a variable that automatically receives the argument's value.

Usage example:

boost::program_options::options_description desc;
desc.add_options()
("lat-lon-coord", boost::program_options::cvPoint2d_value(), "Lat/lon coord (two arguments required)")
("lat-lon-step", boost::program_options::cvPoint2d_value()->min_tokens(1), "Lat/lon step (one or two arguments)");
Returns
A new instance of cvCoord_typed_value.
template<class charT = char>
cvCoord_typed_value<cv::Point, charT>* boost::program_options::cvPoint_value ( cv::Point *  store_to = nullptr)

Creates a new instance of cvCoord_typed_value for cv::Point. Optionally, min_tokens can be set to 1 in which case x and y coordinates will be the same.

Parameters
[in,out]store_toPointer to a variable that automatically receives the argument's value.

Usage example:

boost::program_options::options_description desc;
desc.add_options()
("pixel-coord", boost::program_options::cvPoint_value(), "Pixel coord (two arguments required)")
("step", boost::program_options::cvPoint_value()->min_tokens(1), "Step (one or two arguments)");
Returns
A new instance of cvCoord_typed_value.
template<class charT = char>
cvRect_typed_value<double, charT>* boost::program_options::cvRect2d_value ( cv::Rect2d *  store_to = nullptr)

Creates a new instance of cvRect_typed_value for cv::Rect2d.

Parameters
[in,out]store_toPointer to a variable that automatically receives the argument's value.

Usage example:

boost::program_options::options_description desc;
desc.add_options()
("bounding-box", boost::program_options::cvRect2d_value(), "Floating point bounding box");
Returns
A new instance of cvRect_typed_value.
template<class charT = char>
cvRect_typed_value<int, charT>* boost::program_options::cvRect_value ( cv::Rect *  store_to = nullptr)

Creates a new instance of cvRect_typed_value for cv::Rect.

Parameters
[in,out]store_toPointer to a variable that automatically receives the argument's value.

Usage example:

boost::program_options::options_description desc;
desc.add_options()
("bounding-box", boost::program_options::cvRect_value(), "Integer bounding box");
Returns
A new instance of cvRect_typed_value.
template<class charT = char>
cvCoord_typed_value<cv::Size2d, charT>* boost::program_options::cvSize2d_value ( cv::Size2d *  store_to = nullptr)

Creates a new instance of cvCoord_typed_value for cv::Size2d. Optionally, min_tokens can be set to 1 in which case width and height will be the same.

Parameters
[in,out]store_toPointer to a variable that automatically receives the argument's value.

Usage example:

boost::program_options::options_description desc;
desc.add_options()
("lat-lon-size", boost::program_options::cvSize2d_value(), "Lat/lon image size (two arguments required)")
("lat-lon-window", boost::program_options::cvSize2d_value()->min_tokens(1), "Lat/lon window size (one or two arguments)");
Returns
A new instance of cvCoord_typed_value.
template<class charT = char>
cvCoord_typed_value<cv::Size, charT>* boost::program_options::cvSize_value ( cv::Size *  store_to = nullptr)

Creates a new instance of cvCoord_typed_value for cv::Size. Optionally, min_tokens can be set to 1 in which case width and height will be the same.

Parameters
[in,out]store_toPointer to a variable that automatically receives the argument's value.

Usage example:

boost::program_options::options_description desc;
desc.add_options()
("image-size", boost::program_options::cvSize_value(), "Image size (two arguments required)")
("window-size", boost::program_options::cvSize_value()->min_tokens(1), "Window size (one or two arguments)");
Returns
A new instance of cvCoord_typed_value.
SpatialReference dg::deepcore::geometry::SpatialReference::fromEpsg ( int  epsg)
static

Creates a SpatialReference from an EPSG code.

Parameters
[in]epsgThe EPSG code.
Returns
A SpatialReference object equivalent to the given EPSG code.
TileJson dg::deepcore::imagery::TileJson::fromJson ( const std::string &  json)
static

Create a TileJson object from a JSON string.

Parameters
[in]jsonThe JSON string.
Returns
The TileJson object loaded from the string.
SpatialReference dg::deepcore::geometry::SpatialReference::fromUrn ( const std::string &  urn)
static

Creates a SpatialReference from a URN string. i.e. "urn:ogc:def:crs:EPSG::4326".

Parameters
[in]urnThe URN string.
Returns
A SpatialReference object equivalent to the given WKT code.
SpatialReference dg::deepcore::geometry::SpatialReference::fromWkt ( const char *  wkt)
static

Creates a SpatialReference from a WKT string.

Parameters
[in]wktThe WKT string.
Returns
A SpatialReference object equivalent to the given WKT code.
SpatialReference dg::deepcore::geometry::SpatialReference::fromWkt ( const std::string &  wkt)
static

Creates a SpatialReference from a WKT string.

Parameters
[in]wktThe WKT string.
Returns
A SpatialReference object equivalent to the given WKT code.
const string & dg::deepcore::imagery::MapServiceClient::imageFormat ( )

Gets the image format as MIME type.

Returns
The image format.
virtual const std::vector<std::string>& dg::deepcore::imagery::MapServiceClient::imageFormats ( )
pure virtual

Gets the supported image formats for the current layer, tile matrix set, and tile matrix.

Returns
The supported image formats in the HTML-style media type format.

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

bool dg::deepcore::imagery::MapServiceClient::isConnected ( ) const
noexcept

Return whether the MapBoxClient is connected.

Returns
Whether the MapBoxClient is connected.
bool dg::deepcore::geometry::SpatialReference::isGeographic ( ) const

Gets whether this is a geographic coordinate system.

Returns
Whether this is a geographic coordinate system.
bool dg::deepcore::geometry::SpatialReference::isLocal ( ) const

Gets whether this is a local coordinate system.

Returns
Whether this is a local coordinate system.
bool dg::deepcore::geometry::SpatialReference::isProjected ( ) const

Gets whether this is a projected coordinate system.

Returns
Whether this is a projected coordinate system.
const string & dg::deepcore::imagery::MapServiceClient::layer ( )
virtual

Gets the current layer.

Returns
The current layer.

Reimplemented in dg::deepcore::imagery::WmtsClient.

virtual bool dg::deepcore::imagery::MapServiceClient::layerNamesRestricted ( ) const
protectedpure virtualnoexcept

Gets whether the layer names are restricted. If true, layer name must be in the vector returned by MapServiceImage(), if false, layer names can be arbitrary.

Returns
Whether the layer names are restricted.

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

virtual const std::vector<std::string>& dg::deepcore::imagery::MapServiceClient::layers ( )
pure virtual

Gets the available layer names.

Returns
The available layer names.

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

cv::Mat dg::deepcore::imagery::matchNumberOfChannels ( const cv::Mat &  image,
int  numChannels 
)

If the input image number of channels is different from the specified number of channels, transform the image to match.

Parameters
[in]imageThe image.
[in]numChannelsThe desired number of channels.
Returns
The trainformed image, or the original image if it already had the desired number of channels.
int dg::deepcore::imagery::MapServiceImage::maxConnections ( ) const
noexcept

Gets the number of simultaneous connections to use.

Returns
The number of connections.
Transformation * dg::deepcore::geometry::new_clone ( const Transformation &  rhs)

Creates a copy of the given Transformation objects.

Parameters
[in]rhsThe object to clone.
Returns
A pointer to the new clone.

This function is necessary to use the Boost Cloneable concept.

int dg::deepcore::imagery::GeoImage::numBands ( ) const

Gets the number of raster bands in the image.

Returns
The number of raster bands.
virtual int dg::deepcore::imagery::MapServiceClient::numBands ( )
pure virtual

Gets the number of raster bands in the image.

Returns
The number of bands.

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

template<class T >
boost::log::formatting_ostream& cv::operator<< ( boost::log::formatting_ostream &  os,
const Point_< T > &  p 
)

Allows logging a cv::Point_<T> with DG_LOG.

Parameters
[in,out]osThe stream to write to.
[in]pThe cv::Point_<T>.
Returns
A reference to the input stream.
template<class T >
boost::log::formatting_ostream& cv::operator<< ( boost::log::formatting_ostream &  os,
const Size_< T > &  s 
)

Allows logging a cv::Size_<T> with DG_LOG.

Parameters
[in,out]osThe stream to write to.
[in]sThe cv::Size_<T>.
Returns
A reference to the input stream.
std::ostream & dg::deepcore::imagery::operator<< ( std::ostream &  os,
PixelType::Type  t 
)

Outputs the PixelType::Type string representation to a std::ostream.

Parameters
[in,out]osThe output stream.
[in]tThe PixelType::Type to output.
Returns
The output stream.
template<class T >
boost::log::formatting_ostream& cv::operator<< ( boost::log::formatting_ostream &  os,
const Rect_< T > &  r 
)

Allows logging a cv::Rect_<T> with DG_LOG.

Parameters
[in,out]osThe stream to write to.
[in]rThe cv::Rect_<T>.
Returns
A reference to the input stream.
SpatialReference & dg::deepcore::geometry::SpatialReference::operator= ( const SpatialReference rhs)

The copy assignment operator.

Parameters
[in]rhsThe right hand side.
Returns
A reference to this.
bool dg::deepcore::geometry::SpatialReference::operator== ( const SpatialReference rhs) const

The equality operator.

Parameters
[in]rhsThe right hand side.
Returns
Whether this == rhs.
cv::Point2d dg::deepcore::imagery::GeoImage::origin ( ) const

Gets the origin in the image's native coordinate system. The origin is the north-west corner.

Returns
The origin.
cv::Size2d dg::deepcore::imagery::GeoImage::pixelSize ( ) const

Gets the pixel size in the image's native coordinate system.

Returns
The pixel size.
PixelType::Type dg::deepcore::imagery::GeoImage::pixelType ( ) const

Gets the image pixel type.

Returns
The image pixel type.
virtual PixelType::Type dg::deepcore::imagery::MapServiceClient::pixelType ( )
pure virtual

Gets the image pixel type as a cv::Mat type i.e. CV_8U, CV_8S, CV_32F, etc.

Returns
The pixel type.

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

const OGRSpatialReference * dg::deepcore::geometry::SpatialReference::ref ( ) const

return a pointer to the OGRSpatialReference this object references.

Returns
The OGRSpatialReference.
void dg::deepcore::imagery::MapBoxClient::setAccessToken ( const std::string &  accessToken)

Sets the access token. Will terminate the current connection if connected.

Parameters
[in]accessTokenThe access token.
void dg::deepcore::imagery::MapServiceClient::setAdditionalArguments ( const std::map< std::string, std::string > &  arguments)
virtual

Gets additional URL arguments to be added to each request. Does not cause the connection to be terminated, but inheriting classes may do so.

Parameters
[in]argumentsThe additional arguments.
void dg::deepcore::imagery::MapServiceClient::setBaseUrl ( const std::string &  baseUrl)

Sets the base URL. Will terminate the current connection if connected.

Parameters
[in]baseUrlThe base URL.
void dg::deepcore::imagery::MapServiceClient::setConnected ( bool  connected)
protectedvirtual

Sets whether we're connected to the web service. Inheriting classes may override this, but be sure to call the base classe's method as well.

Parameters
[in]connectedWhether we're connected.

Reimplemented in dg::deepcore::imagery::WmtsClient.

void dg::deepcore::imagery::MapServiceClient::setCredentials ( const std::string &  credentials)

Sets the credentials. Will terminate the current connection if connected.

Parameters
[in]credentialsThe credentials.
bool dg::deepcore::imagery::MapServiceClient::setImageFormat ( const std::string &  imageFormat)
virtual

Sets the image format. Does not cause the connection to be terminated, but inheriting classes may do so.

Parameters
imageFormatThe image format as MIME type.
Returns
true if the image format was reset, false if the desired image format is already current.
bool dg::deepcore::imagery::MapServiceClient::setLayer ( const std::string &  layer)
virtual

Sets the current layer. Does not cause the connection to be terminated, but inheriting classes may do so.

Parameters
[in]layerThe layer.
Returns
true if the layer was reset, false if the desired layer is already current.

Reimplemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

void dg::deepcore::imagery::MapServiceImage::setMaxConnections ( int  connections)

Sets the number of simultaneous connections to use.

Parameters
[in]connectionsThe number of connections.
bool dg::deepcore::imagery::MapServiceClient::setTileMatrixId ( const std::string &  tileMatrixId)
virtual

Sets the tile matrix id. Does not cause the connection to be terminated, but inheriting classes may do so.

Parameters
tileMatrixIdThe tile matrix id.
Returns
true if the tile matrix was reset, false if the desired tile matrix is already current.

Reimplemented in dg::deepcore::imagery::WmtsClient, and dg::deepcore::imagery::TileJsonClient.

bool dg::deepcore::imagery::MapServiceClient::setTileMatrixSet ( const std::string &  tileMatrixSet)
virtual

Sets the tile matrix set.

Parameters
[in]tileMatrixSetThe tile matrix set. Does not cause the connection to be terminated, but inheriting classes may do so.
Returns
true if the tile matrix set was reset, false if the desired tile matrix set is already current.

Reimplemented in dg::deepcore::imagery::WmtsClient.

const cv::Size & dg::deepcore::imagery::GeoImage::size ( ) const

Gets the image pixel size.

Returns
The image's pixel size.
const geometry::SpatialReference & dg::deepcore::imagery::GeoImage::spatialReference ( ) const
noexcept

Gets the image's spatial reference system.

Returns
The spatial reference system.
virtual const geometry::SpatialReference& dg::deepcore::imagery::MapServiceClient::spatialReference ( )
pure virtual

Gets the spatial coordinate reference for the web service. May cause MapServiceClient::connect() to be called.

Returns
The spatial coordinate reference.

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

Subset dg::deepcore::imagery::SubsetBatch::subset ( size_t  index) const

Returns a Subset that contains an image represented by the batch data at the given index. This function will combine individual channels of multi-band images, so the data may be copied. This function is provided for convenience and testing.

Parameters
[in]indexThe index of the image in the batch.
Returns
The Subset representing the batch data. Image data may be copied, so it is not guaranteed to point back to the original data.
virtual const wmts::TileMatrix& dg::deepcore::imagery::MapServiceClient::tileMatrix ( )
pure virtual

Gets the current tile matrix parameters.

Returns
The tile matrix parameters.

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

const string & dg::deepcore::imagery::MapServiceClient::tileMatrixId ( )

Gets the tile matrix id.

Returns
The tile matrix id.
virtual const std::vector<std::string>& dg::deepcore::imagery::MapServiceClient::tileMatrixIds ( )
pure virtual

Gets the available tile matrix ids for the current tile matrix set.

Returns
The available tile matricies

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

const string & dg::deepcore::imagery::MapServiceClient::tileMatrixSet ( )

Gets the tile matrix set.

Returns
The tile matrix set.
virtual const std::vector<std::string>& dg::deepcore::imagery::MapServiceClient::tileMatrixSets ( )
pure virtual

Gets the the available tile matrix sets for the current layer.

Returns
The available tile matrix sets

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

std::string dg::deepcore::geometry::SpatialReference::units ( ) const

Gets the projection units.

Returns
The units as a string.
double dg::deepcore::geometry::SpatialReference::unitsCoefficient ( ) const

Gets the multiplier to convert the projection units to meters for linear units and radians for angular units.

Returns
The coefficient.
virtual std::string dg::deepcore::imagery::MapServiceClient::urlTemplate ( )
pure virtual

Gets the URL template for the current layer, tile matrix set, and tile matrix. The template must contain {x} and {y} placeholders for the tile coordinate.

Returns
The URL template.

Implemented in dg::deepcore::imagery::TileJsonClient, and dg::deepcore::imagery::WmtsClient.

std::string dg::deepcore::geometry::SpatialReference::wkt ( ) const

Gets the WKT string describing this SpatialReference.

Returns
The WTK string.

Variable Documentation

const SpatialReference dg::deepcore::geometry::SpatialReference::WEB_MERCATOR = SpatialReference::fromEpsg(3857)
static

WGS 84 / Pseudo-Mercator projected coordinate system (EPSG:3857)

const SpatialReference dg::deepcore::geometry::SpatialReference::WGS84 = SpatialReference::fromEpsg(4326)
static

WGS84 geographic coordinate system (EPSG:4326)

const SpatialReference dg::deepcore::geometry::SpatialReference::WORLD_MERCATOR = SpatialReference::fromEpsg(3395)
static

WGS 84 / World Mercator projected coordinate system (EPSG:3395)