Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
Loading...
Searching...
No Matches
fishnet::OGRLayerAdapter< G > Class Template Reference

Reads and writes a VectorLayer whose geometries are backed by the OGR data source. More...

#include <OGRLayerAdapter.hpp>

Static Public Member Functions

static OGRwkbGeometryType layerGeometryType ()
 WKB type an output layer holding G has to be created with.
 
static Either< VectorLayer< G >, std::string > fromOGR (OGRLayer *ogrLayer)
 Converts an OGRLayer to a fishnet::VectorLayer.
 
static Either< OGRLayer *, std::string > toOGR (const VectorLayer< G > &layer, OGRLayer *outputLayer)
 Converts a fishnet::VectorLayer to an OGRLayer.
 

Detailed Description

template<geometry::OGRWritableGeometry G>
class fishnet::OGRLayerAdapter< G >

Reads and writes a VectorLayer whose geometries are backed by the OGR data source.

Nothing is rebuilt out of the data source on the way in, and nothing is rebuilt point by point on the way out.

See also
fishnet::geometry::OGRLayerGeometry for the geometries this covers, and the adapters' toNative() for getting a fishnet value type back where one is needed.

Member Function Documentation

◆ fromOGR()

template<geometry::OGRWritableGeometry G>
static Either< VectorLayer< G >, std::string > fishnet::OGRLayerAdapter< G >::fromOGR ( OGRLayer *  ogrLayer)
inlinestatic

Converts an OGRLayer to a fishnet::VectorLayer.

Parameters
ogrLayerpointer to the OGRLayer
Returns
util::Either<VectorLayer<G>, std::string> VectorLayer if successful, error message otherwise
Note
features whose geometry is missing, or of a type a layer of G cannot hold, are skipped

◆ layerGeometryType()

template<geometry::OGRWritableGeometry G>
static OGRwkbGeometryType fishnet::OGRLayerAdapter< G >::layerGeometryType ( )
inlinestatic

WKB type an output layer holding G has to be created with.

◆ toOGR()

template<geometry::OGRWritableGeometry G>
static Either< OGRLayer *, std::string > fishnet::OGRLayerAdapter< G >::toOGR ( const VectorLayer< G > &  layer,
OGRLayer *  outputLayer 
)
inlinestatic

Converts a fishnet::VectorLayer to an OGRLayer.

Parameters
layervector layer to be converted
outputLayerinout parameter, should be already created with the correct geometry type and spatial reference
Returns
util::Either<OGRLayer, std::string> OGRLayer if successful, error message otherwise

The documentation for this class was generated from the following file: