Geodot Plugin
|
#include <geodata.h>
Public Member Functions | |
bool | is_valid () |
Returns true if the layer could successfully be loaded. | |
Dictionary | get_file_info () |
Ref< GeoDataset > | get_dataset () |
Returns the dataset which this layer was opened from. Never null because feature layers must have an underlying dataset. | |
int | get_epsg_code () |
Returns the spatial reference of the underlying dataset. | |
Vector3 | get_center () |
Ref< GeoFeature > | get_feature_by_id (int id) |
Returns the one feature that corresponds to the given ID. | |
Array | get_all_features () |
Returns all features, regardless of the geometry, within this layer. | |
Ref< GeoFeature > | create_feature () |
void | remove_feature (Ref< GeoFeature > feature) |
void | clear_cache () |
void | save_override () |
void | save_new (String file_path) |
Array | get_features_near_position (double pos_x, double pos_y, double radius, int max_features) |
Array | get_features_in_square (double top_left_x, double top_left_y, double size_meters, int max_features) |
Returns all features which intersect with the square constructed by the given top-left and size. | |
Array | get_features_by_attribute_filter (String filter) |
Ref< GeoFeature > | get_specialized_feature (std::shared_ptr< Feature > raw_feature) |
Returns the (cached) specialized feature of the given raw feature. | |
void | set_native_layer (std::shared_ptr< NativeLayer > new_layer) |
void | set_origin_dataset (Ref< GeoDataset > dataset) |
Public Attributes | |
String | name |
Static Protected Member Functions | |
static void | _bind_methods () |
A layer which contains any number of features. These features consist of attributes and usually (but not necessarily) vector geometry. This layer provides access to these features through various filters. Corresponds to OGRLayer. Its name
property corresponds to the layer name.
void godot::GeoFeatureLayer::clear_cache | ( | ) |
Clears all cached features. Note that this will cause newly returned features not to have shared signals and changes with previously returned features.
Ref< GeoFeature > godot::GeoFeatureLayer::create_feature | ( | ) |
Adds the given feature to the layer. This change has no effect on the dataset on disk unless save_override or save_new is called.
Vector3 godot::GeoFeatureLayer::get_center | ( | ) |
Returns the point in the center of the layer in projected meters. The y-component is 0.0.
Array godot::GeoFeatureLayer::get_features_by_attribute_filter | ( | String | filter | ) |
Returns all features which fulfill the given SQL-WHERE-like attribute filter, e.g. "attributename < 1000" Note that syntax errors are printed to the console by GDAL.
Array godot::GeoFeatureLayer::get_features_near_position | ( | double | pos_x, |
double | pos_y, | ||
double | radius, | ||
int | max_features | ||
) |
Returns all features, regardless of the geometry, near the given position (within the given radius).
Dictionary godot::GeoFeatureLayer::get_file_info | ( | ) |
Returns information about this file: path
: the path to the dataset name
: the name of the layer within the dataset
void godot::GeoFeatureLayer::remove_feature | ( | Ref< GeoFeature > | feature | ) |
Removes the given feature from the layer. This change has no effect on the dataset on disk unless save_override or save_new is called.
void godot::GeoFeatureLayer::save_new | ( | String | file_path | ) |
Applies all changes made to the layer to a copy of the original layer which is created at the given path. Will be created as a Shapefile.
void godot::GeoFeatureLayer::save_override | ( | ) |
Applies all changes made to the layer to this layer, overriding the previous data permanently.
void godot::GeoFeatureLayer::set_native_layer | ( | std::shared_ptr< NativeLayer > | new_layer | ) |
Set the OGRLayer object directly. Not exposed to Godot since Godot doesn't know about GDALDatasets - this is only for internal use.
void godot::GeoFeatureLayer::set_origin_dataset | ( | Ref< GeoDataset > | dataset | ) |
Sets the dataset which this layer was opened from. Not exposed to Godot since it should never construct GeoFeatureLayers by hand.