Skip to content

Commit

Permalink
Merge branch 'OSGeo:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
a0x8o authored Nov 11, 2024
2 parents 41224b9 + 6b9549e commit 57a49a1
Show file tree
Hide file tree
Showing 132 changed files with 15,908 additions and 1,746 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/android_cmake/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ PKG_CONFIG_LIBDIR=/tmp/install/lib/pkgconfig cmake .. \
-DSFCGAL_CONFIG=disabled \
-DHDF5_C_COMPILER_EXECUTABLE=disabled \
-DHDF5_CXX_COMPILER_EXECUTABLE=disabled

echo "Check that GDAL_ENABLE_ARM_NEON_OPTIMIZATIONS:BOOL=ON"
(grep "GDAL_ENABLE_ARM_NEON_OPTIMIZATIONS:BOOL=ON" CMakeCache.txt > /dev/null && echo "yes") || (echo "Missing" && /bin/false)

make -j$(nproc)
make install
cd ..
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ jobs:
- name: Setup xcode
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: 14.3
xcode-version: '15.4.0'
- name: Checkout GDAL
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Setup cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ Supported Formats: (ro:read-only, rw:read-write, +:update, v:virtual-I/O s:subda
TIGER -vector- (rov): U.S. Census TIGER/Line
AVCBin -vector- (rov): Arc/Info Binary Coverage
AVCE00 -vector- (rov): Arc/Info E00 (ASCII) Coverage (*.e00)
AIVector -vector- (ro): Artificial Intelligence powered vector driver
HTTP -raster,vector- (ro): HTTP Fetching Wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ Supported Formats: (ro:read-only, rw:read-write, +:update, v:virtual-I/O s:subda
TIGER -vector- (rov): U.S. Census TIGER/Line
AVCBin -vector- (rov): Arc/Info Binary Coverage
AVCE00 -vector- (rov): Arc/Info E00 (ASCII) Coverage (*.e00)
AIVector -vector- (ro): Artificial Intelligence powered vector driver
HTTP -raster,vector- (ro): HTTP Fetching Wrapper
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ repos:
frmts/pcidsk/sdk|
frmts/grib/degrib/degrib|
frmts/grib/degrib/g2clib|
gcore/sse2neon.h|
port/utf8.h|
ogr/ogrsf_frmts/adbc/ogr_adbc_internal.h|
ogr/ogrsf_frmts/cad/libopencad/|
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: Please cite this software using these metadata or in the CITATION file.
type: software
title: GDAL
version: 3.8.3
date-released: 2024-01-02
version: 3.10.0
date-released: 2024-11-01
doi: 10.5281/zenodo.5884351
abstract: GDAL is a translator library for raster and vector geospatial data
formats that is released under an MIT style Open Source License by the Open
Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86|AMD64)")
endif ()
endif ()

else()

# Check ability to use Arm Neon optimizations
include(CheckCXXSourceCompiles)
include(CMakePushCheckState)
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/gcore")
check_cxx_source_compiles("#include \"include_sse2neon.h\"\nint main() { return 0; }" SSE2NEON_COMPILES)
cmake_pop_check_state()

endif ()
#
option(CLANG_TIDY_ENABLED "Run clang-tidy with the compiler." OFF)
Expand Down
4 changes: 3 additions & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,9 @@ RECURSIVE = NO
# subdirectory from a directory tree whose root is specified with the INPUT tag.

EXCLUDE = gcore/rawdataset.cpp \
gcore/rawdataset.h
gcore/rawdataset.h \
gcore/include_sse2neon.h \
gcore/sse2neon.h

# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
Expand Down
7 changes: 7 additions & 0 deletions HOWTO-RELEASE
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,10 @@ or your message manually approved, with an administrator of the list.

23) For bugfixes releases, forward port to master changes done in
doc/source/about_no_title.rst, doc/source/download.rst and doc/source/download_past.rst

