1 #ifndef OSMSCOUT_UTIL_GEOMETRY_H 2 #define OSMSCOUT_UTIL_GEOMETRY_H 27 #include <unordered_map> 63 return deg*M_PI/180.0;
73 return rad*180.0/M_PI;
86 double diff = std::abs(a - b);
89 return 2 * M_PI - diff;
113 assert(!nodes.empty());
115 minLon=nodes[0].GetLon();
116 maxLon=nodes[0].GetLon();
117 minLat=nodes[0].GetLat();
118 maxLat=nodes[0].GetLat();
120 for (
size_t i=1; i<nodes.size(); i++) {
121 minLon=std::min(minLon,nodes[i].GetLon());
122 maxLon=std::max(maxLon,nodes[i].GetLon());
123 minLat=std::min(minLat,nodes[i].GetLat());
124 maxLat=std::max(maxLat,nodes[i].GetLat());
138 template<
class InputIt >
145 double minLon=first->GetLon();
146 double maxLon=minLon;
147 double minLat=first->GetLat();
148 double maxLat=minLat;
150 for (InputIt i=first; i!=last; i++) {
151 minLon=std::min(minLon,i->GetLon());
152 maxLon=std::max(maxLon,i->GetLon());
153 minLat=std::min(minLat,i->GetLat());
154 maxLat=std::max(maxLat,i->GetLat());
157 boundingBox.Set(GeoCoord(minLat,minLon),
158 GeoCoord(maxLat,maxLon));
176 assert(!nodes.empty());
178 double minLon=nodes[0].GetLon();
179 double maxLon=minLon;
180 double minLat=nodes[0].GetLat();
181 double maxLat=minLat;
183 for (
size_t i=1; i<nodes.size(); i++) {
184 minLon=std::min(minLon,nodes[i].GetLon());
185 maxLon=std::max(maxLon,nodes[i].GetLon());
186 minLat=std::min(minLat,nodes[i].GetLat());
187 maxLat=std::max(maxLat,nodes[i].GetLat());
190 boundingBox.Set(GeoCoord(minLat,minLon),
191 GeoCoord(maxLat,maxLon));
205 if (a1.IsEqual(b1) ||
211 if (a1.IsEqual(a2) &&
218 double denr=(b2.GetLat()-b1.GetLat())*(a2.GetLon()-a1.GetLon())-
219 (b2.GetLon()-b1.GetLon())*(a2.GetLat()-a1.GetLat());
221 double ua_numr=(b2.GetLon()-b1.GetLon())*(a1.GetLat()-b1.GetLat())-
222 (b2.GetLat()-b1.GetLat())*(a1.GetLon()-b1.GetLon());
223 double ub_numr=(a2.GetLon()-a1.GetLon())*(a1.GetLat()-b1.GetLat())-
224 (a2.GetLat()-a1.GetLat())*(a1.GetLon()-b1.GetLon());
227 if (ua_numr==0.0 && ub_numr==0.0) {
229 GeoBox aBox(GeoCoord(a1.GetLat(),a1.GetLon()),
230 GeoCoord(a2.GetLat(),a2.GetLon()));
231 GeoBox bBox(GeoCoord(b1.GetLat(),b1.GetLon()),
232 GeoCoord(b2.GetLat(),b2.GetLon()));
234 return bBox.Includes(a1,
false) ||
235 bBox.Includes(a2,
false) ||
236 aBox.Includes(b1,
false) ||
237 aBox.Includes(b2,
false);
243 double ua=ua_numr/denr;
244 double ub=ub_numr/denr;
257 template<
typename N,
typename I>
264 if (a1.IsEqual(b1) ||
266 intersection.Set(a1.GetLat(),a1.GetLon());
269 if (a2.IsEqual(b1) ||
271 intersection.Set(a2.GetLat(),a2.GetLon());
274 if (a1.IsEqual(a2) &&
288 double denr=(b2.GetLat()-b1.GetLat())*(a2.GetLon()-a1.GetLon())-
289 (b2.GetLon()-b1.GetLon())*(a2.GetLat()-a1.GetLat());
291 double ua_numr=(b2.GetLon()-b1.GetLon())*(a1.GetLat()-b1.GetLat())-
292 (b2.GetLat()-b1.GetLat())*(a1.GetLon()-b1.GetLon());
293 double ub_numr=(a2.GetLon()-a1.GetLon())*(a1.GetLat()-b1.GetLat())-
294 (a2.GetLat()-a1.GetLat())*(a1.GetLon()-b1.GetLon());
297 if (ua_numr==0.0 && ub_numr==0.0) {
299 GeoBox aBox(GeoCoord(a1.GetLat(),a1.GetLon()),
300 GeoCoord(a2.GetLat(),a2.GetLon()));
301 GeoBox bBox(GeoCoord(b1.GetLat(),b1.GetLon()),
302 GeoCoord(b2.GetLat(),b2.GetLon()));
303 if (bBox.Includes(a1,
false)){
304 intersection.Set(a1.GetLat(),a1.GetLon());
307 if (bBox.Includes(a2,
false)){
308 intersection.Set(a2.GetLat(),a2.GetLon());
311 if (aBox.Includes(b1,
false)){
312 intersection.Set(b1.GetLat(),b1.GetLon());
315 if (aBox.Includes(b2,
false)){
316 intersection.Set(b2.GetLat(),b2.GetLon());
326 double ua=ua_numr/denr;
327 double ub=ub_numr/denr;
333 intersection.Set(a1.GetLat()+ua*(a2.GetLat()-a1.GetLat()),
334 a1.GetLon()+ua*(a2.GetLon()-a1.GetLon()));
353 if (a1.IsEqual(b1) ||
355 intersection.Set(a1.GetX(),a1.GetY());
358 if (a2.IsEqual(b1) ||
360 intersection.Set(a2.GetX(),a2.GetY());
363 if (a1.IsEqual(a2) &&
369 double denr=(b2.GetY()-b1.GetY())*(a2.GetX()-a1.GetX())-
370 (b2.GetX()-b1.GetX())*(a2.GetY()-a1.GetY());
372 double ua_numr=(b2.GetX()-b1.GetX())*(a1.GetY()-b1.GetY())-
373 (b2.GetY()-b1.GetY())*(a1.GetX()-b1.GetX());
374 double ub_numr=(a2.GetX()-a1.GetX())*(a1.GetY()-b1.GetY())-
375 (a2.GetY()-a1.GetY())*(a1.GetX()-b1.GetX());
382 return ua_numr==0.0 && ub_numr==0.0;
385 double ua=ua_numr/denr;
386 double ub=ub_numr/denr;
392 intersection.Set(a1.GetX()+ua*(a2.GetX()-a1.GetX()),
393 a1.GetY()+ua*(a2.GetY()-a1.GetY()));
404 double lonDelta=a.GetLon()-b.GetLon();
405 double latDelta=a.GetLat()-b.GetLat();
407 return lonDelta*lonDelta+latDelta*latDelta;
475 template<
typename N,
typename M>
477 const std::vector<M>& nodes)
483 for (i=0, j=nodes.size()-1; i<nodes.size(); j=i++) {
484 if (point.GetLat()==nodes[i].GetLat() &&
485 point.GetLon()==nodes[i].GetLon()) {
489 if ((((nodes[i].GetLat()<=point.GetLat()) && (point.GetLat()<nodes[j].GetLat())) ||
490 ((nodes[j].GetLat()<=point.GetLat()) && (point.GetLat()<nodes[i].GetLat()))) &&
491 (point.GetLon()<(nodes[j].GetLon()-nodes[i].GetLon())*(point.GetLat()-nodes[i].GetLat())/(nodes[j].GetLat()-nodes[i].GetLat())+
492 nodes[i].GetLon())) {
507 template<
typename N,
typename M>
509 const std::vector<M>& nodes)
515 for (i=0, j=nodes.size()-1; i<nodes.size(); j=i++) {
516 if (point.GetLat()==nodes[i].GetLat() &&
517 point.GetLon()==nodes[i].GetLon()) {
521 if ((((nodes[i].GetLat()<=point.GetLat()) && (point.GetLat()<nodes[j].GetLat())) ||
522 ((nodes[j].GetLat()<=point.GetLat()) && (point.GetLat()<nodes[i].GetLat()))) &&
523 (point.GetLon()<(nodes[j].GetLon()-nodes[i].GetLon())*(point.GetLat()-nodes[i].GetLat())/(nodes[j].GetLat()-nodes[i].GetLat())+
524 nodes[i].GetLon())) {
536 template<
typename N,
typename M>
538 const std::vector<M>& b)
540 for (
const auto& node : a) {
553 template<
typename N,
typename M>
555 const std::vector<M>& b,
559 if (!aBox.Intersects(bBox)){
563 for (
const auto& node : a) {
576 template<
typename N,
typename M>
578 const std::vector<M>& b)
596 template<
typename N,
typename M>
598 const std::vector<M>& b)
600 for (
const auto& node : a) {
623 template<
typename N,
typename M>
625 const std::vector<M>& b)
631 for (
const auto& node : a) {
643 if (count>=100 &&
double(pro)/20.0>
double(contra)) {
648 return double(pro)/20.0>double(contra);
660 template<
typename N,
typename M>
662 const std::vector<M>& b)
672 for (
const auto& node : a) {
684 if (count>=100 && pro/20>contra) {
689 if (pro == 0 && contra == 0 && count > 0) {
693 return pro/20.0>contra;
708 if (points.size()<3) {
712 points.push_back(points[0]);
714 size_t edgesIntersect=0;
716 for (
size_t i=0; i<points.size()-1; i++) {
719 for (
size_t j=i+1; j<points.size()-1; j++) {
727 if (edgesIntersect>2) {
732 if (edgesIntersect>1) {
754 const std::vector<bool>& edgeStartsNewPoly)
756 size_t edgesIntersect=0;
758 for (
size_t i=0; i<edges.size(); i++) {
761 for (
size_t j=i+1; j<edges.size(); j++) {
772 if (edgeStartsNewPoly[i]) {
773 if (edgesIntersect>2) {
784 if (edgesIntersect>1) {
811 for (
size_t i=1; i<edges.size(); i++) {
813 if (edges[i].y<edges[ptIdx].y) {
817 else if (edges[i].y==edges[ptIdx].y) {
818 if (edges[i].x<edges[ptIdx].x) {
824 size_t prevIdx=(ptIdx==0) ? edges.size()-1 : ptIdx-1;
825 size_t nextIdx=(ptIdx==edges.size()-1) ? 0 : ptIdx+1;
827 double signedArea=(edges[ptIdx].x-edges[prevIdx].x)*
828 (edges[nextIdx].y-edges[ptIdx].y)-
829 (edges[ptIdx].y-edges[prevIdx].y)*
830 (edges[nextIdx].x-edges[ptIdx].x);
832 return signedArea>0.0;
844 std::vector<std::vector<N> >& innerPoints)
846 if (outerPoints.size()<3) {
850 size_t numEdges=outerPoints.size();
852 for (
size_t i=0; i<innerPoints.size(); i++) {
853 numEdges+=innerPoints[i].size();
856 std::vector<bool> edgeStartsNewPoly(numEdges,
false);
857 std::vector<std::pair<N,N> > listEdges(numEdges);
862 outerPoints.push_back(outerPoints[0]);
863 for (
size_t i=0; i<innerPoints.size(); i++) {
864 innerPoints[i].push_back(innerPoints[i][0]);
868 edgeStartsNewPoly[0]=
true;
869 for (
size_t i=1; i<outerPoints.size(); i++) {
870 std::pair<N, N> outerEdge;
872 outerEdge.first=outerPoints[i-1];
873 outerEdge.second=outerPoints[i];
874 listEdges[cEdge]=outerEdge;
880 for (
size_t i=0; i<innerPoints.size(); i++) {
881 edgeStartsNewPoly[cEdge]=
true;
883 for (
size_t j=1; j<innerPoints[i].size(); j++) {
884 std::pair<N, N> innerEdge;
886 innerEdge.first=innerPoints[i][j-1];
887 innerEdge.second=innerPoints[i][j];
888 listEdges[cEdge]=innerEdge;
896 outerPoints.pop_back();
897 for (
size_t i=0; i<innerPoints.size(); i++) {
898 innerPoints[i].pop_back();
907 std::reverse(outerPoints.begin(),
911 for (
int i=0; i<innerPoints.size(); i++) {
913 std::reverse(innerPoints[i].begin(),
914 innerPoints[i].end());
936 double length=sqrt(x*x+y*y);
948 inline double Det(
double x1,
974 assert(edges.size()>=3);
982 for (
size_t i=1; i<edges.size(); i++) {
984 if (edges[i].GetLat()<edges[ptIdx].GetLat()) {
988 else if (edges[i].GetLat()==edges[ptIdx].GetLat()) {
989 if (edges[i].GetLon()<edges[ptIdx].GetLon()) {
995 size_t prevIdx=(ptIdx==0) ? edges.size()-1 : ptIdx-1;
996 size_t nextIdx=(ptIdx==edges.size()-1) ? 0 : ptIdx+1;
998 double signedArea=(edges[ptIdx].GetLon()-edges[prevIdx].GetLon())*
999 (edges[nextIdx].GetLat()-edges[ptIdx].GetLat())-
1000 (edges[ptIdx].GetLat()-edges[prevIdx].GetLat())*
1001 (edges[nextIdx].GetLon()-edges[ptIdx].GetLon());
1003 return signedArea<0.0;
1018 template<
typename N>
1023 double xdelta=b.GetLon()-a.GetLon();
1024 double ydelta=b.GetLat()-a.GetLat();
1026 if (xdelta==0 && ydelta==0) {
1027 return std::numeric_limits<double>::infinity();
1030 double u=((p.GetLon()-a.GetLon())*xdelta+(p.GetLat()-a.GetLat())*ydelta)/(xdelta*xdelta+ydelta*ydelta);
1044 cx=a.GetLon()+u*xdelta;
1045 cy=a.GetLat()+u*ydelta;
1048 double dx=cx-p.GetLon();
1049 double dy=cy-p.GetLat();
1051 return sqrt(dx*dx+dy*dy);
1057 GeoCoord& intersection);
1073 double bLon,
double bLat);
1089 const Bearing &bearing,
1090 const Distance &distance,
1091 double& lat2,
double& lon2);
1099 const Bearing &bearing,
1100 const Distance &distance);
1149 return x==other.
x && y==other.
y;
1154 return std::tie(y, x) < std::tie(other.
y, other.
x);
1159 return x==other.
x && y==other.
y;
1186 std::vector<ScanCell>& cells);
1195 double p1x,
double p1y,
1196 double p2x,
double p2y,
1198 double& qx,
double& qy);
1201 const GeoCoord& segmentStart,
1202 const GeoCoord& segmentEnd,
1204 GeoCoord& intersection);
1207 const GeoCoord& segmentStart,
1208 const GeoCoord& segmentEnd,
1210 GeoCoord& intersection);
1213 const GeoCoord& segmentStart,
1214 const GeoCoord& segmentEnd,
1216 GeoCoord& intersection);
1228 double aDistanceSquare;
1239 template<
typename N>
1241 size_t from,
size_t to,
1242 GeoBox& boundingBox)
1244 if (path.empty() || from>=to){
1245 boundingBox.Invalidate();
1248 double minLon=path[from%path.size()].GetLon();
1249 double maxLon=minLon;
1250 double minLat=path[from%path.size()].GetLat();
1251 double maxLat=minLat;
1253 for (
size_t i=from; i<to; i++) {
1254 minLon=std::min(minLon,path[i%path.size()].GetLon());
1255 maxLon=std::max(maxLon,path[i%path.size()].GetLon());
1256 minLat=std::min(minLat,path[i%path.size()].GetLat());
1257 maxLat=std::max(maxLat,path[i%path.size()].GetLat());
1260 boundingBox.Set(GeoCoord(minLat,minLon),
1261 GeoCoord(maxLat,maxLon));
1270 template<
typename N>
1272 std::vector<SegmentGeoBox> &segmentBoxes,
1274 size_t segmentSize = 1000)
1276 assert(segmentSize>0);
1277 for (
size_t i=0;i<bound;i+=segmentSize){
1280 box.
to = std::min(i+segmentSize,bound);
1282 segmentBoxes.push_back(box);
1292 template<
typename N>
1294 const std::vector<N> &bPath,
1297 std::vector<PathIntersection> &intersections,
1298 size_t aStartIndex=0,
1299 size_t bStartIndex=0)
1301 size_t aIndex=aStartIndex;
1302 size_t bIndex=bStartIndex;
1304 size_t aBound=aClosed?aIndex+aPath.size():aPath.size()-1;
1305 size_t bBound=bClosed?bIndex+bPath.size():bPath.size()-1;
1306 size_t bStart=bIndex;
1308 if (bStart>=bBound || aIndex>=aBound){
1318 std::vector<SegmentGeoBox> bSegmentBoxes;
1321 for (;aIndex<aBound;aIndex++){
1322 N a1=aPath[aIndex%aPath.size()];
1323 N a2=aPath[(aIndex+1)%aPath.size()];
1324 aLineBox.Set(GeoCoord(a1.GetLat(),a1.GetLon()),
1325 GeoCoord(a2.GetLat(),a2.GetLon()));
1326 if (!bBox.Intersects(aLineBox,
false)){
1329 for (bIndex=bStart;bIndex<bBound;bIndex++){
1330 N b1=bPath[bIndex%bPath.size()];
1331 N b2=bPath[(bIndex+1)%bPath.size()];
1332 bLineBox.Set(GeoCoord(b1.GetLat(),b1.GetLon()),
1333 GeoCoord(b2.GetLat(),b2.GetLon()));
1335 if (!bSegmentBoxes[bIndex/1000].bbox.Intersects(aLineBox,
false) &&
1336 !aLineBox.Intersects(bLineBox,
false)){
1338 bIndex+=std::max(0, 998-(
int)(bIndex%1000));
1341 if (!aLineBox.Intersects(bLineBox,
false)){
1352 GeoCoord pointBefore(a1.GetLat()-(a2.GetLat()-a1.GetLat()),
1353 a1.GetLon()-(a2.GetLon()-a1.GetLon()));
1354 GeoCoord pointAfter(b2.GetLat()+(b2.GetLat()-b1.GetLat()),
1355 b2.GetLon()+(b2.GetLon()-b1.GetLon()));
1357 (pointAfter.GetLat()-pi.
point.GetLat())-
1358 (pi.
point.GetLat()-pointBefore.GetLat())*
1359 (pointAfter.GetLon()-pi.
point.GetLon());
1366 intersections.push_back(pi);
1378 template<
typename N>
1386 std::vector<SegmentGeoBox> segmentBoxes;
1389 for (; i<way.size()-1; i++) {
1392 lineBox.Set(GeoCoord(i1.GetLat(),i1.GetLon()),
1393 GeoCoord(i2.GetLat(),i2.GetLon()));
1395 for (j=i+1; j<way.size()-1; j++) {
1396 if (!segmentBoxes[j/1000].bbox.Intersects(lineBox,
false) &&
1397 !segmentBoxes[(j+1)/1000].bbox.Intersects(lineBox,
false)){
1399 j+=std::max(0, 998-(
int)(j%1000));
1407 if (way[i].IsEqual(way[j]) ||
1408 way[i].IsEqual(way[j+1]) ||
1409 way[i+1].IsEqual(way[j]) ||
1410 way[i+1].IsEqual(way[j+1])) {
1437 std::unordered_map<Id,size_t> nodeIdIndexMap;
1438 std::vector<Point> nodes;
1439 std::list<Edge> edges;
1442 void RemoveEliminatingEdges();
1445 void AddPolygon(
const std::vector<Point>& polygonsCoords);
1447 bool Merge(std::list<Polygon>& result);
1481 Direction direction;
1483 size_t currentIndex=0;
1487 void CalculateBox();
1494 direction(direction),
1495 parts((double)parts)
1497 assert(currentIndex<parts);
1505 if (currentIndex<parts) {
1512 assert(currentIndex<parts);
1518 assert(currentIndex<parts);
1519 return currentIndex;
1530 return hash<int>{}(cell.
GetX()) ^ (hash<int>{}(cell.
GetY()) << 1);
double aDistanceSquare
distance^2 between "a path" point and intersection
Definition: Geometry.h:1229
bool IsAreaSubOfArea(const std::vector< N > &a, const std::vector< M > &b)
Definition: Geometry.h:597
bool IsAreaCompletelyInArea(const std::vector< N > &a, const std::vector< M > &b)
Definition: Geometry.h:537
void GetSegmentBoundingBox(const std::vector< N > &path, size_t from, size_t to, GeoBox &boundingBox)
Definition: Geometry.h:1240
bool AreaIsValid(std::vector< N > &outerPoints, std::vector< std::vector< N > > &innerPoints)
Definition: Geometry.h:843
void Normalize(double x, double y, double &nx, double &ny)
Definition: Geometry.h:931
double width
Definition: Geometry.h:1452
OSMSCOUT_API Distance GetSphericalDistance(const GeoCoord &a, const GeoCoord &b)
size_t bIndex
"b path" point index before intersection
Definition: Geometry.h:1226
OSMSCOUT_API double GetDistanceInLonDegrees(const Distance &d, double latitude=0)
bool operator==(const ScanCell &other) const
Definition: Geometry.h:1147
int GetY() const
Definition: Geometry.h:1167
double DistanceSquare(const N &a, const N &b)
Definition: Geometry.h:401
GeoBoxPartitioner(const GeoBox &box, Direction direction, size_t parts)
Definition: Geometry.h:1490
int y
Definition: Geometry.h:1137
Definition: Geometry.h:1222
double RadToDeg(double rad)
Definition: Geometry.h:71
OSMSCOUT_API const std::array< CellDimension, CELL_DIMENSION_COUNT > cellDimension
void Set(int x, int y)
Definition: Geometry.h:1141
size_t aIndex
"a path" point index before intersection
Definition: Geometry.h:1225
bool IsAreaAtLeastPartlyInArea(const std::vector< N > &a, const std::vector< M > &b, const GeoBox &aBox, const GeoBox &bBox)
Definition: Geometry.h:554
OSMSCOUT_API Distance GetEllipsoidalDistance(double aLon, double aLat, double bLon, double bLat)
bool IsCoordInArea(const N &point, const std::vector< M > &nodes)
Definition: Geometry.h:476
bool LinesIntersect(const N &a1, const N &a2, const N &b1, const N &b2)
Definition: Geometry.h:200
void GetBoundingBox(const std::vector< N > &nodes, double &minLon, double &maxLon, double &minLat, double &maxLat)
Definition: Geometry.h:107
bool GetLineIntersection(const N &a1, const N &a2, const N &b1, const N &b2, I &intersection)
Definition: Geometry.h:258
bool FindIntersection(const std::vector< N > &way, size_t &i, size_t &j)
Definition: Geometry.h:1379
double Det(double x1, double y1, double x2, double y2)
Definition: Geometry.h:948
bool AreaIsSimple(std::vector< N > points)
Definition: Geometry.h:706
const size_t CELL_DIMENSION_COUNT
Definition: Geometry.h:1457
GeoBox bbox
Definition: Geometry.h:1177
int GetX() const
Definition: Geometry.h:1162
double CalculateDistancePointToLineSegment(const N &p, const N &a, const N &b)
Definition: Geometry.h:1019
OSMSCOUT_API double DistanceToSegment(double px, double py, double p1x, double p1y, double p2x, double p2y, double &r, double &qx, double &qy)
size_t operator()(const osmscout::ScanCell &cell) const
Definition: Geometry.h:1528
std::vector< Point > coords
Definition: Geometry.h:1433
OSMSCOUT_API double NormalizeRelativeAngle(double angle)
double height
Definition: Geometry.h:1453
#define OSMSCOUT_API
Definition: CoreImportExport.h:45
int x
Definition: Geometry.h:1136
bool AreaIsCCW(const std::vector< N > &edges)
Definition: Geometry.h:800
double AngleDiff(double a, double b)
Definition: Geometry.h:84
OSMSCOUT_API Bearing GetSphericalBearingInitial(const GeoCoord &a, const GeoCoord &b)
GeoCoord point
intersection point
Definition: Geometry.h:1224
bool operator<(const ScanCell &other) const
Definition: Geometry.h:1152
bool IsAreaSubOfAreaOrSame(const std::vector< N > &a, const std::vector< M > &b)
Definition: Geometry.h:661
Direction
Definition: Geometry.h:1473
bool IsAreaSubOfAreaQuorum(const std::vector< N > &a, const std::vector< M > &b)
Definition: Geometry.h:624
Definition: Geometry.h:1470
void ComputeSegmentBoxes(const std::vector< N > &path, std::vector< SegmentGeoBox > &segmentBoxes, size_t bound, size_t segmentSize=1000)
Definition: Geometry.h:1271
Definition: Geometry.h:1431
GeoBox GetCurrentGeoBox() const
Definition: Geometry.h:1510
int GetRelationOfPointToArea(const N &point, const std::vector< M > &nodes)
Definition: Geometry.h:508
void OSMSCOUT_API ScanConvertLine(int x1, int y1, int x2, int y2, std::vector< ScanCell > &cells)
double DegToRad(double deg)
Definition: Geometry.h:61
bool AreaIsClockwise(const std::vector< N > &edges)
Definition: Geometry.h:972
bool IsEqual(const ScanCell &other) const
Definition: Geometry.h:1157
OSMSCOUT_API Bearing GetSphericalBearingFinal(const GeoCoord &a, const GeoCoord &b)
OSMSCOUT_API size_t Pow(size_t a, size_t b)
size_t to
exclusive
Definition: Geometry.h:1176
double orientation
Definition: Geometry.h:1227
size_t GetCurrentIndex() const
Definition: Geometry.h:1516
Definition: Geometry.h:1173
double bDistanceSquare
distance^2 between "b path" point and intersection
Definition: Geometry.h:1230
size_t from
Definition: Geometry.h:1175
void FindPathIntersections(const std::vector< N > &aPath, const std::vector< N > &bPath, bool aClosed, bool bClosed, std::vector< PathIntersection > &intersections, size_t aStartIndex=0, size_t bStartIndex=0)
Definition: Geometry.h:1293
Definition: Geometry.h:1450
Definition: Geometry.h:1421
bool GetLineIntersectionPixel(const N &a1, const N &a2, const N &b1, const N &b2, N &intersection)
Definition: Geometry.h:347
Definition: Geometry.h:1134
const size_t CELL_DIMENSION_MAX
Definition: Geometry.h:1456
void Advance()
Definition: Geometry.h:1501