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

Stores the geometries, wrapped in features (which hold the field values / attributes) Keeps track of the fields available for the features Stores a SpatialReference. More...

#include <VectorLayer.hpp>

Public Types

using geometry_type = G
 
using feature_type = Feature< G >
 

Public Member Functions

 VectorLayer ()=default
 Construct a new incomplete Vector Layer object.
 
 VectorLayer (OGRSpatialReference spatialReference)
 Construct a new empty Vector Layer object.
 
constexpr size_t size () const noexcept
 
constexpr bool isEmpty () const noexcept
 
constexpr util::view_of< G > auto getGeometries () const noexcept
 
constexpr util::view_of< Feature< G > > auto getFeatures () const noexcept
 
constexpr util::view_of< Feature< G > > auto getFeatures () noexcept
 
constexpr const OGRSpatialReference & getSpatialReference () const noexcept
 
constexpr void setSpatialReference (const OGRSpatialReference &spatialReference) noexcept
 
constexpr void addGeometry (const G &g) noexcept
 
constexpr void addGeometry (G &&g) noexcept
 
constexpr void addAllGeometry (util::forward_range_of< G > auto &&geometries) noexcept
 
constexpr bool containsGeometry (const G &g) const noexcept
 checks if any geometry is equal to the passed geometry WARNING: this method might be slow, since it might compare all geometries of the layer with the passed geometry
 
constexpr void removeGeometry (const G &g) noexcept
 
constexpr void addFeature (Feature< G > &&feature) noexcept
 
constexpr void addFeature (const Feature< G > &feature) noexcept
 
constexpr void addFeatures (util::forward_range_of< Feature< G > > auto &&features) noexcept
 
constexpr bool containsFeature (const Feature< G > &feature) noexcept
 
constexpr void removeFeature (const Feature< G > &feature) noexcept
 
template<FieldValueType T>
constexpr fishnet::Either< FieldDefinition< T >, error_type > addField (const std::string &fieldName, const std::optional< int > &fieldID=std::nullopt) noexcept
 Add a field of generic type T to the layer. A field is referenced exclusively by its name.
 
constexpr fishnet::Either< FieldDefinition< int >, error_type > addIntegerField (const std::string &fieldName, const std::optional< int > &fieldID=std::nullopt) noexcept
 
constexpr fishnet::Either< FieldDefinition< double >, error_type > addDoubleField (const std::string &fieldName, const std::optional< int > &fieldID=std::nullopt) noexcept
 
constexpr fishnet::Either< FieldDefinition< std::string >, error_type > addTextField (const std::string &fieldName, const std::optional< int > &fieldID=std::nullopt) noexcept
 
constexpr fishnet::Either< FieldDefinition< size_t >, error_type > addSizeField (const std::string &fieldName, const std::optional< int > &fieldID=std::nullopt) noexcept
 
constexpr bool hasField (const std::string &fieldName) const noexcept
 
constexpr void removeField (const std::string &fieldName) noexcept
 
constexpr void clearFields () noexcept
 
template<geometry::AnyGeometry T>
constexpr void copyFields (VectorLayer< T > &other) const noexcept
 
template<FieldValueType T>
constexpr fishnet::Either< FieldDefinition< T >, error_type > getField (const std::string &fieldName) const noexcept
 
constexpr fishnet::Either< FieldDefinition< double >, error_type > getDoubleField (const std::string &fieldName) const noexcept
 
constexpr fishnet::Either< FieldDefinition< int >, error_type > getIntegerField (const std::string &fieldName) const noexcept
 
constexpr fishnet::Either< FieldDefinition< size_t >, error_type > getSizeField (const std::string &fieldName) const noexcept
 
constexpr fishnet::Either< FieldDefinition< std::string >, error_type > getTextField (const std::string &fieldName) const noexcept
 
constexpr const std::unordered_map< std::string, FieldDefinitionVariant > & getFieldsMap () const noexcept
 

Friends

template<geometry::AnyGeometry T>
class VectorLayer
 

Detailed Description

template<geometry::AnyGeometry G>
class fishnet::VectorLayer< G >