24) For a feature release, enable a new version in the ReadTheDocs administration panel.
a) Go to https://readthedocs.org/projects/gdal/versions/
b) In the "Activate a version" tab, enter "release/X.Y" in the text entry and click on the Filter button
c) Click on the Activate button
d) Go to https://readthedocs.org/projects/gdal/, and in the "Compile a version" drop-down list,
select the newt "release-X.Y" label and click on the "Compile a version" button
2 changes: 1 addition & 1 deletion apps/argparse/argparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ class ArgumentParser {
std::stringstream stream;

std::string curline("Usage: ");
curline += this->m_program_name;
curline += this->m_parser_path;
const bool multiline_usage =
this->m_usage_max_line_width < std::numeric_limits<std::size_t>::max();
const size_t indent_size = curline.size();
Expand Down
2 changes: 1 addition & 1 deletion apps/gdalargumentparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ GDALArgumentParser::GDALArgumentParser(const std::string &program_name,
[this](const auto &)
{
std::cout << usage() << std::endl << std::endl;
std::cout << _("Note: ") << m_program_name
std::cout << _("Note: ") << m_parser_path
<< _(" --long-usage for full help.") << std::endl;
std::exit(0);
})
Expand Down
1 change: 1 addition & 0 deletions autotest/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ add_executable(
test_gdal_aaigrid.cpp
test_gdal_dted.cpp
test_gdal_gtiff.cpp
test_gdal_minmax_element.cpp
test_gdal_pixelfn.cpp
test_gdal_typetraits.cpp
test_ogr.cpp
Expand Down
6 changes: 3 additions & 3 deletions autotest/cpp/googletest/CMakeLists.txt.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Source https://github.com/google/googletest/blob/master/googletest/README.md
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.16)

project(googletest-download NONE)

Expand All @@ -10,8 +10,8 @@ endif()

include(ExternalProject)
ExternalProject_Add(googletest
URL https://github.com/google/googletest/archive/release-1.12.1.zip
URL_HASH SHA1=973e464e8936d4b79bb24f27b058aaef4150b06e
URL https://github.com/google/googletest/releases/download/v1.15.2/googletest-1.15.2.tar.gz
URL_HASH SHA1=568d58e26bd4e838449ca7ab8ebc152b3cbd210d
DOWNLOAD_NO_PROGRESS ON
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
Expand Down
139 changes: 139 additions & 0 deletions autotest/cpp/test_gdal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4777,4 +4777,143 @@ TEST_F(test_gdal, ReadRaster)
}
}

// Test GDALComputeRasterMinMaxLocation
TEST_F(test_gdal, GDALComputeRasterMinMaxLocation)
{
GDALDatasetH hDS = GDALOpen(GCORE_DATA_DIR "byte.tif", GA_ReadOnly);
ASSERT_NE(hDS, nullptr);
GDALRasterBandH hBand = GDALGetRasterBand(hDS, 1);
{
double dfMin = 0;
double dfMax = 0;
int nMinX = -1;
int nMinY = -1;
int nMaxX = -1;
int nMaxY = -1;
EXPECT_EQ(GDALComputeRasterMinMaxLocation(hBand, &dfMin, &dfMax, &nMinX,
&nMinY, &nMaxX, &nMaxY),
CE_None);
EXPECT_EQ(dfMin, 74.0);
EXPECT_EQ(dfMax, 255.0);
EXPECT_EQ(nMinX, 9);
EXPECT_EQ(nMinY, 17);
EXPECT_EQ(nMaxX, 2);
EXPECT_EQ(nMaxY, 18);
GByte val = 0;
EXPECT_EQ(GDALRasterIO(hBand, GF_Read, nMinX, nMinY, 1, 1, &val, 1, 1,
GDT_Byte, 0, 0),
CE_None);
EXPECT_EQ(val, 74);
EXPECT_EQ(GDALRasterIO(hBand, GF_Read, nMaxX, nMaxY, 1, 1, &val, 1, 1,
GDT_Byte, 0, 0),
CE_None);
EXPECT_EQ(val, 255);
}
{
int nMinX = -1;
int nMinY = -1;
EXPECT_EQ(GDALComputeRasterMinMaxLocation(hBand, nullptr, nullptr,
&nMinX, &nMinY, nullptr,
nullptr),
CE_None);
EXPECT_EQ(nMinX, 9);
EXPECT_EQ(nMinY, 17);
}
{
int nMaxX = -1;
int nMaxY = -1;
EXPECT_EQ(GDALComputeRasterMinMaxLocation(hBand, nullptr, nullptr,
nullptr, nullptr, &nMaxX,
&nMaxY),
CE_None);
EXPECT_EQ(nMaxX, 2);
EXPECT_EQ(nMaxY, 18);
}
{
EXPECT_EQ(GDALComputeRasterMinMaxLocation(hBand, nullptr, nullptr,
nullptr, nullptr, nullptr,
nullptr),
CE_None);
}
GDALClose(hDS);
}

