Geodot Plugin
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Protected Member Functions | List of all members
godot::GeoFeatureLayer Class Reference

#include <geodata.h>

Inheritance diagram for godot::GeoFeatureLayer:

Public Member Functions

bool is_valid ()
 Returns true if the layer could successfully be loaded.
 
Dictionary get_file_info ()
 
Ref< GeoDatasetget_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< GeoFeatureget_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< GeoFeaturecreate_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< GeoFeatureget_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 ()
 

Detailed Description

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.

Member Function Documentation

◆ clear_cache()

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.

◆ create_feature()

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.

◆ get_center()

Vector3 godot::GeoFeatureLayer::get_center ( )

Returns the point in the center of the layer in projected meters. The y-component is 0.0.

◆ get_features_by_attribute_filter()

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.

◆ get_features_near_position()

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).

◆ get_file_info()

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

◆ remove_feature()

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.

◆ save_new()

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.

◆ save_override()

void godot::GeoFeatureLayer::save_override ( )

Applies all changes made to the layer to this layer, overriding the previous data permanently.

◆ set_native_layer()

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.

◆ set_origin_dataset()

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.


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