Skip to content

Commit

Permalink
update gdal
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Sep 10, 2024
1 parent aea9500 commit 0306f32
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 22 deletions.
8 changes: 1 addition & 7 deletions agrolib/gdal.pri
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

unix:!macx {
LIBS += -L/usr/lib -lgdal
LIBS += -L/usr/lib/x86_64-linux-gnu -lgeos_c

INCLUDEPATH += /usr/include/gdal
DEPENDPATH += /usr/include/gdal
Expand All @@ -39,16 +38,11 @@ win32-g++ {
mac {
LIBS += -framework IOKit
LIBS += -framework CoreFoundation
LIBS += -framework GDAL

QMAKE_LFLAGS += -F/Library/Frameworks/

LIBS += -framework GDAL
LIBS += -framework PROJ
LIBS += -framework GEOS

INCLUDEPATH += /Library/Frameworks/GDAL.framework/Headers
INCLUDEPATH += /Library/Frameworks/PROJ.framework/Headers
INCLUDEPATH += /Library/Frameworks/GEOS.framework/Headers
}


4 changes: 2 additions & 2 deletions agrolib/gdalHandler/gdalExtensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* https://github.com/mogasw/rasterix/
*/

#include "gdalExtensions.h"

#include <cstring>

#include "gdalExtensions.h"
#include <gdal_priv.h>


Expand Down
13 changes: 6 additions & 7 deletions agrolib/gdalHandler/gdalRasterFunctions.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
#include "gdalRasterFunctions.h"
#include "commonConstants.h"

#include <gdalwarper.h>

#include <iostream>
#include <cmath>

#include <gdalwarper.h>

#include <QFileInfo>
#include <QString>
#include <QDebug>


/*! readGdalRaster
* \brief open a raster file with GDAL library
* \return GDALDataset
*/
bool readGdalRaster(QString fileName, gis::Crit3DRasterGrid* myRaster, int &utmZone, QString &error)
bool readGdalRaster(QString fileName, gis::Crit3DRasterGrid* rasterPointer, int &utmZone, QString &error)
{
// check
if (myRaster == nullptr) return false;
// check parameters
if (rasterPointer == nullptr) return false;
if (fileName == "") return false;

GDALDataset* dataset = (GDALDataset*) GDALOpen(fileName.toStdString().data(), GA_ReadOnly);
Expand All @@ -28,7 +27,7 @@ bool readGdalRaster(QString fileName, gis::Crit3DRasterGrid* myRaster, int &utmZ
return false;
}

bool myResult = convertGdalRaster(dataset, myRaster, utmZone, error);
bool myResult = convertGdalRaster(dataset, rasterPointer, utmZone, error);
GDALClose(dataset);

return myResult;
Expand Down
2 changes: 1 addition & 1 deletion agrolib/gdalHandler/gdalRasterFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class QString;

bool readGdalRaster(QString fileName, gis::Crit3DRasterGrid *myRaster, int &utmZone, QString &error);
bool readGdalRaster(QString fileName, gis::Crit3DRasterGrid *rasterPointer, int &utmZone, QString &error);

bool convertGdalRaster(GDALDataset* dataset, gis::Crit3DRasterGrid *myRaster, int &utmZone, QString &error);

Expand Down
8 changes: 3 additions & 5 deletions agrolib/gdalHandler/gdalShapeFunctions.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#include <QFileInfo>
#include <string.h>
#include <ogrsf_frmts.h>
#include "ogr_spatialref.h"
#include <gdal_priv.h>
#include <gdal_utils.h>
#include <QDebug>

#include "gdalShapeFunctions.h"
#include "gdalRasterFunctions.h"

#include <ogrsf_frmts.h>
#include <gdal_utils.h>


bool gdalShapeToRaster(QString shapeFileName, QString shapeField, QString resolution,
QString mapProjection, QString outputName, QString paletteFileName,
Expand Down

0 comments on commit 0306f32

Please sign in to comment.