// Test GDALComputeRasterMinMaxLocation
TEST_F(test_gdal, GDALComputeRasterMinMaxLocation_byte_min_max_optim)
{
GDALDatasetUniquePtr poDS(GDALDriver::FromHandle(GDALGetDriverByName("MEM"))
->Create("", 1, 4, 1, GDT_Byte, nullptr));
std::array<uint8_t, 4> buffer = {
1, //////////////////////////////////////////////////////////
0, //////////////////////////////////////////////////////////
255, //////////////////////////////////////////////////////////
1, //////////////////////////////////////////////////////////
};
GDALRasterIOExtraArg sExtraArg;
INIT_RASTERIO_EXTRA_ARG(sExtraArg);
EXPECT_EQ(poDS->GetRasterBand(1)->RasterIO(
GF_Write, 0, 0, 1, 4, buffer.data(), 1, 4, GDT_Byte,
sizeof(uint8_t), 1 * sizeof(uint8_t), &sExtraArg),
CE_None);

double dfMin = 0;
double dfMax = 0;
int nMinX = -1;
int nMinY = -1;
int nMaxX = -1;
int nMaxY = -1;
EXPECT_EQ(poDS->GetRasterBand(1)->ComputeRasterMinMaxLocation(
&dfMin, &dfMax, &nMinX, &nMinY, &nMaxX, &nMaxY),
CE_None);
EXPECT_EQ(dfMin, 0);
EXPECT_EQ(dfMax, 255);
EXPECT_EQ(nMinX, 0);
EXPECT_EQ(nMinY, 1);
EXPECT_EQ(nMaxX, 0);
EXPECT_EQ(nMaxY, 2);
}

// Test GDALComputeRasterMinMaxLocation
TEST_F(test_gdal, GDALComputeRasterMinMaxLocation_with_mask)
{
GDALDatasetUniquePtr poDS(GDALDriver::FromHandle(GDALGetDriverByName("MEM"))
->Create("", 2, 2, 1, GDT_Byte, nullptr));
std::array<uint8_t, 6> buffer = {
2, 10, //////////////////////////////////////////////////////////
4, 20, //////////////////////////////////////////////////////////
};
GDALRasterIOExtraArg sExtraArg;
INIT_RASTERIO_EXTRA_ARG(sExtraArg);
EXPECT_EQ(poDS->GetRasterBand(1)->RasterIO(
GF_Write, 0, 0, 2, 2, buffer.data(), 2, 2, GDT_Byte,
sizeof(uint8_t), 2 * sizeof(uint8_t), &sExtraArg),
CE_None);

poDS->GetRasterBand(1)->CreateMaskBand(0);
std::array<uint8_t, 6> buffer_mask = {
0, 255, //////////////////////////////////////////////////////////
255, 0, //////////////////////////////////////////////////////////
};
EXPECT_EQ(poDS->GetRasterBand(1)->GetMaskBand()->RasterIO(
GF_Write, 0, 0, 2, 2, buffer_mask.data(), 2, 2, GDT_Byte,
sizeof(uint8_t), 2 * sizeof(uint8_t), &sExtraArg),
CE_None);

double dfMin = 0;
double dfMax = 0;
int nMinX = -1;
int nMinY = -1;
int nMaxX = -1;
int nMaxY = -1;
EXPECT_EQ(poDS->GetRasterBand(1)->ComputeRasterMinMaxLocation(
&dfMin, &dfMax, &nMinX, &nMinY, &nMaxX, &nMaxY),
CE_None);
EXPECT_EQ(dfMin, 4);
EXPECT_EQ(dfMax, 10);
EXPECT_EQ(nMinX, 0);
EXPECT_EQ(nMinY, 1);
EXPECT_EQ(nMaxX, 1);
EXPECT_EQ(nMaxY, 0);
}

} // namespace
Loading

0 comments on commit 57a49a1

Please sign in to comment.