Skip to content

Commit

Permalink
2nd attempt, release 0.3.0 - remove projstring conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Sep 17, 2019
1 parent 38674b5 commit 1113ad5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions R/raster-info.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ sds_boilerplate_checks <- function(x, sds = NULL) {
#' \item{tilesXY}{dimensions x-y of internal tiling scheme}
#' \item{projection}{text version of map projection parameter string}
#' \item{bands}{number of bands in the dataset}
#' \item{proj4}{not implemented}
#' }
#'
#' On access vapour functions will report on the existence of subdatasets while
Expand Down
5 changes: 4 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@

Hello,

Submission of vapour 0.3.0:
(second try, first failed pre-checks)

Submission of vapour 0.3.0:

* deprecated configure R CMD config CPP removed
* use of PROJ 6 deprecated API enable
* size of installed directories is expected for GDAL
* removed problematic string conversion

Thank you

Expand Down
1 change: 1 addition & 0 deletions man/vapour_raster_info.Rd

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

14 changes: 7 additions & 7 deletions src/rasterio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ List raster_info_cpp (CharacterVector filename, LogicalVector min_max)
const char *proj;
proj = GDALGetProjectionRef(hDataset);
//https://gis.stackexchange.com/questions/164279/how-do-i-create-ogrspatialreference-from-raster-files-georeference-c
char *proj_tmp = (char *) proj;
//char *proj_tmp = (char *) proj;
out[4] = Rcpp::CharacterVector::create(proj);
names[4] = "projection";

Expand All @@ -84,16 +84,16 @@ List raster_info_cpp (CharacterVector filename, LogicalVector min_max)
out[5] = nBands;
names[5] = "bands";

char *stri;
OGRSpatialReference oSRS;
oSRS.importFromWkt(&proj_tmp);
oSRS.exportToProj4(&stri);
out[6] = Rcpp::CharacterVector::create(stri);
//char *stri;
//OGRSpatialReference oSRS;
//oSRS.importFromWkt(&proj_tmp);
//oSRS.exportToProj4(&stri);
out[6] = Rcpp::CharacterVector::create(""); //Rcpp::CharacterVector::create(stri);
names[6] = "proj4";

out.attr("names") = names;

CPLFree(stri);
//CPLFree(stri);
// close up
GDALClose( hDataset );
return out;
Expand Down

0 comments on commit 1113ad5

Please sign in to comment.