Stores the geometries, wrapped in features (which hold the field values / attributes) Keeps track of the fields available for the features Stores a SpatialReference.

Template Parameters
G

Member Typedef Documentation

◆ feature_type

template<geometry::AnyGeometry G>
using fishnet::VectorLayer< G >::feature_type = Feature<G>

◆ geometry_type

template<geometry::AnyGeometry G>
using fishnet::VectorLayer< G >::geometry_type = G

Constructor & Destructor Documentation

◆ VectorLayer() [1/2]

template<geometry::AnyGeometry G>
fishnet::VectorLayer< G >::VectorLayer ( )
default

Construct a new incomplete Vector Layer object.

◆ VectorLayer() [2/2]

template<geometry::AnyGeometry G>
fishnet::VectorLayer< G >::VectorLayer ( OGRSpatialReference  spatialReference)
inlineexplicit

Construct a new empty Vector Layer object.

Parameters
spatialReferencespatial reference which is required to write a GIS-Shapefile to the disk

Member Function Documentation

◆ addAllGeometry()

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::addAllGeometry ( util::forward_range_of< G > auto &&  geometries)
inlineconstexprnoexcept

◆ addDoubleField()

template<geometry::AnyGeometry G>
constexpr fishnet::Either< FieldDefinition< double >, error_type > fishnet::VectorLayer< G >::addDoubleField ( const std::string &  fieldName,
const std::optional< int > &  fieldID = std::nullopt 
)
inlineconstexprnoexcept

◆ addFeature() [1/2]

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::addFeature ( const Feature< G > &  feature)
inlineconstexprnoexcept

◆ addFeature() [2/2]

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::addFeature ( Feature< G > &&  feature)
inlineconstexprnoexcept

◆ addFeatures()

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::addFeatures ( util::forward_range_of< Feature< G > > auto &&  features)
inlineconstexprnoexcept

◆ addField()

template<geometry::AnyGeometry G>
template<FieldValueType T>
constexpr fishnet::Either< FieldDefinition< T >, error_type > fishnet::VectorLayer< G >::addField ( const std::string &  fieldName,
const std::optional< int > &  fieldID = std::nullopt 
)
inlineconstexprnoexcept

Add a field of generic type T to the layer. A field is referenced exclusively by its name.

Template Parameters
Tvalue type stored in the field
Parameters
fieldNameidentifier of the field, must not exceed 10 characters
fieldIDoptional field ID, if not provided, a unique ID is generated. Use with care!
Returns
constexpr util::Either<FieldDefinition<T>,error_type>

◆ addGeometry() [1/2]

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::addGeometry ( const G &  g)
inlineconstexprnoexcept

◆ addGeometry() [2/2]

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::addGeometry ( G &&  g)
inlineconstexprnoexcept

◆ addIntegerField()

template<geometry::AnyGeometry G>
constexpr fishnet::Either< FieldDefinition< int >, error_type > fishnet::VectorLayer< G >::addIntegerField ( const std::string &  fieldName,
const std::optional< int > &  fieldID = std::nullopt 
)
inlineconstexprnoexcept

◆ addSizeField()

template<geometry::AnyGeometry G>
constexpr fishnet::Either< FieldDefinition< size_t >, error_type > fishnet::VectorLayer< G >::addSizeField ( const std::string &  fieldName,
const std::optional< int > &  fieldID = std::nullopt 
)
inlineconstexprnoexcept

◆ addTextField()

template<geometry::AnyGeometry G>
constexpr fishnet::Either< FieldDefinition< std::string >, error_type > fishnet::VectorLayer< G >::addTextField ( const std::string &  fieldName,
const std::optional< int > &  fieldID = std::nullopt 
)
inlineconstexprnoexcept

◆ clearFields()

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::clearFields ( )
inlineconstexprnoexcept

◆ containsFeature()

template<geometry::AnyGeometry G>
constexpr bool fishnet::VectorLayer< G >::containsFeature ( const Feature< G > &  feature)
inlineconstexprnoexcept

◆ containsGeometry()

template<geometry::AnyGeometry G>
constexpr bool fishnet::VectorLayer< G >::containsGeometry ( const G &  g) const
inlineconstexprnoexcept

