|
Geodot Plugin
|
Wrapper for an OGRFeature representing a Line. More...
#include <LineFeature.h>
Public Member Functions | |
| LineFeature (OGRFeature *feature) | |
| Construct a LineFeature with a feature which contains a LineString. | |
| LineFeature (OGRFeature *feature, OGRGeometry *linestring) | |
| std::vector< double > | get_line_point (int index) |
| double | get_line_point_x (int index) |
| double | get_line_point_y (int index) |
| double | get_line_point_z (int index) |
| int | get_point_count () |
| Return the number of points in the line. | |
| void | set_point_count (int new_count) |
| void | set_line_point (int index, double x, double y, double z=0.0) |
Public Member Functions inherited from Feature | |
| Feature (OGRFeature *feature) | |
| Construct a Feature from an OGRFeature from GDAL, taking ownership of the OGRFeature object. | |
| Feature (OGRFeature *feature, const OGRGeometry *geometry) | |
| std::map< std::string, std::string > | get_attributes () |
| Return a map with all attribute names -> values. | |
| const char * | get_attribute (const char *name) |
| void | set_attribute (const char *name, const char *value) |
| int | get_id () const |
| bool | intersects_with (std::shared_ptr< Feature > other) const |
Additional Inherited Members | |
Public Types inherited from Feature | |
| enum | GeometryType { NONE , POINT , LINE , POLYGON } |
Public Attributes inherited from Feature | |
| GeometryType | geometry_type = NONE |
| bool | is_deleted = false |
| OGRFeature * | feature |
Wrapper for an OGRFeature representing a Line.
| LineFeature::LineFeature | ( | OGRFeature * | feature, |
| OGRGeometry * | linestring | ||
| ) |
Construct a LineFeature with a feature that can contain any geometry (usually used for MultiLineStrings) - it is not accessed, the geometry is given as a separate LineString parameter instead.
| std::vector< double > LineFeature::get_line_point | ( | int | index | ) |
Return the point in the line at the given index as a std::vector with 3 double entries (3D vector). The index must be between 0 and get_point_count()-1.
| double LineFeature::get_line_point_x | ( | int | index | ) |
Get the individual x, y and z components from the line point at the given index. The same can be accomplished with the get_line_point function, but this one works without special std types.
| void LineFeature::set_line_point | ( | int | index, |
| double | x, | ||
| double | y, | ||
| double | z = 0.0 |
||
| ) |
Set the coordinates of the point at the given index. Note that the point must exist, otherwise nothing is done. If necessary, create new points with set_point_count before calling this. The z coordinate is optional, it defaults to 0.0.
| void LineFeature::set_point_count | ( | int | new_count | ) |
Set the number of points within the line. Removes or adds new points depending on the previous size.