1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>equals</title> 5<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../../index.html" title="Chapter 1. Geometry"> 8<link rel="up" href="../equals.html" title="equals"> 9<link rel="prev" href="equals_3_with_strategy.html" title="equals (with strategy)"> 10<link rel="next" href="../expand.html" title="expand"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="equals_3_with_strategy.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../equals.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../expand.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h5 class="title"> 27<a name="geometry.reference.algorithms.equals.equals_2"></a><a class="link" href="equals_2.html" title="equals">equals</a> 28</h5></div></div></div> 29<p> 30 <a class="indexterm" name="idm45635697306832"></a> 31Checks if a geometry are spatially equal. 32 </p> 33<h6> 34<a name="geometry.reference.algorithms.equals.equals_2.h0"></a> 35 <span class="phrase"><a name="geometry.reference.algorithms.equals.equals_2.description"></a></span><a class="link" href="equals_2.html#geometry.reference.algorithms.equals.equals_2.description">Description</a> 36 </h6> 37<p> 38 The free function equals checks if the first geometry is spatially equal 39 the second geometry. Spatially equal means that the same point set is 40 included. A box can therefore be spatially equal to a ring or a polygon, 41 or a linestring can be spatially equal to a multi-linestring or a segment. 42 This only works theoretically, not all combinations are implemented yet. 43 </p> 44<h6> 45<a name="geometry.reference.algorithms.equals.equals_2.h1"></a> 46 <span class="phrase"><a name="geometry.reference.algorithms.equals.equals_2.synopsis"></a></span><a class="link" href="equals_2.html#geometry.reference.algorithms.equals.equals_2.synopsis">Synopsis</a> 47 </h6> 48<p> 49</p> 50<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Geometry1</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Geometry2</span><span class="special">></span> 51<span class="keyword">bool</span> <span class="identifier">equals</span><span class="special">(</span><span class="identifier">Geometry1</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">geometry1</span><span class="special">,</span> <span class="identifier">Geometry2</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">geometry2</span><span class="special">)</span></pre> 52<p> 53 </p> 54<h6> 55<a name="geometry.reference.algorithms.equals.equals_2.h2"></a> 56 <span class="phrase"><a name="geometry.reference.algorithms.equals.equals_2.parameters"></a></span><a class="link" href="equals_2.html#geometry.reference.algorithms.equals.equals_2.parameters">Parameters</a> 57 </h6> 58<div class="informaltable"><table class="table"> 59<colgroup> 60<col> 61<col> 62<col> 63<col> 64</colgroup> 65<thead><tr> 66<th> 67 <p> 68 Type 69 </p> 70 </th> 71<th> 72 <p> 73 Concept 74 </p> 75 </th> 76<th> 77 <p> 78 Name 79 </p> 80 </th> 81<th> 82 <p> 83 Description 84 </p> 85 </th> 86</tr></thead> 87<tbody> 88<tr> 89<td> 90 <p> 91 Geometry1 const & 92 </p> 93 </td> 94<td> 95 <p> 96 Any type fulfilling a Geometry Concept 97 </p> 98 </td> 99<td> 100 <p> 101 geometry1 102 </p> 103 </td> 104<td> 105 <p> 106 A model of the specified concept 107 </p> 108 </td> 109</tr> 110<tr> 111<td> 112 <p> 113 Geometry2 const & 114 </p> 115 </td> 116<td> 117 <p> 118 Any type fulfilling a Geometry Concept 119 </p> 120 </td> 121<td> 122 <p> 123 geometry2 124 </p> 125 </td> 126<td> 127 <p> 128 A model of the specified concept 129 </p> 130 </td> 131</tr> 132</tbody> 133</table></div> 134<h6> 135<a name="geometry.reference.algorithms.equals.equals_2.h3"></a> 136 <span class="phrase"><a name="geometry.reference.algorithms.equals.equals_2.returns"></a></span><a class="link" href="equals_2.html#geometry.reference.algorithms.equals.equals_2.returns">Returns</a> 137 </h6> 138<p> 139 Returns true if two geometries are spatially equal 140 </p> 141<h6> 142<a name="geometry.reference.algorithms.equals.equals_2.h4"></a> 143 <span class="phrase"><a name="geometry.reference.algorithms.equals.equals_2.header"></a></span><a class="link" href="equals_2.html#geometry.reference.algorithms.equals.equals_2.header">Header</a> 144 </h6> 145<p> 146 Either 147 </p> 148<p> 149 <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> 150 </p> 151<p> 152 Or 153 </p> 154<p> 155 <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">algorithms</span><span class="special">/</span><span class="identifier">equals</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> 156 </p> 157<h6> 158<a name="geometry.reference.algorithms.equals.equals_2.h5"></a> 159 <span class="phrase"><a name="geometry.reference.algorithms.equals.equals_2.conformance"></a></span><a class="link" href="equals_2.html#geometry.reference.algorithms.equals.equals_2.conformance">Conformance</a> 160 </h6> 161<p> 162 The function equals implements function Equals from the <a href="http://www.opengeospatial.org/standards/sfa" target="_top">OGC 163 Simple Feature Specification</a>. 164 </p> 165<h6> 166<a name="geometry.reference.algorithms.equals.equals_2.h6"></a> 167 <span class="phrase"><a name="geometry.reference.algorithms.equals.equals_2.supported_geometries"></a></span><a class="link" href="equals_2.html#geometry.reference.algorithms.equals.equals_2.supported_geometries">Supported 168 geometries</a> 169 </h6> 170<div class="informaltable"><table class="table"> 171<colgroup> 172<col> 173<col> 174<col> 175<col> 176<col> 177<col> 178<col> 179<col> 180<col> 181<col> 182<col> 183</colgroup> 184<thead><tr> 185<th> 186 </th> 187<th> 188 <p> 189 Point 190 </p> 191 </th> 192<th> 193 <p> 194 Segment 195 </p> 196 </th> 197<th> 198 <p> 199 Box 200 </p> 201 </th> 202<th> 203 <p> 204 Linestring 205 </p> 206 </th> 207<th> 208 <p> 209 Ring 210 </p> 211 </th> 212<th> 213 <p> 214 Polygon 215 </p> 216 </th> 217<th> 218 <p> 219 MultiPoint 220 </p> 221 </th> 222<th> 223 <p> 224 MultiLinestring 225 </p> 226 </th> 227<th> 228 <p> 229 MultiPolygon 230 </p> 231 </th> 232<th> 233 <p> 234 Variant 235 </p> 236 </th> 237</tr></thead> 238<tbody> 239<tr> 240<td> 241 <p> 242 Point 243 </p> 244 </td> 245<td> 246 <p> 247 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 248 </p> 249 </td> 250<td> 251 <p> 252 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 253 </p> 254 </td> 255<td> 256 <p> 257 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 258 </p> 259 </td> 260<td> 261 <p> 262 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 263 </p> 264 </td> 265<td> 266 <p> 267 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 268 </p> 269 </td> 270<td> 271 <p> 272 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 273 </p> 274 </td> 275<td> 276 <p> 277 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 278 </p> 279 </td> 280<td> 281 <p> 282 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 283 </p> 284 </td> 285<td> 286 <p> 287 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 288 </p> 289 </td> 290<td> 291 <p> 292 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 293 </p> 294 </td> 295</tr> 296<tr> 297<td> 298 <p> 299 Segment 300 </p> 301 </td> 302<td> 303 <p> 304 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 305 </p> 306 </td> 307<td> 308 <p> 309 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 310 </p> 311 </td> 312<td> 313 <p> 314 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 315 </p> 316 </td> 317<td> 318 <p> 319 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 320 </p> 321 </td> 322<td> 323 <p> 324 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 325 </p> 326 </td> 327<td> 328 <p> 329 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 330 </p> 331 </td> 332<td> 333 <p> 334 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 335 </p> 336 </td> 337<td> 338 <p> 339 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 340 </p> 341 </td> 342<td> 343 <p> 344 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 345 </p> 346 </td> 347<td> 348 <p> 349 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 350 </p> 351 </td> 352</tr> 353<tr> 354<td> 355 <p> 356 Box 357 </p> 358 </td> 359<td> 360 <p> 361 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 362 </p> 363 </td> 364<td> 365 <p> 366 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 367 </p> 368 </td> 369<td> 370 <p> 371 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 372 </p> 373 </td> 374<td> 375 <p> 376 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 377 </p> 378 </td> 379<td> 380 <p> 381 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 382 </p> 383 </td> 384<td> 385 <p> 386 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 387 </p> 388 </td> 389<td> 390 <p> 391 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 392 </p> 393 </td> 394<td> 395 <p> 396 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 397 </p> 398 </td> 399<td> 400 <p> 401 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 402 </p> 403 </td> 404<td> 405 <p> 406 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 407 </p> 408 </td> 409</tr> 410<tr> 411<td> 412 <p> 413 Linestring 414 </p> 415 </td> 416<td> 417 <p> 418 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 419 </p> 420 </td> 421<td> 422 <p> 423 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 424 </p> 425 </td> 426<td> 427 <p> 428 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 429 </p> 430 </td> 431<td> 432 <p> 433 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 434 </p> 435 </td> 436<td> 437 <p> 438 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 439 </p> 440 </td> 441<td> 442 <p> 443 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 444 </p> 445 </td> 446<td> 447 <p> 448 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 449 </p> 450 </td> 451<td> 452 <p> 453 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 454 </p> 455 </td> 456<td> 457 <p> 458 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 459 </p> 460 </td> 461<td> 462 <p> 463 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 464 </p> 465 </td> 466</tr> 467<tr> 468<td> 469 <p> 470 Ring 471 </p> 472 </td> 473<td> 474 <p> 475 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 476 </p> 477 </td> 478<td> 479 <p> 480 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 481 </p> 482 </td> 483<td> 484 <p> 485 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 486 </p> 487 </td> 488<td> 489 <p> 490 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 491 </p> 492 </td> 493<td> 494 <p> 495 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 496 </p> 497 </td> 498<td> 499 <p> 500 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 501 </p> 502 </td> 503<td> 504 <p> 505 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 506 </p> 507 </td> 508<td> 509 <p> 510 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 511 </p> 512 </td> 513<td> 514 <p> 515 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 516 </p> 517 </td> 518<td> 519 <p> 520 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 521 </p> 522 </td> 523</tr> 524<tr> 525<td> 526 <p> 527 Polygon 528 </p> 529 </td> 530<td> 531 <p> 532 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 533 </p> 534 </td> 535<td> 536 <p> 537 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 538 </p> 539 </td> 540<td> 541 <p> 542 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 543 </p> 544 </td> 545<td> 546 <p> 547 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 548 </p> 549 </td> 550<td> 551 <p> 552 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 553 </p> 554 </td> 555<td> 556 <p> 557 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 558 </p> 559 </td> 560<td> 561 <p> 562 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 563 </p> 564 </td> 565<td> 566 <p> 567 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 568 </p> 569 </td> 570<td> 571 <p> 572 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 573 </p> 574 </td> 575<td> 576 <p> 577 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 578 </p> 579 </td> 580</tr> 581<tr> 582<td> 583 <p> 584 MultiPoint 585 </p> 586 </td> 587<td> 588 <p> 589 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 590 </p> 591 </td> 592<td> 593 <p> 594 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 595 </p> 596 </td> 597<td> 598 <p> 599 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 600 </p> 601 </td> 602<td> 603 <p> 604 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 605 </p> 606 </td> 607<td> 608 <p> 609 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 610 </p> 611 </td> 612<td> 613 <p> 614 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 615 </p> 616 </td> 617<td> 618 <p> 619 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 620 </p> 621 </td> 622<td> 623 <p> 624 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 625 </p> 626 </td> 627<td> 628 <p> 629 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 630 </p> 631 </td> 632<td> 633 <p> 634 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 635 </p> 636 </td> 637</tr> 638<tr> 639<td> 640 <p> 641 MultiLinestring 642 </p> 643 </td> 644<td> 645 <p> 646 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 647 </p> 648 </td> 649<td> 650 <p> 651 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 652 </p> 653 </td> 654<td> 655 <p> 656 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 657 </p> 658 </td> 659<td> 660 <p> 661 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 662 </p> 663 </td> 664<td> 665 <p> 666 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 667 </p> 668 </td> 669<td> 670 <p> 671 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 672 </p> 673 </td> 674<td> 675 <p> 676 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 677 </p> 678 </td> 679<td> 680 <p> 681 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 682 </p> 683 </td> 684<td> 685 <p> 686 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 687 </p> 688 </td> 689<td> 690 <p> 691 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 692 </p> 693 </td> 694</tr> 695<tr> 696<td> 697 <p> 698 MultiPolygon 699 </p> 700 </td> 701<td> 702 <p> 703 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 704 </p> 705 </td> 706<td> 707 <p> 708 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 709 </p> 710 </td> 711<td> 712 <p> 713 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 714 </p> 715 </td> 716<td> 717 <p> 718 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 719 </p> 720 </td> 721<td> 722 <p> 723 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 724 </p> 725 </td> 726<td> 727 <p> 728 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 729 </p> 730 </td> 731<td> 732 <p> 733 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 734 </p> 735 </td> 736<td> 737 <p> 738 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 739 </p> 740 </td> 741<td> 742 <p> 743 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 744 </p> 745 </td> 746<td> 747 <p> 748 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 749 </p> 750 </td> 751</tr> 752<tr> 753<td> 754 <p> 755 Variant 756 </p> 757 </td> 758<td> 759 <p> 760 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 761 </p> 762 </td> 763<td> 764 <p> 765 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 766 </p> 767 </td> 768<td> 769 <p> 770 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 771 </p> 772 </td> 773<td> 774 <p> 775 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 776 </p> 777 </td> 778<td> 779 <p> 780 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 781 </p> 782 </td> 783<td> 784 <p> 785 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 786 </p> 787 </td> 788<td> 789 <p> 790 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 791 </p> 792 </td> 793<td> 794 <p> 795 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 796 </p> 797 </td> 798<td> 799 <p> 800 <span class="inlinemediaobject"><img src="../../../../img/nyi.png" alt="nyi"></span> 801 </p> 802 </td> 803<td> 804 <p> 805 <span class="inlinemediaobject"><img src="../../../../img/ok.png" alt="ok"></span> 806 </p> 807 </td> 808</tr> 809</tbody> 810</table></div> 811<h6> 812<a name="geometry.reference.algorithms.equals.equals_2.h7"></a> 813 <span class="phrase"><a name="geometry.reference.algorithms.equals.equals_2.complexity"></a></span><a class="link" href="equals_2.html#geometry.reference.algorithms.equals.equals_2.complexity">Complexity</a> 814 </h6> 815<p> 816 Linear 817 </p> 818<h6> 819<a name="geometry.reference.algorithms.equals.equals_2.h8"></a> 820 <span class="phrase"><a name="geometry.reference.algorithms.equals.equals_2.example"></a></span><a class="link" href="equals_2.html#geometry.reference.algorithms.equals.equals_2.example">Example</a> 821 </h6> 822<p> 823 Shows the predicate equals, which returns true if two geometries are 824 spatially equal 825 </p> 826<p> 827</p> 828<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">iostream</span><span class="special">></span> 829 830<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 831<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">polygon</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 832<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">adapted</span><span class="special">/</span><span class="identifier">boost_tuple</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 833 834<span class="identifier">BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS</span><span class="special">(</span><span class="identifier">cs</span><span class="special">::</span><span class="identifier">cartesian</span><span class="special">)</span> 835 836<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">assign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> 837 838<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span> 839<span class="special">{</span> 840 <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">assign</span><span class="special">::</span><span class="identifier">tuple_list_of</span><span class="special">;</span> 841 842 <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">></span> <span class="identifier">point</span><span class="special">;</span> 843 844 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">polygon</span><span class="special"><</span><span class="identifier">point</span><span class="special">></span> <span class="identifier">poly1</span><span class="special">,</span> <span class="identifier">poly2</span><span class="special">;</span> 845 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">exterior_ring</span><span class="special">(</span><span class="identifier">poly1</span><span class="special">)</span> <span class="special">=</span> <span class="identifier">tuple_list_of</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">)(</span><span class="number">0</span><span class="special">,</span> <span class="number">5</span><span class="special">)(</span><span class="number">5</span><span class="special">,</span> <span class="number">5</span><span class="special">)(</span><span class="number">5</span><span class="special">,</span> <span class="number">0</span><span class="special">)(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">);</span> 846 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">exterior_ring</span><span class="special">(</span><span class="identifier">poly2</span><span class="special">)</span> <span class="special">=</span> <span class="identifier">tuple_list_of</span><span class="special">(</span><span class="number">5</span><span class="special">,</span> <span class="number">0</span><span class="special">)(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">)(</span><span class="number">0</span><span class="special">,</span> <span class="number">5</span><span class="special">)(</span><span class="number">5</span><span class="special">,</span> <span class="number">5</span><span class="special">)(</span><span class="number">5</span><span class="special">,</span> <span class="number">0</span><span class="special">);</span> 847 848 <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> 849 <span class="special"><<</span> <span class="string">"polygons are spatially "</span> 850 <span class="special"><<</span> <span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">equals</span><span class="special">(</span><span class="identifier">poly1</span><span class="special">,</span> <span class="identifier">poly2</span><span class="special">)</span> <span class="special">?</span> <span class="string">"equal"</span> <span class="special">:</span> <span class="string">"not equal"</span><span class="special">)</span> 851 <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> 852 853 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">box</span><span class="special"><</span><span class="identifier">point</span><span class="special">></span> <span class="identifier">box</span><span class="special">;</span> 854 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">assign_values</span><span class="special">(</span><span class="identifier">box</span><span class="special">,</span> <span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">,</span> <span class="number">5</span><span class="special">,</span> <span class="number">5</span><span class="special">);</span> 855 856 <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> 857 <span class="special"><<</span> <span class="string">"polygon and box are spatially "</span> 858 <span class="special"><<</span> <span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">equals</span><span class="special">(</span><span class="identifier">box</span><span class="special">,</span> <span class="identifier">poly2</span><span class="special">)</span> <span class="special">?</span> <span class="string">"equal"</span> <span class="special">:</span> <span class="string">"not equal"</span><span class="special">)</span> 859 <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> 860 861 862 <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span> 863<span class="special">}</span> 864</pre> 865<p> 866 </p> 867<p> 868 Output: 869 </p> 870<pre class="programlisting">polygons are spatially equal 871polygon and box are spatially equal 872</pre> 873</div> 874<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 875<td align="left"></td> 876<td align="right"><div class="copyright-footer">Copyright © 2009-2019 Barend Gehrels, Bruno Lalande, Mateusz Loskot, Adam 877 Wulkiewicz, Oracle and/or its affiliates<p> 878 Distributed under the Boost Software License, Version 1.0. (See accompanying 879 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 880 </p> 881</div></td> 882</tr></table> 883<hr> 884<div class="spirit-nav"> 885<a accesskey="p" href="equals_3_with_strategy.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../equals.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../expand.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 886</div> 887</body> 888</html> 889