Skip to content
Permalink
Browse files

fix build on osx

  • Loading branch information
slarosa committed Jul 16, 2018
1 parent f9fc708 commit 5a36a33befacd0980befb018d1369885939c3d12
Showing with 23 additions and 23 deletions.
  1. +18 −18 external/mdal/frmts/mdal_gdal.cpp
  2. +5 −5 external/mdal/frmts/mdal_gdal.hpp
@@ -29,15 +29,15 @@ void MDAL::GdalDataset::init( const std::string &dsName )

void MDAL::GdalDataset::parseParameters()
{
mNBands = static_cast<uint>( GDALGetRasterCount( mHDataset ) );
mNBands = static_cast<unsigned int>( GDALGetRasterCount( mHDataset ) );
if ( mNBands == 0 ) throw MDAL_Status::Err_InvalidData;

GDALGetGeoTransform( mHDataset, mGT ); // in case of error it returns Identid

mXSize = static_cast<uint>( GDALGetRasterXSize( mHDataset ) ); //raster width in pixels
mXSize = static_cast<unsigned int>( GDALGetRasterXSize( mHDataset ) ); //raster width in pixels
if ( mXSize == 0 ) throw MDAL_Status::Err_InvalidData;

mYSize = static_cast<uint>( GDALGetRasterYSize( mHDataset ) ); //raster height in pixels
mYSize = static_cast<unsigned int>( GDALGetRasterYSize( mHDataset ) ); //raster height in pixels
if ( mYSize == 0 ) throw MDAL_Status::Err_InvalidData;

mNPoints = mXSize * mYSize;
@@ -72,13 +72,13 @@ bool MDAL::LoaderGdal::meshes_equals( const MDAL::GdalDataset *ds1, const MDAL::
bool MDAL::LoaderGdal::initVertices( Vertices &vertices )
{
Vertex *VertexsPtr = vertices.data();
uint mXSize = meshGDALDataset()->mXSize;
uint mYSize = meshGDALDataset()->mYSize;
unsigned int mXSize = meshGDALDataset()->mXSize;
unsigned int mYSize = meshGDALDataset()->mYSize;
const double *mGT = meshGDALDataset()->mGT;

for ( uint y = 0; y < mYSize; ++y )
for ( unsigned int y = 0; y < mYSize; ++y )
{
for ( uint x = 0; x < mXSize; ++x, ++VertexsPtr )
for ( unsigned int x = 0; x < mXSize; ++x, ++VertexsPtr )
{
// VertexsPtr->setId(x + mXSize*y);
VertexsPtr->x = mGT[0] + ( x + 0.5 ) * mGT[1] + ( y + 0.5 ) * mGT[2];
@@ -111,14 +111,14 @@ bool MDAL::LoaderGdal::initVertices( Vertices &vertices )
void MDAL::LoaderGdal::initFaces( Vertices &Vertexs, Faces &Faces, bool is_longitude_shifted )
{
int reconnected = 0;
uint mXSize = meshGDALDataset()->mXSize;
uint mYSize = meshGDALDataset()->mYSize;
unsigned int mXSize = meshGDALDataset()->mXSize;
unsigned int mYSize = meshGDALDataset()->mYSize;

size_t i = 0;

for ( uint y = 0; y < mYSize - 1; ++y )
for ( unsigned int y = 0; y < mYSize - 1; ++y )
{
for ( uint x = 0; x < mXSize - 1; ++x )
for ( unsigned int x = 0; x < mXSize - 1; ++x )
{
if ( is_longitude_shifted &&
( Vertexs[x + mXSize * y].x > 0.0 ) &&
@@ -195,7 +195,7 @@ MDAL::LoaderGdal::metadata_hash MDAL::LoaderGdal::parseMetadata( GDALMajorObject

void MDAL::LoaderGdal::parseRasterBands( const MDAL::GdalDataset *cfGDALDataset )
{
for ( uint i = 1; i <= cfGDALDataset->mNBands; ++i ) // starts with 1 .... ehm....
for ( unsigned int i = 1; i <= cfGDALDataset->mNBands; ++i ) // starts with 1 .... ehm....
{
// Get Band
GDALRasterBandH gdalBand = GDALGetRasterBand( cfGDALDataset->mHDataset, static_cast<int>( i ) );
@@ -262,10 +262,10 @@ void MDAL::LoaderGdal::addDataToOutput( GDALRasterBandH raster_band, std::shared
assert( raster_band );

double nodata = GDALGetRasterNoDataValue( raster_band, nullptr );
uint mXSize = meshGDALDataset()->mXSize;
uint mYSize = meshGDALDataset()->mYSize;
unsigned int mXSize = meshGDALDataset()->mXSize;
unsigned int mYSize = meshGDALDataset()->mYSize;

for ( uint y = 0; y < mYSize; ++y )
for ( unsigned int y = 0; y < mYSize; ++y )
{
// buffering per-line
CPLErr err = GDALRasterIO(
@@ -287,9 +287,9 @@ void MDAL::LoaderGdal::addDataToOutput( GDALRasterBandH raster_band, std::shared
throw MDAL_Status::Err_InvalidData;
}

for ( uint x = 0; x < mXSize; ++x )
for ( unsigned int x = 0; x < mXSize; ++x )
{
uint idx = x + mXSize * y;
unsigned int idx = x + mXSize * y;
double val = mPafScanline[x];
bool noData = false;
if ( MDAL::equals( val, nodata ) )
@@ -324,7 +324,7 @@ void MDAL::LoaderGdal::addDataToOutput( GDALRasterBandH raster_band, std::shared
void MDAL::LoaderGdal::activateFaces( std::shared_ptr<Dataset> tos )
{
// Activate only Faces that do all Vertex's outputs with some data
for ( uint idx = 0; idx < meshGDALDataset()->mNVolumes; ++idx )
for ( unsigned int idx = 0; idx < meshGDALDataset()->mNVolumes; ++idx )
{
Face elem = mMesh->faces.at( idx );

@@ -35,11 +35,11 @@ namespace MDAL
std::string mProj;
GDALDatasetH mHDataset;

uint mNBands; /* number of bands */
uint mXSize; /* number of x pixels */
uint mYSize; /* number of y pixels */
uint mNPoints; /* nodes count */
uint mNVolumes; /* Faces count */
unsigned int mNBands; /* number of bands */
unsigned int mXSize; /* number of x pixels */
unsigned int mYSize; /* number of y pixels */
unsigned int mNPoints; /* nodes count */
unsigned int mNVolumes; /* Faces count */
double mGT[6]; /* affine transform matrix */

private:

0 comments on commit 5a36a33

Please sign in to comment.
You can’t perform that action at this time.