19#include <geos/geom/Location.h>
20#include <geos/geom/Position.h>
21#include <geos/export.h>
95 int aDim = DIM_NOT_PART;
100 int bDim = DIM_NOT_PART;
101 bool bIsHole =
false;
106 std::string dimensionSymbol(
int dim)
const;
107 void locationString(uint8_t index,
bool isForward, std::ostream& os)
const;
112 static constexpr Location LOC_UNKNOWN = Location::NONE;
125 , aLocLeft(LOC_UNKNOWN)
126 , aLocRight(LOC_UNKNOWN)
127 , aLocLine(LOC_UNKNOWN)
130 , bLocLeft(LOC_UNKNOWN)
131 , bLocRight(LOC_UNKNOWN)
132 , bLocLine(LOC_UNKNOWN) {};
143 initBoundary(p_index, p_locLeft, p_locRight, p_isHole);
146 int dimension(uint8_t index)
const {
return index == 0 ? aDim : bDim; };
147 void initBoundary(uint8_t index,
Location locLeft,
Location locRight,
bool p_isHole);
148 void initCollapse(uint8_t index,
bool p_isHole);
149 void initLine(uint8_t index);
150 void initNotPart(uint8_t index);
162 void setLocationAll(uint8_t index,
Location loc);
163 void setLocationCollapse(uint8_t index);
172 return aDim == DIM_LINE || bDim == DIM_LINE;
175 bool isLine(uint8_t index)
const
177 return index == 0 ? aDim == DIM_LINE : bDim == DIM_LINE;
180 bool isLinear(uint8_t index)
const
183 return aDim == DIM_LINE || aDim == DIM_COLLAPSE;
185 return bDim == DIM_LINE || bDim == DIM_COLLAPSE;
188 bool isKnown(uint8_t index)
const
191 return aDim != DIM_UNKNOWN;
193 return bDim != DIM_UNKNOWN;
196 bool isNotPart(uint8_t index)
const
199 return aDim == DIM_NOT_PART;
201 return bDim == DIM_NOT_PART;
204 bool isBoundaryEither()
const
206 return aDim == DIM_BOUNDARY || bDim == DIM_BOUNDARY;
209 bool isBoundaryBoth()
const
211 return aDim == DIM_BOUNDARY && bDim == DIM_BOUNDARY;
223 if (isLine())
return false;
224 return ! isBoundaryBoth();
233 return isBoundaryBoth() &&
234 getLocation(0, Position::RIGHT,
true) != getLocation(1, Position::RIGHT,
true);
237 bool isBoundary(uint8_t index)
const
240 return aDim == DIM_BOUNDARY;
242 return bDim == DIM_BOUNDARY;
245 bool isLineLocationUnknown(
int index)
const
248 return aLocLine == LOC_UNKNOWN;
251 return bLocLine == LOC_UNKNOWN;
261 if (aDim == DIM_BOUNDARY && bDim == DIM_NOT_PART) {
265 if (bDim == DIM_BOUNDARY && aDim == DIM_NOT_PART) {
280 return aLocLine == Location::INTERIOR;
282 return bLocLine == Location::INTERIOR;
285 bool isHole(uint8_t index)
const
295 bool isCollapse(uint8_t index)
const
297 return dimension(index) == DIM_COLLAPSE;
300 Location getLineLocation(uint8_t index)
const
316 if (aDim == DIM_COLLAPSE && aLocLine == Location::INTERIOR)
318 if (bDim == DIM_COLLAPSE && bLocLine == Location::INTERIOR)
339 return aLocLine == Location::INTERIOR;
341 return bLocLine == Location::INTERIOR;
358 bool isForward)
const
360 if (isBoundary(index)) {
361 return getLocation(index, position, isForward);
363 return getLineLocation(index);
379 Location getLocation(uint8_t index,
int position,
bool isForward)
const;
381 bool hasSides(uint8_t index)
const {
383 return aLocLeft != LOC_UNKNOWN
384 || aLocRight != LOC_UNKNOWN;
386 return bLocLeft != LOC_UNKNOWN
387 || bLocRight != LOC_UNKNOWN;
390 OverlayLabel copy()
const
392 OverlayLabel lbl = *
this;
396 friend std::ostream& operator<<(std::ostream& os,
const OverlayLabel& ol);
397 void toString(
bool isForward, std::ostream& os)
const;
A Position indicates the position of a Location relative to a graph component (Node,...
Definition: Position.h:37
Definition: OverlayLabel.h:90
void setLocationLine(uint8_t index, Location loc)
Location getLocation(uint8_t index) const
Definition: OverlayLabel.h:372
bool isLineInterior(uint8_t index) const
Definition: OverlayLabel.h:336
bool isBoundaryCollapse() const
Definition: OverlayLabel.h:221
bool isInteriorCollapse() const
Definition: OverlayLabel.h:314
bool isCollapseAndNotPartInterior() const
Location getLocationBoundaryOrLine(uint8_t index, int position, bool isForward) const
Definition: OverlayLabel.h:355
bool isBoundaryTouch() const
Definition: OverlayLabel.h:231
bool isLineInArea(int8_t index) const
Definition: OverlayLabel.h:277
bool isBoundarySingleton() const
Definition: OverlayLabel.h:259
Location
Constants representing the location of a point relative to a geometry.
Definition: Location.h:32
Basic namespace for all GEOS functionalities.
Definition: geos.h:39