Skip to content

Commit

Permalink
Merge pull request #159 from naturalatlas/dep-updates
Browse files Browse the repository at this point in the history
Dep updates
  • Loading branch information
Dane Springmeyer committed Apr 6, 2016
2 parents b749f2c + 844489a commit a717d61
Show file tree
Hide file tree
Showing 199 changed files with 10,410 additions and 3,566 deletions.
3 changes: 2 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"msbuild_toolset":"<(toolset)",
"cflags_cc!": ["-fno-exceptions"],
"cflags!": ["-fno-exceptions"],
'defines!': ["_HAS_EXCEPTIONS=0"],
"defines": [
"NOGDI=1",
"HAVE_LIBZ"
Expand Down Expand Up @@ -79,4 +80,4 @@
}
}
}
}
}
28 changes: 28 additions & 0 deletions deps/glob-files.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
"""
collect files for gyp
workaround as "find" that comes with git on Windows seems to walk the whole directory
tree of the current drive (just sometimes)
argument "search pattern" according to
https://docs.python.org/2/library/glob.html
e.g.
"../src/*.cpp" => just look in "src" directory
"../src/*/*.cpp" => look in "src" directory and subdirectories
"""

import sys
import glob

if len(sys.argv) < 2:
print 'no argument'
sys.exit(1)

for f in glob.glob(sys.argv[1]):
# gyp needs either double backslashes (\\) or forward slashes (/) as path separator
# go with forward slashes to be platform independent
# as "print" outputs just single backslashes (\) on Windows
f = f.replace('\\', '/')
# use line feed as delimiter between file names to prevent problems with whitespaces in file names
print f
8 changes: 6 additions & 2 deletions deps/libexpat.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash

set -eu

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/libexpat"

EXPAT_VERSION=2.1.0
dir_expat=./expat

#
Expand All @@ -10,10 +14,10 @@ dir_expat=./expat

rm -rf $dir_expat
if [[ ! -f expat.tar.gz ]]; then
curl "http://softlayer-dal.dl.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz" -o expat.tar.gz
curl -L "https://fossies.org/linux/www/expat-${EXPAT_VERSION}.tar.gz" -o expat.tar.gz
fi
tar -xzf expat.tar.gz
mv expat-2.1.0 $dir_expat
mv expat-${EXPAT_VERSION} $dir_expat

rm -rf $dir_expat/win32
rm -rf $dir_expat/tests
Expand Down
110 changes: 0 additions & 110 deletions deps/libexpat/expat/expat.dsw

This file was deleted.

12 changes: 8 additions & 4 deletions deps/libgdal.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash

set -eu

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/libgdal"

GDAL_VERSION=2.0.2
dir_gdal=./gdal
dir_formats_gyp=./gyp-formats
dir_gyp_templates=./gyp-templates
Expand All @@ -12,10 +16,10 @@ dir_gyp_templates=./gyp-templates

rm -rf $dir_gdal
if [[ ! -f gdal.tar.gz ]]; then
curl http://download.osgeo.org/gdal/2.0.1/gdal-2.0.1.tar.gz -o gdal.tar.gz
curl -L http://download.osgeo.org/gdal/${GDAL_VERSION}/gdal-${GDAL_VERSION}.tar.gz -o gdal.tar.gz
fi
tar -xzf gdal.tar.gz
mv gdal-2.0.1 $dir_gdal
mv gdal-${GDAL_VERSION} $dir_gdal

rm -rf $dir_gdal/wince
rm -rf $dir_gdal/swig
Expand Down Expand Up @@ -99,7 +103,7 @@ GDAL_FORMATS="gtiff hfa aigrid aaigrid ceos ceos2 iso8211 xpm
coasp tsx terragen blx til r northwood saga xyz hf2
kmlsuperoverlay ctg e00grid zmap ngsgeoid iris map zlib
jpeg png
${OPT_GDAL_FORMATS}"
${OPT_GDAL_FORMATS:-}"

