![]() |
![]()
| ![]() |
![]()
NAMEGeo::GDAL::FFI::Dataset - A GDAL datasetSYNOPSISDESCRIPTIONA collection of raster bands or vector layers. Obtain a dataset object by opening it with the Open method of Geo::GDAL::FFI object or by creating it with the Create method of a Driver object.METHODSGetDrivermy $driver = $dataset->GetDriver; GetWidthmy $w = $dataset->GetWidth; GetHeightmy $h = $dataset->GetHeight; GetSizemy @size = $dataset->GetSize; Returns the size (width, height) of the bands of this raster dataset. GetBandmy $band = $dataset->GetBand($i); Get the ith (by default the first) band of a raster dataset. GetBandsmy @bands = $dataset->GetBands; Returns a list of Band objects representing the bands of this raster dataset. CreateLayermy $layer = $dataset->CreateLayer({Name => 'layer', ...}); Create a new vector layer into this vector dataset. Named arguments are the following.
GetLayerCount my $count = $dataset->GetLayerCount();GetLayermy $layer = $dataset->GetLayer($name); If $name is strictly an integer, then returns the (name-1)th layer in the dataset, otherwise returns the layer whose name is $name. Without arguments returns the first layer. CopyLayermy $copy = $dataset->CopyLayer($layer, $name, {DST_SRSWKT => 'WKT of a SRS', ...}); Copies the given layer into this dataset using the name $name and returns the new layer. The options hash is mostly driver specific. ExecuteSQL $dataset->ExecuteSQL ($sql, $filter, $dialect);# build a spatial index $dataset->ExecuteSQL (qq{CREATE SPATIAL INDEX ON "$some_layer_name"}); # filter a data set using the SQLite dialect and a second geometry my $filtered = $dataset->ExecuteSQL ( qq{SELECT "$fld1", "$fld2" FROM "$some_layer_name"}, $some_geometry, 'SQLite', ); Infomy $info = $dataset->Info($options); my $info = $dataset->Info(['-json', '-stats']); This is the same as gdalinfo utility. $options is a reference to an array. Valid options are as per the gdalinfo <https://www.gdal.org/gdalinfo.html> utility. Translatemy $target = $source->Translate($path, $options, $progress, $progress_data); Convert a raster dataset into another raster dataset. This is the same as the gdal_translate <https://www.gdal.org/gdal_translate.html> utility. $name is the name of the target dataset. $options is a reference to an array of switches. Warpmy $result = $dataset->Warp($args); $args is a hashref, keys may be Destination, Input, Options, Progress, ProgressData. Valid options are as per the gdalwarp <https://www.gdal.org/gdalwarp.html> utility. VectorTranslatemy $result = $dataset->VectorTranslate($args); $args is a hashref, keys may be Destination, Input, Options, Progress, ProgressData. Valid options are as per the ogr2ogr <https://www.gdal.org/ogr2ogr.html> utility. DEMProcessingmy $result = $dataset->DEMProcessing($path, $args); $args is a hashref, keys may be Processing, ColorFilename, Options, Progress, ProgressData. See also gdaldem <https://www.gdal.org/gdaldem.html>. NearBlackmy $result = $dataset->NearBlack($args); $args is a hashref, keys may be Destination, Options, Progress, ProgressData. Valid options are as per the nearblack <https://www.gdal.org/nearblack.html> utility. Gridmy $result = $dataset->Grid($path, $options, $progress, $progress_data); Valid options are as per the gdal_grid <https://www.gdal.org/gdal_grid.html> utility. Rasterizemy $result = $dataset->Rasterize($args); my $result = $dataset->Rasterize({Options => [-b => 1, -at]}); $args is a hashref, keys may be Destination, Options, Progress, ProgressData. Valid options are as per the gdal_rasterize <https://www.gdal.org/gdal_rasterize.html> utility. BuildVRTmy $result = $dataset->BuildVRT($path, $args); $args is a hashref, keys may be Input, Options, Progress, ProgressData. LICENSEThis software is released under the Artistic License. See perlartistic.AUTHORAri Jolma - Ari.Jolma at gmail.comSEE ALSOGeo::GDAL::FFIAlien::gdal, FFI::Platypus, <http://www.gdal.org>
|