checks if any geometry is equal to the passed geometry WARNING: this method might be slow, since it might compare all geometries of the layer with the passed geometry

Parameters
g
Returns
true
false

◆ copyFields()

template<geometry::AnyGeometry G>
template<geometry::AnyGeometry T>
constexpr void fishnet::VectorLayer< G >::copyFields ( VectorLayer< T > &  other) const
inlineconstexprnoexcept

◆ getDoubleField()

template<geometry::AnyGeometry G>
constexpr fishnet::Either< FieldDefinition< double >, error_type > fishnet::VectorLayer< G >::getDoubleField ( const std::string &  fieldName) const
inlineconstexprnoexcept

◆ getFeatures() [1/2]

template<geometry::AnyGeometry G>
constexpr util::view_of< Feature< G > > auto fishnet::VectorLayer< G >::getFeatures ( ) const
inlineconstexprnoexcept

◆ getFeatures() [2/2]

template<geometry::AnyGeometry G>
constexpr util::view_of< Feature< G > > auto fishnet::VectorLayer< G >::getFeatures ( )
inlineconstexprnoexcept

◆ getField()

template<geometry::AnyGeometry G>
template<FieldValueType T>
constexpr fishnet::Either< FieldDefinition< T >, error_type > fishnet::VectorLayer< G >::getField ( const std::string &  fieldName) const
inlineconstexprnoexcept

◆ getFieldsMap()

template<geometry::AnyGeometry G>
constexpr const std::unordered_map< std::string, FieldDefinitionVariant > & fishnet::VectorLayer< G >::getFieldsMap ( ) const
inlineconstexprnoexcept

◆ getGeometries()

template<geometry::AnyGeometry G>
constexpr util::view_of< G > auto fishnet::VectorLayer< G >::getGeometries ( ) const
inlineconstexprnoexcept

◆ getIntegerField()

template<geometry::AnyGeometry G>
constexpr fishnet::Either< FieldDefinition< int >, error_type > fishnet::VectorLayer< G >::getIntegerField ( const std::string &  fieldName) const
inlineconstexprnoexcept

◆ getSizeField()

template<geometry::AnyGeometry G>
constexpr fishnet::Either< FieldDefinition< size_t >, error_type > fishnet::VectorLayer< G >::getSizeField ( const std::string &  fieldName) const
inlineconstexprnoexcept

◆ getSpatialReference()

template<geometry::AnyGeometry G>
constexpr const OGRSpatialReference & fishnet::VectorLayer< G >::getSpatialReference ( ) const
inlineconstexprnoexcept

◆ getTextField()

template<geometry::AnyGeometry G>
constexpr fishnet::Either< FieldDefinition< std::string >, error_type > fishnet::VectorLayer< G >::getTextField ( const std::string &  fieldName) const
inlineconstexprnoexcept

◆ hasField()

template<geometry::AnyGeometry G>
constexpr bool fishnet::VectorLayer< G >::hasField ( const std::string &  fieldName) const
inlineconstexprnoexcept

◆ isEmpty()

template<geometry::AnyGeometry G>
constexpr bool fishnet::VectorLayer< G >::isEmpty ( ) const
inlineconstexprnoexcept

◆ removeFeature()

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::removeFeature ( const Feature< G > &  feature)
inlineconstexprnoexcept

◆ removeField()

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::removeField ( const std::string &  fieldName)
inlineconstexprnoexcept

◆ removeGeometry()

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::removeGeometry ( const G &  g)
inlineconstexprnoexcept

◆ setSpatialReference()

template<geometry::AnyGeometry G>
constexpr void fishnet::VectorLayer< G >::setSpatialReference ( const OGRSpatialReference &  spatialReference)
inlineconstexprnoexcept

◆ size()

template<geometry::AnyGeometry G>
constexpr size_t fishnet::VectorLayer< G >::size ( ) const
inlineconstexprnoexcept

Friends And Related Symbol Documentation

◆ VectorLayer

template<geometry::AnyGeometry G>
template<geometry::AnyGeometry T>
friend class VectorLayer
friend

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