OGR_FORMATS="shape vrt avc geojson mem mitab kml gpx aeronavfaa
bna dxf csv edigeo geoconcept georss gml gmt gpsbabel gtm htf
Expand Down Expand Up @@ -146,7 +150,7 @@ format_gyp_template=`cat ${dir_gyp_templates}/libgdal_format.gyp`
function generate_formats() {
local formats="$1"
local directory="$2"
local prefix="$3"
local prefix="${3:-}"

for fmt in $formats; do
file_gyp="${dir_formats_gyp}/${prefix}${fmt}.gyp"
Expand Down
86 changes: 0 additions & 86 deletions deps/libgdal/gdal/.gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion deps/libgdal/gdal/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.1
2.0.2
44 changes: 34 additions & 10 deletions deps/libgdal/gdal/alg/gdalwarpoperation.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
* $Id: gdalwarpoperation.cpp 28876 2015-04-08 22:21:55Z rouault $
* $Id: gdalwarpoperation.cpp 31177 2015-10-28 12:43:31Z rouault $
*
* Project: High Performance Image Reprojector
* Purpose: Implementation of the GDALWarpOperation class.
Expand Down Expand Up @@ -33,7 +33,7 @@
#include "cpl_multiproc.h"
#include "ogr_api.h"

CPL_CVSID("$Id: gdalwarpoperation.cpp 28876 2015-04-08 22:21:55Z rouault $");
CPL_CVSID("$Id: gdalwarpoperation.cpp 31177 2015-10-28 12:43:31Z rouault $");

struct _GDALWarpChunk {
int dx, dy, dsx, dsy;
Expand Down Expand Up @@ -2283,6 +2283,30 @@ CPLErr GDALWarpOperation::ComputeSourceWindow(int nDstXOff, int nDstYOff,
"GDALWarpOperation::ComputeSourceWindow() %d out of %d points failed to transform.",
nFailedCount, nSamplePoints );

/* -------------------------------------------------------------------- */
/* Early exit to avoid crazy values to cause a huge nResWinSize that */
/* would result in a result window wrongly covering the whole raster. */
/* -------------------------------------------------------------------- */
const int nRasterXSize = GDALGetRasterXSize(psOptions->hSrcDS);
const int nRasterYSize = GDALGetRasterYSize(psOptions->hSrcDS);
if( dfMinXOut > nRasterXSize ||
dfMaxXOut < 0 ||
dfMinYOut > nRasterYSize ||
dfMaxYOut < 0 )
{
*pnSrcXOff = 0;
*pnSrcYOff = 0;
*pnSrcXSize = 0;
*pnSrcYSize = 0;
if( pnSrcXExtraSize )
*pnSrcXExtraSize = 0;
if( pnSrcYExtraSize )
*pnSrcYExtraSize = 0;
if( pdfSrcFillRatio )
*pdfSrcFillRatio = 0;
return CE_None;
}

/* -------------------------------------------------------------------- */
/* How much of a window around our source pixel might we need */
/* to collect data from based on the resampling kernel? Even */
Expand Down Expand Up @@ -2325,8 +2349,8 @@ CPLErr GDALWarpOperation::ComputeSourceWindow(int nDstXOff, int nDstYOff,
*/
*pnSrcXOff = MAX(0,(int) floor( dfMinXOut ) );
*pnSrcYOff = MAX(0,(int) floor( dfMinYOut ) );
*pnSrcXOff = MIN(*pnSrcXOff,GDALGetRasterXSize(psOptions->hSrcDS));
*pnSrcYOff = MIN(*pnSrcYOff,GDALGetRasterYSize(psOptions->hSrcDS));
*pnSrcXOff = MIN(*pnSrcXOff,nRasterXSize);
*pnSrcYOff = MIN(*pnSrcYOff,nRasterYSize);

double dfCeilMaxXOut = ceil(dfMaxXOut);
if( dfCeilMaxXOut > INT_MAX )
Expand All @@ -2335,21 +2359,21 @@ CPLErr GDALWarpOperation::ComputeSourceWindow(int nDstXOff, int nDstYOff,
if( dfCeilMaxYOut > INT_MAX )
dfCeilMaxYOut = INT_MAX;

int nSrcXSizeRaw = MIN( GDALGetRasterXSize(psOptions->hSrcDS) - *pnSrcXOff,
int nSrcXSizeRaw = MIN( nRasterXSize - *pnSrcXOff,
((int) dfCeilMaxXOut) - *pnSrcXOff );
int nSrcYSizeRaw = MIN( GDALGetRasterYSize(psOptions->hSrcDS) - *pnSrcYOff,
int nSrcYSizeRaw = MIN( nRasterYSize - *pnSrcYOff,
((int) dfCeilMaxYOut) - *pnSrcYOff );
nSrcXSizeRaw = MAX(0,nSrcXSizeRaw);
nSrcYSizeRaw = MAX(0,nSrcYSizeRaw);

*pnSrcXOff = MAX(0,(int) floor( dfMinXOut ) - nResWinSize );
*pnSrcYOff = MAX(0,(int) floor( dfMinYOut ) - nResWinSize );
*pnSrcXOff = MIN(*pnSrcXOff,GDALGetRasterXSize(psOptions->hSrcDS));
*pnSrcYOff = MIN(*pnSrcYOff,GDALGetRasterYSize(psOptions->hSrcDS));
*pnSrcXOff = MIN(*pnSrcXOff,nRasterXSize);
*pnSrcYOff = MIN(*pnSrcYOff,nRasterYSize);

*pnSrcXSize = MIN( GDALGetRasterXSize(psOptions->hSrcDS) - *pnSrcXOff,
*pnSrcXSize = MIN( nRasterXSize - *pnSrcXOff,
((int) dfCeilMaxXOut) - *pnSrcXOff + nResWinSize );
*pnSrcYSize = MIN( GDALGetRasterYSize(psOptions->hSrcDS) - *pnSrcYOff,
*pnSrcYSize = MIN( nRasterYSize - *pnSrcYOff,
((int) dfCeilMaxYOut) - *pnSrcYOff + nResWinSize );
*pnSrcXSize = MAX(0,*pnSrcXSize);
*pnSrcYSize = MAX(0,*pnSrcYSize);
Expand Down
Loading

0 comments on commit a717d61

Please sign in to comment.