Geodot Plugin
Loading...
Searching...
No Matches
Feature.h
1#ifndef VECTOREXTRACTOR_FEATURE_H
2#define VECTOREXTRACTOR_FEATURE_H
3
4#include "defines.h"
5#include <map>
6#include <memory>
7#include <string>
8
9class OGRFeature;
10class OGRGeometry;
11
12class Feature {
13 public:
14 enum GeometryType { NONE, POINT, LINE, POLYGON };
15
17 explicit Feature(OGRFeature *feature);
18
19 virtual ~Feature();
20
24 Feature(OGRFeature *feature, const OGRGeometry *geometry);
25
27 std::map<std::string, std::string> get_attributes();
28
31 const char *get_attribute(const char *name);
32
33 void set_attribute(const char *name, const char *value);
34
35 int get_id() const;
36
37 bool intersects_with(std::shared_ptr<Feature> other) const;
38
39 GeometryType geometry_type = NONE;
40
41 bool is_deleted = false;
42
43 OGRFeature *feature;
44};
45
46#endif // VECTOREXTRACTOR_FEATURE_H
Definition: Feature.h:12
Feature(OGRFeature *feature, const OGRGeometry *geometry)
std::map< std::string, std::string > get_attributes()
Return a map with all attribute names -> values.
Definition: Feature.cpp:11
const char * get_attribute(const char *name)
Definition: Feature.cpp:21