-
Notifications
You must be signed in to change notification settings - Fork 372
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-dimensional CoordinateSequence (#721)
* Convert CoordinateSequence from abstract to concrete class Implementation is taken from CoordinateArraySequence. FixedSizeCoordinateSequence is removed. * Implement CoordinateSequence using std::vector<double> * Support XYZM in WKTReader, WKTWriter * Update WKTReader behavior and tests * Pad XYM CoordinateSequences to XYZM, for now * Support M values in WKBReader * Support M values in WKBWriter * Add some tests, resolve TODOs * Handle M values in CAPI CoordSeq array and buffer functions Improves performance of copy-to-buffer by about 75% * Remove CoordinateSequenceFactory * Optimize CoordinateSequence::initialize * Fix MSVC linking error * Add tests * Allow autogenerated CoordinateSequence move ctr * Avoid changing LineString::normalize behavior for zero-length LineString * Update NEWS * Avoid change in Coordinate::toString (breaks PostGIS test) * Remove commented-out code * Avoid repetition in Coordinate isNull methods * Fix copyright * Remove commented-out code * Remove duplicated import
- Loading branch information
Showing
225 changed files
with
4,705 additions
and
4,072 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/********************************************************************** | ||
* | ||
* GEOS - Geometry Engine Open Source | ||
* http://geos.osgeo.org | ||
* | ||
* Copyright (C) 2022 ISciences, LLC | ||
* | ||
* This is free software; you can redistribute and/or modify it under | ||
* the terms of the GNU Lesser General Public Licence as published | ||
* by the Free Software Foundation. | ||
* See the COPYING file for more information. | ||
* | ||
**********************************************************************/ | ||
|
||
#include <benchmark/benchmark.h> | ||
|
||
#include <geos/geom/CoordinateSequence.h> | ||
|
||
using geos::geom::Coordinate; | ||
using geos::geom::CoordinateSequence; | ||
|
||
static void BM_Size(benchmark::State& state) { | ||
CoordinateSequence z(1533); | ||
|
||
for (auto _ : state) { | ||
benchmark::DoNotOptimize(z.size()); | ||
} | ||
} | ||
|
||
static void BM_Initialize(benchmark::State& state) { | ||
bool hasZ = false; | ||
bool hasM = false; | ||
|
||
for (auto _ : state) { | ||
CoordinateSequence seq(1000, hasZ, hasM, true); | ||
} | ||
} | ||
|
||
static void BM_HasRepeatedPoints(benchmark::State & state) { | ||
CoordinateSequence seq(12345, false, false); | ||
for (std::size_t i = 0; i < seq.size(); ++i) { | ||
double di = static_cast<double>(i); | ||
seq.setAt(Coordinate(di, di + 0.1), i); | ||
} | ||
|
||
for (auto _ : state) { | ||
benchmark::DoNotOptimize(seq.hasRepeatedPoints()); | ||
} | ||
} | ||
|
||
BENCHMARK(BM_Size); | ||
BENCHMARK(BM_Initialize); | ||
BENCHMARK(BM_HasRepeatedPoints); | ||
|
||
BENCHMARK_MAIN(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.