mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-03 00:04:47 -04:00
Compare commits
14 Commits
901cc0e98a
...
dd89ba5fbf
Author | SHA1 | Date | |
---|---|---|---|
|
dd89ba5fbf | ||
|
1fc67c6009 | ||
|
070c13e4ab | ||
|
01c86da6a4 | ||
|
6a3cd87737 | ||
|
4cab2daf50 | ||
|
33cba935d2 | ||
|
62830e0412 | ||
|
b046379b51 | ||
|
086dd9bc36 | ||
|
dd856e8cb0 | ||
|
b21b0bcd4c | ||
|
2a2ba2b6df | ||
|
360d025063 |
@ -451,6 +451,9 @@ if(WITH_CORE)
|
||||
message(STATUS "Found GDAL: ${GDAL_VERSION} ${GDAL_DIR}")
|
||||
find_package(EXPAT REQUIRED)
|
||||
find_package(Spatialindex REQUIRED)
|
||||
if(SPATIALINDEX_VERSION VERSION_GREATER_EQUAL "2.1")
|
||||
message(FATAL_ERROR "Cannot build QGIS using libspatialindex >= 2.1, see https://github.com/libspatialindex/libspatialindex/issues/276")
|
||||
endif()
|
||||
find_package(LibZip REQUIRED)
|
||||
set (WITH_INTERNAL_NLOHMANN_JSON ${PREFER_INTERNAL_LIBS} CACHE BOOL "Determines whether the vendored copy of nlohmann-json should be used")
|
||||
find_package(nlohmann_json REQUIRED)
|
||||
|
@ -8,7 +8,7 @@
|
||||
# SPATIALINDEX_FOUND = system has Spatialindex lib
|
||||
# SPATIALINDEX_LIBRARY = full path to the Spatialindex library
|
||||
# SPATIALINDEX_INCLUDE_DIR = where to find headers
|
||||
#
|
||||
# SPATIALINDEX_VERSION = version number
|
||||
|
||||
|
||||
FIND_PATH(SPATIALINDEX_INCLUDE_DIR spatialindex/SpatialIndex.h PATHS
|
||||
@ -32,8 +32,21 @@ IF (SPATIALINDEX_INCLUDE_DIR AND SPATIALINDEX_LIBRARY)
|
||||
ENDIF (SPATIALINDEX_INCLUDE_DIR AND SPATIALINDEX_LIBRARY)
|
||||
|
||||
IF (SPATIALINDEX_FOUND)
|
||||
set(spatialindex_version_file
|
||||
"${SPATIALINDEX_INCLUDE_DIR}/spatialindex/Version.h")
|
||||
file(STRINGS "${spatialindex_version_file}" spatialindex_version_major REGEX "#define SIDX_VERSION_MAJOR")
|
||||
list(GET spatialindex_version_major 0 spatialindex_version_major)
|
||||
string(REGEX MATCH "[0-9]+" SPATIALINDEX_VERSION_MAJOR ${spatialindex_version_major} )
|
||||
file(STRINGS "${spatialindex_version_file}" spatialindex_version_minor REGEX "#define SIDX_VERSION_MINOR")
|
||||
list(GET spatialindex_version_minor 0 spatialindex_version_minor)
|
||||
string(REGEX MATCH "[0-9]+" SPATIALINDEX_VERSION_MINOR ${spatialindex_version_minor} )
|
||||
file(STRINGS "${spatialindex_version_file}" spatialindex_version_rev REGEX "#define SIDX_VERSION_REV")
|
||||
list(GET spatialindex_version_rev 0 spatialindex_version_rev)
|
||||
string(REGEX MATCH "[0-9]+" SPATIALINDEX_VERSION_REV ${spatialindex_version_rev} )
|
||||
set(SPATIALINDEX_VERSION "${SPATIALINDEX_VERSION_MAJOR}.${SPATIALINDEX_VERSION_MINOR}.${SPATIALINDEX_VERSION_REV}")
|
||||
|
||||
IF (NOT SPATIALINDEX_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Spatialindex: ${SPATIALINDEX_LIBRARY}")
|
||||
MESSAGE(STATUS "Found Spatialindex: ${SPATIALINDEX_LIBRARY} (${SPATIALINDEX_VERSION})")
|
||||
ENDIF (NOT SPATIALINDEX_FIND_QUIETLY)
|
||||
ELSE (SPATIALINDEX_FOUND)
|
||||
IF (SPATIALINDEX_FIND_REQUIRED)
|
||||
|
@ -266,6 +266,19 @@ class merge(GdalAlgorithm):
|
||||
arguments.append(list_file)
|
||||
|
||||
return [
|
||||
self.commandName() + (".bat" if isWindows() else ".py"),
|
||||
self.commandName() + merge.command_ext(),
|
||||
GdalUtils.escapeAndJoin(arguments),
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
def command_ext() -> str:
|
||||
"""
|
||||
Returns the gdal_merge command extension
|
||||
"""
|
||||
if isWindows():
|
||||
return ".bat"
|
||||
|
||||
if GdalUtils.version() < 3090000:
|
||||
return ".py"
|
||||
|
||||
return ""
|
||||
|
@ -4556,6 +4556,8 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
alg = merge()
|
||||
alg.initAlgorithm()
|
||||
|
||||
merge_command = alg.commandName() + alg.command_ext()
|
||||
|
||||
with tempfile.TemporaryDirectory() as outdir:
|
||||
# this algorithm creates temporary text file with input layers
|
||||
# so we strip its path, leaving only filename
|
||||
@ -4567,7 +4569,7 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
self.assertEqual(
|
||||
cmd,
|
||||
[
|
||||
"gdal_merge.py",
|
||||
merge_command,
|
||||
"-ot Float32 -of GTiff "
|
||||
+ "-o "
|
||||
+ outdir
|
||||
@ -4586,7 +4588,7 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
self.assertEqual(
|
||||
cmd,
|
||||
[
|
||||
"gdal_merge.py",
|
||||
merge_command,
|
||||
"-separate -ot Float32 -of GTiff "
|
||||
+ "-o "
|
||||
+ outdir
|
||||
@ -4610,7 +4612,7 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
self.assertEqual(
|
||||
cmd,
|
||||
[
|
||||
"gdal_merge.py",
|
||||
merge_command,
|
||||
"-ot Float32 -of GTiff -tap -ps 0.1 0.1 "
|
||||
+ "-o "
|
||||
+ outdir
|
||||
@ -4634,7 +4636,7 @@ class TestGdalRasterAlgorithms(QgisTestCase, AlgorithmsTestBase.AlgorithmsTest):
|
||||
self.assertEqual(
|
||||
cmd,
|
||||
[
|
||||
"gdal_merge.py",
|
||||
merge_command,
|
||||
"-a_nodata -9999.0 -ot Float32 -of GTiff "
|
||||
+ "-o "
|
||||
+ outdir
|
||||
|
@ -41,7 +41,7 @@ def userFolder():
|
||||
|
||||
|
||||
def defaultOutputFolder():
|
||||
folder = os.path.join(userFolder(), "outputs")
|
||||
folder = os.path.join(QDir.homePath(), "processing")
|
||||
if not QDir(folder).exists():
|
||||
QDir().mkpath(folder)
|
||||
|
||||
|
@ -988,6 +988,11 @@ QTreeView::item:selected, QTreeView::branch:selected {
|
||||
color: @text;
|
||||
}
|
||||
|
||||
QTreeView::item:selected:disabled, QTreeView::branch:selected:disabled {
|
||||
background-color: @itemalternativebackground;
|
||||
color: @background;
|
||||
}
|
||||
|
||||
QTreeView::branch:has-children:!has-siblings:closed,
|
||||
QTreeView::branch:closed:has-children:has-siblings {
|
||||
border-image: none;
|
||||
|
@ -1019,6 +1019,11 @@ QTreeView::item:selected, QTreeView::branch:selected {
|
||||
color: @textlight;
|
||||
}
|
||||
|
||||
QTreeView::item:selected:disabled, QTreeView::branch:selected:disabled {
|
||||
background-color: @itemdarkbackground;
|
||||
color: @background;
|
||||
}
|
||||
|
||||
QTreeView::branch:has-children:!has-siblings:closed,
|
||||
QTreeView::branch:closed:has-children:has-siblings {
|
||||
border-image: none;
|
||||
|
@ -77,16 +77,16 @@ class QgsGenericSpatialIndex
|
||||
catch ( Tools::Exception &e )
|
||||
{
|
||||
Q_UNUSED( e )
|
||||
QgsDebugError( QStringLiteral( "Tools::Exception caught: " ).arg( e.what().c_str() ) );
|
||||
QgsDebugError( QStringLiteral( "Tools::Exception caught when inserting data to QgsGenericSpatialIndex: %1" ).arg( e.what().c_str() ) );
|
||||
}
|
||||
catch ( const std::exception &e )
|
||||
{
|
||||
Q_UNUSED( e )
|
||||
QgsDebugError( QStringLiteral( "std::exception caught: " ).arg( e.what() ) );
|
||||
QgsDebugError( QStringLiteral( "std::exception caught when inserting data to QgsGenericSpatialIndex: %1" ).arg( e.what() ) );
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
QgsDebugError( QStringLiteral( "unknown spatial index exception caught" ) );
|
||||
QgsDebugError( QStringLiteral( "unknown spatial index exception caught when inserting data to QgsGenericSpatialIndex" ) );
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -126,7 +126,25 @@ class QgsGenericSpatialIndex
|
||||
const SpatialIndex::Region r = QgsSpatialIndexUtils::rectangleToRegion( bounds );
|
||||
|
||||
const QMutexLocker locker( &mMutex );
|
||||
try
|
||||
{
|
||||
mRTree->intersectsWithQuery( r, visitor );
|
||||
}
|
||||
catch ( Tools::Exception &e )
|
||||
{
|
||||
Q_UNUSED( e )
|
||||
QgsDebugError( QStringLiteral( "Tools::Exception caught in QgsGenericSpatialIndex::intersects: %1" ).arg( e.what().c_str() ) );
|
||||
}
|
||||
catch ( const std::exception &e )
|
||||
{
|
||||
Q_UNUSED( e )
|
||||
QgsDebugError( QStringLiteral( "std::exception caught in QgsGenericSpatialIndex::intersects: %1" ).arg( e.what() ) );
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
QgsDebugError( QStringLiteral( "unknown spatial index exception caught in QgsGenericSpatialIndex::intersects" ) );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -457,16 +457,16 @@ bool QgsSpatialIndex::addFeature( QgsFeatureId id, const QgsRectangle &bounds )
|
||||
catch ( Tools::Exception &e )
|
||||
{
|
||||
Q_UNUSED( e )
|
||||
QgsDebugError( QStringLiteral( "Tools::Exception caught: " ).arg( e.what().c_str() ) );
|
||||
QgsDebugError( QStringLiteral( "Tools::Exception caught when adding feature to QgsSpatialIndex: %1" ).arg( e.what().c_str() ) );
|
||||
}
|
||||
catch ( const std::exception &e )
|
||||
{
|
||||
Q_UNUSED( e )
|
||||
QgsDebugError( QStringLiteral( "std::exception caught: " ).arg( e.what() ) );
|
||||
QgsDebugError( QStringLiteral( "std::exception caught when adding feature to QgsSpatialIndex: %1" ).arg( e.what() ) );
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
QgsDebugError( QStringLiteral( "unknown spatial index exception caught" ) );
|
||||
QgsDebugError( QStringLiteral( "unknown spatial index exception caught when adding feature to QgsSpatialIndex" ) );
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "qgsprocessingcontext.h"
|
||||
#include "qgsprocessingalgorithm.h"
|
||||
#include "qgsfieldmappingwidget.h"
|
||||
#include "qgsapplication.h"
|
||||
#include <QMenu>
|
||||
#include <QFileDialog>
|
||||
#include <QInputDialog>
|
||||
@ -175,7 +176,7 @@ QVariant QgsProcessingLayerOutputDestinationWidget::value() const
|
||||
if ( folder == '.' )
|
||||
{
|
||||
// output name does not include a folder - use default
|
||||
QString defaultFolder = settings.value( QStringLiteral( "/Processing/Configuration/OUTPUTS_FOLDER" ) ).toString();
|
||||
QString defaultFolder = settings.value( QStringLiteral( "/Processing/Configuration/OUTPUTS_FOLDER" ), QStringLiteral( "%1/processing" ).arg( QDir::homePath() ) ).toString();
|
||||
key = QDir( defaultFolder ).filePath( key );
|
||||
}
|
||||
}
|
||||
|
26
vcpkg/ports/libspatialindex/portfile.cmake
Normal file
26
vcpkg/ports/libspatialindex/portfile.cmake
Normal file
@ -0,0 +1,26 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO libspatialindex/libspatialindex
|
||||
REF "${VERSION}"
|
||||
SHA512 a508a9ed4019641bdaaa53533505531f3db440b046a9c7d9f78ed480293200c51796c2d826a6bb9b4f9543d60bb0fef9e4c885ec3f09326cfa4d2fb81c1593aa
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
WINDOWS_USE_MSBUILD
|
||||
OPTIONS
|
||||
-DCMAKE_DEBUG_POSTFIX=d
|
||||
-DSIDX_BUILD_TESTS:BOOL=OFF
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
#Debug
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
18
vcpkg/ports/libspatialindex/vcpkg.json
Normal file
18
vcpkg/ports/libspatialindex/vcpkg.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "libspatialindex",
|
||||
"version": "2.0.0",
|
||||
"description": "C++ implementation of R*-tree, an MVR-tree and a TPR-tree with C API.",
|
||||
"homepage": "http://libspatialindex.github.com",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"zlib"
|
||||
]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user