From a84fbbac62a5ead776d0946c4be9ca2b6d9a08fc Mon Sep 17 00:00:00 2001 From: doinachiroiu Date: Thu, 24 Sep 2020 09:40:30 +0000 Subject: [PATCH] Required changed resolved --- oss-internship-2020/gdal/CMakeLists.txt | 12 +++++------- oss-internship-2020/gdal/README.md | 16 +++++++++++----- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/oss-internship-2020/gdal/CMakeLists.txt b/oss-internship-2020/gdal/CMakeLists.txt index a1959d8..b1ef29e 100644 --- a/oss-internship-2020/gdal/CMakeLists.txt +++ b/oss-internship-2020/gdal/CMakeLists.txt @@ -22,7 +22,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) find_package(PNG REQUIRED) find_package(PkgConfig REQUIRED) pkg_check_modules(libpcre REQUIRED IMPORTED_TARGET libpcre) -#pkg_check_modules(libproj REQUIRED IMPORTED_TARGET libproj) +pkg_check_modules(proj REQUIRED IMPORTED_TARGET proj) set(SAPI_ROOT "${PROJECT_SOURCE_DIR}/../.." CACHE PATH "Path to the Sandboxed API source tree") # cmake .. -G Ninja -DSAPI_ROOT=$HOME/sapi_root @@ -40,17 +40,15 @@ set_property(TARGET libgdal PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_D target_link_libraries(libgdal INTERFACE crypto expat jpeg PkgConfig::libpcre - /usr/lib/libproj.so + PkgConfig::proj sqlite3 tiff z pthread m rt dl curl PNG::PNG) add_sapi_library(gdal_sapi FUNCTIONS GDALOpen GDALAllRegister GDALGetDatasetDriver - GDALGetDriverShortName GDALGetDriverLongName GDALGetRasterXSize - GDALGetRasterYSize GDALGetRasterCount GDALGetProjectionRef - GDALOpenEx GDALGetGeoTransform GDALGetRasterBand GDALGetBlockSize - GDALGetRasterMinimum GDALGetRasterMaximum GDALGetRasterBandXSize - GDALGetRasterBandYSize GDALRasterIO + GDALGetDriverShortName GDALGetDriverLongName + GDALGetGeoTransform GDALGetRasterBand GDALGetBlockSize + GDALGetRasterBandXSize GDALGetRasterBandYSize GDALRasterIO INPUTS "/usr/include/gdal/gdal.h" LIBRARY libgdal diff --git a/oss-internship-2020/gdal/README.md b/oss-internship-2020/gdal/README.md index 85e7da6..4d0981f 100644 --- a/oss-internship-2020/gdal/README.md +++ b/oss-internship-2020/gdal/README.md @@ -20,6 +20,12 @@ PNG: `sudo apt-get install libpng-dev` PCRE: `sudo apt-get install libpcre3 libpcre3-dev` PROJ: `sudo apt-get install libproj-dev` + +OBS! You may need to set `export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib`. +It is required for libproj.so to be found into +/usr/local/lib/. You can also fix this by typing `locate libproj.so` +which will give you and then +`cp /usr/local/lib/`. ### Initializing GDAL submodule: `git submodule add https://github.com/OSGeo/gdal/tree/master/gdal` @@ -33,7 +39,7 @@ GNUmakefile from gdal/gdal can handle building the static library. `cp gdal/gdal/libgdal.a lib/` -OBS: The file is huge! It may take a while. +OBS! The file is huge! It may take a while. ### For testing: `mkdir build && cd build` @@ -54,7 +60,7 @@ using GDAL functionalities and sandboxed methods. *Sandboxing...* - The purpose of sandboxing is to limit the permissions +The purpose of sandboxing is to limit the permissions and capabilities of library’s methods, in order to secure the usage of them. After obtaining the sandbox, the functions will be called through an Sandbox API @@ -64,10 +70,10 @@ using GDAL functionalities and sandboxed methods. *Raster process...* - From gdal.h header useful methods are added to sapi +From gdal.h header useful methods are added to sapi library builded with CMake. - One .tiff file is manipulated with GDALOpen +One .tiff file is manipulated with GDALOpen functionality, which extracts a pointer to the data set containg a list of raster bands, all pertaining to the same area. @@ -75,7 +81,7 @@ using GDAL functionalities and sandboxed methods. transform, size of raster and various other information are kept into the data set that corresponds to the image. - To create an array containing the image information, the +To create an array containing the image information, the dimentions needed are extracted using some specific GDAL(X/Y)Size functions applied to the block. GDALRasterBand function takes care of data type conversion, one more step following: placing the