Skip to content

Commit

Permalink
Geometry class moved to infra
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Apr 23, 2024
1 parent e2ef4c7 commit fedb833
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 262 deletions.
5 changes: 0 additions & 5 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
# BasedOnStyle: LLVM
AccessModifierOffset: -4
ConstructorInitializerIndentWidth: 0
AlignAfterOpenBracket: Align
AlignEscapedNewlines: Left
AlignOperands: true
Expand Down Expand Up @@ -64,10 +63,6 @@ IndentWidth: 4
TabWidth: 4
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
SortIncludes: true
Expand Down
2 changes: 1 addition & 1 deletion deps/geodynamix
Submodule geodynamix updated 60 files
+0 −5 .clang-format
+10 −6 .github/workflows/conda-build.yml
+81 −65 CMakeLists.txt
+8 −0 Changelog.txt
+2 −2 README.md
+23 −5 algorithms/CMakeLists.txt
+0 −18 algorithms/include/gdx/algo/distance.h
+2 −1 algorithms/include/gdx/algo/distancedecay.h
+1 −1 algorithms/include/gdx/algo/distribute.h
+47 −35 algorithms/include/gdx/algo/filter.h
+9 −1 algorithms/include/gdx/algo/masking.h
+14 −0 algorithms/include/gdx/algo/mathoperations.h
+90 −0 algorithms/include/gdx/algo/polygoncoverage.h
+68 −12 algorithms/include/gdx/algo/rasterize.h
+19 −6 algorithms/include/gdx/algo/statistics.h
+0 −1 algorithms/include/gdx/algo/sum.h
+297 −0 algorithms/polygoncoverage.cpp
+0 −0 algorithms/rasterize.cpp
+1 −0 algorithms/test/CMakeLists.txt
+3 −1 algorithms/test/addpointstest.cpp
+5 −4 algorithms/test/categoryiotest.cpp
+5 −3 algorithms/test/clusteridtest.cpp
+27 −13 algorithms/test/filtertest.cpp
+113 −0 algorithms/test/rasterizetest.cpp
+1 −10 bootstrap.py
+5 −8 build-standalone.bat
+2 −6 build.py
+1 −0 common/CMakeLists.txt
+0 −0 common/include/gdx/rasteriterator.h
+5 −3 conda/bld.bat
+0 −51 conda/cmake/FindGsl.cmake
+7 −3 conda/conda_build_config.yaml
+0 −1 core/CMakeLists.txt
+2 −2 core/include/gdx/denserasterio.h
+3 −3 core/include/gdx/maskedraster.h
+2 −2 core/include/gdx/maskedrasterio.h
+9 −1 core/include/gdx/rasterdiff.h
+2 −1 core/include/gdx/sparserasterio.h
+2 −2 core/raster.cpp
+17 −13 core/test/rasteriotest.cpp
+1 −1 deps/infra
+0 −1,647 deps/overlay-ports/gdal/CMakeLists.txt
+0 −51 deps/overlay-ports/gdal/CONTROL
+0 −76 deps/overlay-ports/gdal/GDALConfig.cmake.in
+0 −35 deps/overlay-ports/gdal/copylayer-crash-1.patch
+0 −29 deps/overlay-ports/gdal/copylayer-crash-2.patch
+0 −273 deps/overlay-ports/gdal/cpl_config.h.cmake.in
+0 −115 deps/overlay-ports/gdal/cpl_config.h.vc.cmake.in
+0 −12 deps/overlay-ports/gdal/netcdf-non-ascii.patch
+0 −108 deps/overlay-ports/gdal/portfile.cmake
+0 −30 deps/overlay-ports/gdal/proj-version.patch
+0 −39 deps/overlay-ports/gdal/vrtfilter.patch
+1 −1 deps/vcpkg
+1 −1 gdxconfig.h.in
+9 −10 python/CMakeLists.txt
+21 −20 python/pythonadapters.cpp
+0 −3 test/testclusters.py
+2 −2 tools/gdxcmp.cpp
+2 −2 tools/gdxconv.cpp
+1 −0 vcpkg.json
2 changes: 1 addition & 1 deletion deps/infra
Submodule infra updated 83 files
+0 −5 .clang-format
+18 −0 .devcontainer/devcontainer.json
+29 −0 .dockerignore
+62 −0 .github/workflows/vcpkg-build.yml
+4 −0 .gitignore
+3 −0 .gitmodules
+0 −26 .vscode/cmake-kits.json
+0 −33 .vscode/launch.json
+1 −18 .vscode/settings.json
+280 −218 CMakeLists.txt
+181 −0 CMakePresets.json
+13 −0 Dockerfile.develop
+2 −0 Readme.md
+82 −0 bootstrap.py
+101 −0 build.py
+119 −15 chrono.cpp
+31 −0 chrono.natvis
+31 −16 cliprogressbar.cpp
+1 −1 cpuinfo.cpp
+2 −1 crypto.cpp
+10 −1 csvreader.cpp
+14 −0 csvwriter.cpp
+1 −0 deps/vcpkg
+9 −3 filesystem.cpp
+15 −5 gdal.cpp
+15 −1 gdalalgo.cpp
+9 −5 gdalgeometry.cpp
+4 −20 geometadata.cpp
+23 −25 geometry.cpp
+4 −8 include/infra/cell.h
+112 −5 include/infra/chrono.h
+1 −0 include/infra/cliprogressbar.h
+4 −7 include/infra/color.h
+7 −12 include/infra/coordinate.h
+5 −4 include/infra/csvreader.h
+3 −1 include/infra/csvwriter.h
+12 −2 include/infra/filelock.h
+35 −25 include/infra/filesystem.h
+4 −10 include/infra/format.h
+2 −0 include/infra/gdal.h
+52 −0 include/infra/gdalalgo.h
+23 −2 include/infra/gdalgeometry.h
+1 −33 include/infra/gdalio.h
+4 −10 include/infra/geometadata.h
+19 −0 include/infra/hash.h
+4 −5 include/infra/inireader.h
+2 −2 include/infra/interpolate.h
+1 −0 include/infra/naturalbreaks.h
+6 −8 include/infra/point.h
+5 −8 include/infra/range.h
+14 −1 include/infra/rect.h
+5 −7 include/infra/size.h
+33 −27 include/infra/string.h
+2 −1 include/infra/tempdir.h
+3 −6 include/infra/tile.h
+2 −1 include/infra/workerthread.h
+41 −0 include/infra/xlsxworkbook.h
+22 −11 include/uiinfra/dateconversion.h
+4 −8 include/uiinfra/format.h
+1 −0 include/uiinfra/stringinputdialog.h
+1 −1 include/uiinfra/userinteraction.h
+3 −0 inireader.cpp
+25 −12 legend.cpp
+22 −21 string.cpp
+20 −1 tempdir.cpp
+0 −21 tempdir.h
+10 −10 test/gdaltest.cpp
+17 −3 test/geometadatatest.cpp
+7 −0 test/interpolatetest.cpp
+1 −1 test/legenddataanalysertest.cpp
+1 −2 testutil/CMakeLists.txt
+20 −2 testutil/include/infra/test/containerasserts.h
+0 −2 testutil/include/infra/test/printsupport.h
+3 −3 testutil/printsupport.cpp
+8 −10 testutil/testmain.cpp
+74 −0 tile.cpp
+1 −1 ui/logsinkmodel.cpp
+1 −1 ui/modelexport.cpp
+5 −0 ui/stringinputdialog.cpp
+2 −1 ui/userinteraction.cpp
+107 −0 vcpkg.json
+11 −3 workerthread.cpp
+2 −1 xmldocument.cpp
2 changes: 1 addition & 1 deletion deps/vcpkg
Submodule vcpkg updated 1005 files
1 change: 0 additions & 1 deletion logic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ add_library(emaplogic
enuminfo.h
emissionvalidation.h emissionvalidation.cpp
unitconversion.h
geometry.h geometry.cpp
gridrasterbuilder.h
emissionscollector.h emissionscollector.cpp
outputwriters.h outputwriters.cpp
Expand Down
3 changes: 1 addition & 2 deletions logic/debugtools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
#include "emap/configurationparser.h"
#include "emap/countryborders.h"
#include "emap/gridprocessing.h"
#include "geometry.h"

#include "infra/chrono.h"
#include "infra/gdal.h"
#include "infra/gdalalgo.h"
#include "infra/geometry.h"

#include <geos/geom/DefaultCoordinateSequenceFactory.h>
#include <geos/geom/Geometry.h>
#include <geos/geom/GeometryFactory.h>
#include <geos/geom/MultiPolygon.h>
Expand Down
203 changes: 0 additions & 203 deletions logic/geometry.cpp

This file was deleted.

41 changes: 0 additions & 41 deletions logic/geometry.h

This file was deleted.

2 changes: 1 addition & 1 deletion logic/gridprocessing.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "emap/gridprocessing.h"
#include "emap/emissions.h"
#include "geometry.h"

#include "infra/algo.h"
#include "infra/cast.h"
Expand All @@ -9,6 +8,7 @@
#include "infra/enumutils.h"
#include "infra/gdalio.h"
#include "infra/geometadata.h"
#include "infra/geometry.h"
#include "infra/log.h"
#include "infra/math.h"
#include "infra/progressinfo.h"
Expand Down
14 changes: 9 additions & 5 deletions logic/test/gridprocessingtest.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "emap/gridprocessing.h"
#include "emap/configurationparser.h"
#include "geometry.h"
#include "infra/geometry.h"
#include "testconstants.h"

#include "gdx/algo/sum.h"
Expand All @@ -17,7 +17,7 @@
#include "testconfig.h"

#include <doctest/doctest.h>
#include <geos/geom/CoordinateArraySequence.h>
#include <geos/geom/CoordinateSequence.h>
#include <geos/geom/GeometryFactory.h>

namespace emap::test {
Expand All @@ -31,9 +31,13 @@ TEST_CASE("create_geometry_extent")
auto geomFactory = geos::geom::GeometryFactory::create();

const GeoMetadata gridMeta(4, 3, 50.0, -50.0, 50.0, {});
geos::geom::CoordinateArraySequence coords(std::vector<geos::geom::Coordinate>({{110.0, 55.0}, {130.0, 75.0}, {120.0, 65.0}, {110.0, 55.0}}));

const auto poly = geomFactory->createPolygon(geomFactory->createLinearRing(coords), {});
auto coords = std::make_unique<geos::geom::CoordinateSequence>(std::initializer_list<geos::geom::Coordinate>{geos::geom::Coordinate{110.0, 55.0},
geos::geom::Coordinate{130.0, 75.0},
geos::geom::Coordinate{120.0, 65.0},
geos::geom::Coordinate{110.0, 55.0}});

const auto poly = geomFactory->createPolygon(geomFactory->createLinearRing(std::move(coords)), {});

auto meta = create_geometry_intersection_extent(*poly, gridMeta);
CHECK(GeoMetadata(1, 1, 100.0, 50.0, 50.0, {}) == meta);
Expand Down Expand Up @@ -334,4 +338,4 @@ TEST_CASE("Add to raster")
// }
// }
// }
}
}
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
"name": "emap",
"version": "0.1.0",
"dependencies": [
Expand Down

0 comments on commit fedb833

Please sign in to comment.