18#include <geos/export.h>
23#include <geos/geom/CoordinateFilter.h>
24#include <geos/geom/CoordinateSequence.h>
25#include <geos/geom/Coordinate.h>
29#pragma warning(disable: 4251)
41class GEOS_DLL UniqueCoordinateArrayFilter :
public geom::CoordinateInspector<UniqueCoordinateArrayFilter> {
48 UniqueCoordinateArrayFilter(std::vector<const geom::Coordinate*>& target)
50 , maxUnique(NO_COORD_INDEX)
53 UniqueCoordinateArrayFilter(std::vector<const geom::Coordinate*>& target, std::size_t p_maxUnique)
55 , maxUnique(p_maxUnique)
64 ~UniqueCoordinateArrayFilter()
override {}
71 template<
typename CoordType>
72 void filter(
const CoordType* coord)
74 if(uniqPts.insert(coord).second) {
78 if(maxUnique != NO_COORD_INDEX && uniqPts.size() > maxUnique) {
83 void filter(
const geom::CoordinateXY*) {
88 void filter(
const geom::CoordinateXYM*) {
92 bool isDone()
const override {
97 std::vector<const geom::Coordinate*>& pts;
98 std::set<const geom::CoordinateXY*, geom::CoordinateLessThan> uniqPts;
99 std::size_t maxUnique;
103 UniqueCoordinateArrayFilter(
const UniqueCoordinateArrayFilter& other) =
delete;
104 UniqueCoordinateArrayFilter& operator=(
const UniqueCoordinateArrayFilter& rhs) =
delete;
Basic namespace for all GEOS functionalities.
Definition geos.h:39