Skip to content

Commit

Permalink
try srs wkt too
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Jun 6, 2024
1 parent 460a401 commit 2d5af08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions R/vapour-gdal-library.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ vapour_srs_wkt <- function(crs) {
#' @export
#'
#' @examples
#' vapour_srs_wkt("+proj=longlat")
#' vapour_crs_is_lonlat("+proj=laea +type=crs")
#' vapour_crs_is_lonlat("+proj=longlat +type=crs")
#' vapour_crs_is_lonlat("+init=EPSG:4326")
Expand Down
8 changes: 2 additions & 6 deletions inst/include/gdalraster/gdalraster.h
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,11 @@ inline List gdal_raster_info(CharacterVector dsn, LogicalVector min_max)
}
int nXSize = GDALGetRasterXSize(hDataset);
int nYSize = GDALGetRasterYSize(hDataset);



double adfGeoTransform[6];

//poDataset->GetGeoTransform( adfGeoTransform );
GDALGetGeoTransform(hDataset, adfGeoTransform );


// bail out NOW (we have no SDS and/or no rasters)
// #f <- system.file("h5ex_t_enum.h5", package = "h5")
if (GDALGetRasterCount(hDataset) < 1) {
Expand Down Expand Up @@ -437,11 +434,10 @@ inline List gdal_raster_info(CharacterVector dsn, LogicalVector min_max)
CSLDestroy(pfilelist);
GDALRasterBandH hBand;
int nBlockXSize, nBlockYSize;
//int bGotMin, bGotMax;
double adfMinMax[2];

hBand = GDALGetRasterBand(hDataset, 1);
// if we don't bail out above with no rasters things go bad here

GDALGetBlockSize(hBand, &nBlockXSize, &nBlockYSize);
if (min_max[0]) {
GDALComputeRasterMinMax(hBand, TRUE, adfMinMax);
Expand Down
1 change: 1 addition & 0 deletions man/vapour_crs_is_lonlat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2d5af08

Please sign in to comment.