1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2015, Oracle and/or its affiliates.
4
5 // Licensed under the Boost Software License version 1.0.
6 // http://www.boost.org/users/license.html
7
8 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
9
10 #ifndef BOOST_TEST_MODULE
11 #define BOOST_TEST_MODULE test_difference_pointlike_linear
12 #endif
13
14 #include <iostream>
15 #include <algorithm>
16
17 #include <boost/test/included/unit_test.hpp>
18
19 #include "../test_set_ops_pointlike.hpp"
20
21 #include <boost/geometry/geometries/point.hpp>
22 #include <boost/geometry/geometries/linestring.hpp>
23 #include <boost/geometry/geometries/segment.hpp>
24 #include <boost/geometry/geometries/multi_point.hpp>
25 #include <boost/geometry/geometries/multi_linestring.hpp>
26
27 typedef bg::model::point<double, 2, bg::cs::cartesian> point_type;
28 typedef bg::model::segment<point_type> segment_type;
29 typedef bg::model::linestring<point_type> linestring_type;
30 typedef bg::model::multi_point<point_type> multi_point_type;
31 typedef bg::model::multi_linestring<linestring_type> multi_linestring_type;
32
33
34 //===========================================================================
35 //===========================================================================
36 //===========================================================================
37
38
BOOST_AUTO_TEST_CASE(test_difference_point_segment)39 BOOST_AUTO_TEST_CASE( test_difference_point_segment )
40 {
41 #ifdef BOOST_GEOMETRY_TEST_DEBUG
42 std::cout << "size of std::size_t: " << sizeof(std::size_t) << std::endl;
43 std::cout << "size of range_iterator<multipoint>: "
44 << sizeof(boost::range_iterator<multi_point_type>::type)
45 << std::endl;
46 std::cout << "size of range_iterator<multilinestring>: "
47 << sizeof(boost::range_iterator<multi_linestring_type>::type)
48 << std::endl;
49 std::cout << "size of point_iterator<multipoint>: "
50 << sizeof(bg::point_iterator<multi_point_type>) << std::endl;
51 std::cout << "size of point_iterator<linestring>: "
52 << sizeof(bg::point_iterator<linestring_type>) << std::endl;
53 std::cout << "size of point_iterator<multilinestring>: "
54 << sizeof(bg::point_iterator<multi_linestring_type>) << std::endl;
55 std::cout << "size of segment_iterator<linestring>: "
56 << sizeof(bg::segment_iterator<linestring_type>) << std::endl;
57 std::cout << "size of segment_iterator<multilinestring>: "
58 << sizeof(bg::segment_iterator<multi_linestring_type>) << std::endl;
59
60 std::cout << std::endl << std::endl << std::endl;
61 std::cout << "*** POINT / SEGMENT DIFFERENCE ***" << std::endl;
62 std::cout << std::endl;
63 #endif
64
65 typedef point_type P;
66 typedef segment_type S;
67 typedef multi_point_type MP;
68
69 typedef test_set_op_of_pointlike_geometries
70 <
71 P, S, MP, bg::overlay_difference
72 > tester;
73
74 tester::apply
75 ("psdf01",
76 from_wkt<P>("POINT(0 0)"),
77 from_wkt<S>("SEGMENT(1 1,2 2)"),
78 from_wkt<MP>("MULTIPOINT(0 0)")
79 );
80
81 tester::apply
82 ("psdf02",
83 from_wkt<P>("POINT(0 0)"),
84 from_wkt<S>("SEGMENT(0 0,1 1)"),
85 from_wkt<MP>("MULTIPOINT()")
86 );
87
88 tester::apply
89 ("psdf03",
90 from_wkt<P>("POINT(1 1)"),
91 from_wkt<S>("SEGMENT(0 0,2 2)"),
92 from_wkt<MP>("MULTIPOINT()")
93 );
94
95 tester::apply
96 ("psdf04",
97 from_wkt<P>("POINT(3 3)"),
98 from_wkt<S>("SEGMENT(0 0,2 2)"),
99 from_wkt<MP>("MULTIPOINT(3 3)")
100 );
101 }
102
103
BOOST_AUTO_TEST_CASE(test_difference_point_linestring)104 BOOST_AUTO_TEST_CASE( test_difference_point_linestring )
105 {
106 #ifdef BOOST_GEOMETRY_TEST_DEBUG
107 std::cout << std::endl << std::endl << std::endl;
108 std::cout << "*** POINT / LINESTRING DIFFERENCE ***" << std::endl;
109 std::cout << std::endl;
110 #endif
111
112 typedef point_type P;
113 typedef linestring_type L;
114 typedef multi_point_type MP;
115
116 typedef test_set_op_of_pointlike_geometries
117 <
118 P, L, MP, bg::overlay_difference
119 > tester;
120
121 tester::apply
122 ("pldf01",
123 from_wkt<P>("POINT(0 0)"),
124 from_wkt<L>("LINESTRING(1 1,2 2)"),
125 from_wkt<MP>("MULTIPOINT(0 0)")
126 );
127
128 tester::apply
129 ("pldf02",
130 from_wkt<P>("POINT(0 0)"),
131 from_wkt<L>("LINESTRING(0 0,1 1)"),
132 from_wkt<MP>("MULTIPOINT()")
133 );
134
135 tester::apply
136 ("pldf03",
137 from_wkt<P>("POINT(1 1)"),
138 from_wkt<L>("LINESTRING(0 0,2 2)"),
139 from_wkt<MP>("MULTIPOINT()")
140 );
141
142 tester::apply
143 ("pldf04",
144 from_wkt<P>("POINT(3 3)"),
145 from_wkt<L>("LINESTRING(0 0,2 2)"),
146 from_wkt<MP>("MULTIPOINT(3 3)")
147 );
148
149 // linestrings with more than two points
150 tester::apply
151 ("pldf05",
152 from_wkt<P>("POINT(1 1)"),
153 from_wkt<L>("LINESTRING(0 0,1 1,2 2)"),
154 from_wkt<MP>("MULTIPOINT()")
155 );
156
157 tester::apply
158 ("pldf06",
159 from_wkt<P>("POINT(2 2)"),
160 from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
161 from_wkt<MP>("MULTIPOINT()")
162 );
163
164 tester::apply
165 ("pldf07",
166 from_wkt<P>("POINT(10 10)"),
167 from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
168 from_wkt<MP>("MULTIPOINT(10 10)")
169 );
170
171 tester::apply
172 ("pldf08",
173 from_wkt<P>("POINT(0 1)"),
174 from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
175 from_wkt<MP>("MULTIPOINT(0 1)")
176 );
177
178 tester::apply
179 ("pldf09",
180 from_wkt<P>("POINT(4 4)"),
181 from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
182 from_wkt<MP>("MULTIPOINT()")
183 );
184
185 tester::apply
186 ("pldf10",
187 from_wkt<P>("POINT(0 0)"),
188 from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
189 from_wkt<MP>("MULTIPOINT()")
190 );
191 }
192
193
BOOST_AUTO_TEST_CASE(test_difference_point_multilinestring)194 BOOST_AUTO_TEST_CASE( test_difference_point_multilinestring )
195 {
196 #ifdef BOOST_GEOMETRY_TEST_DEBUG
197 std::cout << std::endl << std::endl << std::endl;
198 std::cout << "*** POINT / MULTILINESTRING DIFFERENCE ***" << std::endl;
199 std::cout << std::endl;
200 #endif
201
202 typedef point_type P;
203 typedef multi_linestring_type ML;
204 typedef multi_point_type MP;
205
206 typedef test_set_op_of_pointlike_geometries
207 <
208 P, ML, MP, bg::overlay_difference
209 > tester;
210
211 tester::apply
212 ("pmldf01",
213 from_wkt<P>("POINT(0 0)"),
214 from_wkt<ML>("MULTILINESTRING((1 1,2 2))"),
215 from_wkt<MP>("MULTIPOINT(0 0)")
216 );
217
218 tester::apply
219 ("pmldf02",
220 from_wkt<P>("POINT(0 0)"),
221 from_wkt<ML>("MULTILINESTRING((0 0,1 1))"),
222 from_wkt<MP>("MULTIPOINT()")
223 );
224
225 tester::apply
226 ("pmldf03",
227 from_wkt<P>("POINT(1 1)"),
228 from_wkt<ML>("MULTILINESTRING((0 0,2 2))"),
229 from_wkt<MP>("MULTIPOINT()")
230 );
231
232 tester::apply
233 ("pmldf04",
234 from_wkt<P>("POINT(3 3)"),
235 from_wkt<ML>("MULTILINESTRING((0 0,2 2))"),
236 from_wkt<MP>("MULTIPOINT(3 3)")
237 );
238
239 // linestrings with more than two points
240 tester::apply
241 ("pmldf05",
242 from_wkt<P>("POINT(1 1)"),
243 from_wkt<ML>("MULTILINESTRING((0 0,1 1,2 2))"),
244 from_wkt<MP>("MULTIPOINT()")
245 );
246
247 tester::apply
248 ("pmldf06",
249 from_wkt<P>("POINT(2 2)"),
250 from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
251 from_wkt<MP>("MULTIPOINT()")
252 );
253
254 tester::apply
255 ("pmldf07",
256 from_wkt<P>("POINT(10 10)"),
257 from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
258 from_wkt<MP>("MULTIPOINT(10 10)")
259 );
260
261 tester::apply
262 ("pmldf08",
263 from_wkt<P>("POINT(0 1)"),
264 from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
265 from_wkt<MP>("MULTIPOINT(0 1)")
266 );
267
268 tester::apply
269 ("pmldf09",
270 from_wkt<P>("POINT(4 4)"),
271 from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
272 from_wkt<MP>("MULTIPOINT()")
273 );
274
275 tester::apply
276 ("pmldf10",
277 from_wkt<P>("POINT(0 0)"),
278 from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
279 from_wkt<MP>("MULTIPOINT()")
280 );
281
282 // multilinestrings with more than one linestring
283 tester::apply
284 ("pmldf11",
285 from_wkt<P>("POINT(0 0)"),
286 from_wkt<ML>("MULTILINESTRING((-10,-10),(0 0,1 1,4 4))"),
287 from_wkt<MP>("MULTIPOINT()")
288 );
289
290 tester::apply
291 ("pmldf12",
292 from_wkt<P>("POINT(0 0)"),
293 from_wkt<ML>("MULTILINESTRING((-10 0,0 0,10 0),(0 0,1 1,4 4))"),
294 from_wkt<MP>("MULTIPOINT()")
295 );
296
297 tester::apply
298 ("pmldf13",
299 from_wkt<P>("POINT(0 0)"),
300 from_wkt<ML>("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"),
301 from_wkt<MP>("MULTIPOINT()")
302 );
303
304 tester::apply
305 ("pmldf14",
306 from_wkt<P>("POINT(-20 0)"),
307 from_wkt<ML>("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"),
308 from_wkt<MP>("MULTIPOINT(-20 0)")
309 );
310
311 tester::apply
312 ("pmldf15",
313 from_wkt<P>("POINT(0 1)"),
314 from_wkt<ML>("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"),
315 from_wkt<MP>("MULTIPOINT(0 1)")
316 );
317 }
318
319
BOOST_AUTO_TEST_CASE(test_difference_multipoint_segment)320 BOOST_AUTO_TEST_CASE( test_difference_multipoint_segment )
321 {
322 #ifdef BOOST_GEOMETRY_TEST_DEBUG
323 std::cout << std::endl << std::endl << std::endl;
324 std::cout << "*** MULTIPOINT / SEGMENT DIFFERENCE ***" << std::endl;
325 std::cout << std::endl;
326 #endif
327
328 typedef multi_point_type MP;
329 typedef segment_type S;
330
331 typedef test_set_op_of_pointlike_geometries
332 <
333 MP, S, MP, bg::overlay_difference
334 > tester;
335
336 tester::apply
337 ("mpsdf01",
338 from_wkt<MP>("MULTIPOINT(0 0)"),
339 from_wkt<S>("SEGMENT(1 1,2 2)"),
340 from_wkt<MP>("MULTIPOINT(0 0)")
341 );
342
343 tester::apply
344 ("mpsdf02",
345 from_wkt<MP>("MULTIPOINT(0 0)"),
346 from_wkt<S>("SEGMENT(0 0,1 1)"),
347 from_wkt<MP>("MULTIPOINT()")
348 );
349
350 tester::apply
351 ("mpsdf03",
352 from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
353 from_wkt<S>("SEGMENT(1 1,2 2)"),
354 from_wkt<MP>("MULTIPOINT(0 0,0 0)")
355 );
356
357 tester::apply
358 ("mpsdf04",
359 from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
360 from_wkt<S>("SEGMENT(0 0,1 1)"),
361 from_wkt<MP>("MULTIPOINT()")
362 );
363
364 tester::apply
365 ("mpsdf05",
366 from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
367 from_wkt<S>("SEGMENT(1 1,2 2)"),
368 from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)")
369 );
370
371 tester::apply
372 ("mpsf06",
373 from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
374 from_wkt<S>("SEGMENT(1 0,2 0)"),
375 from_wkt<MP>("MULTIPOINT(0 0,0 0)")
376 );
377
378 tester::apply
379 ("mpsdf07",
380 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
381 from_wkt<S>("SEGMENT(0 0,1 0)"),
382 from_wkt<MP>("MULTIPOINT(2 0)")
383 );
384
385 tester::apply
386 ("mpsdf08",
387 from_wkt<MP>("MULTIPOINT()"),
388 from_wkt<S>("SEGMENT(0 0,1 1)"),
389 from_wkt<MP>("MULTIPOINT()")
390 );
391
392 tester::apply
393 ("mpsdf09",
394 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
395 from_wkt<S>("SEGMENT(-1 0,1 0)"),
396 from_wkt<MP>("MULTIPOINT(2 0)")
397 );
398
399 tester::apply
400 ("mpsdf10",
401 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
402 from_wkt<S>("SEGMENT(1 0,3 0)"),
403 from_wkt<MP>("MULTIPOINT(0 0,0 0)")
404 );
405
406 tester::apply
407 ("mpsdf11",
408 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
409 from_wkt<S>("SEGMENT(-1 0,3 0)"),
410 from_wkt<MP>("MULTIPOINT()")
411 );
412
413 tester::apply
414 ("mpsdf12",
415 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
416 from_wkt<S>("SEGMENT(3 0,3 0)"),
417 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)")
418 );
419
420 tester::apply
421 ("mpsdf12a",
422 from_wkt<MP>("MULTIPOINT(0 0,2 0,0 0)"),
423 from_wkt<S>("SEGMENT(3 0,3 0)"),
424 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)")
425 );
426
427 tester::apply
428 ("mpsdf12b",
429 from_wkt<MP>("MULTIPOINT(0 0,2 0,0 0,2 0)"),
430 from_wkt<S>("SEGMENT(3 0,3 0)"),
431 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0,2 0)")
432 );
433
434 tester::apply
435 ("mpsdf12c",
436 from_wkt<MP>("MULTIPOINT(0 0,2 0,0 0,2 0,0 0)"),
437 from_wkt<S>("SEGMENT(3 0,3 0)"),
438 from_wkt<MP>("MULTIPOINT(0 0,0 0,0 0,2 0,2 0)")
439 );
440
441 tester::apply
442 ("mpsdf13",
443 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
444 from_wkt<S>("SEGMENT(2 0,2 0)"),
445 from_wkt<MP>("MULTIPOINT(0 0,0 0)")
446 );
447
448 tester::apply
449 ("mpsdf14",
450 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
451 from_wkt<S>("SEGMENT(0 0,0 0)"),
452 from_wkt<MP>("MULTIPOINT(2 0)")
453 );
454
455 tester::apply
456 ("mpsdf15",
457 from_wkt<MP>("MULTIPOINT()"),
458 from_wkt<S>("SEGMENT(0 0,1 0)"),
459 from_wkt<MP>("MULTIPOINT()")
460 );
461 }
462
463
BOOST_AUTO_TEST_CASE(test_difference_multipoint_linestring)464 BOOST_AUTO_TEST_CASE( test_difference_multipoint_linestring )
465 {
466 #ifdef BOOST_GEOMETRY_TEST_DEBUG
467 std::cout << std::endl << std::endl << std::endl;
468 std::cout << "*** MULTIPOINT / LINESTRING DIFFERENCE ***" << std::endl;
469 std::cout << std::endl;
470 #endif
471
472 typedef multi_point_type MP;
473 typedef linestring_type L;
474
475 typedef test_set_op_of_pointlike_geometries
476 <
477 MP, L, MP, bg::overlay_difference
478 > tester;
479
480 tester::apply
481 ("mpldf01",
482 from_wkt<MP>("MULTIPOINT(0 0)"),
483 from_wkt<L>("LINESTRING(1 1,2 2,3 3,4 4,5 5)"),
484 from_wkt<MP>("MULTIPOINT(0 0)")
485 );
486
487 tester::apply
488 ("mpldf02",
489 from_wkt<MP>("MULTIPOINT(0 0)"),
490 from_wkt<L>("LINESTRING(0 0,1 1)"),
491 from_wkt<MP>("MULTIPOINT()")
492 );
493
494 tester::apply
495 ("mpldf03",
496 from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
497 from_wkt<L>("LINESTRING(1 1,2 2)"),
498 from_wkt<MP>("MULTIPOINT(0 0,0 0)")
499 );
500
501 tester::apply
502 ("mpldf04",
503 from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
504 from_wkt<L>("LINESTRING(0 0,1 1)"),
505 from_wkt<MP>("MULTIPOINT()")
506 );
507
508 tester::apply
509 ("mpldf05",
510 from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
511 from_wkt<L>("LINESTRING(1 1,2 2)"),
512 from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)")
513 );
514
515 tester::apply
516 ("mplf06",
517 from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
518 from_wkt<L>("LINESTRING(1 0,2 0)"),
519 from_wkt<MP>("MULTIPOINT(0 0,0 0)")
520 );
521
522 tester::apply
523 ("mpldf07",
524 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
525 from_wkt<L>("LINESTRING(0 0,1 0)"),
526 from_wkt<MP>("MULTIPOINT(2 0)")
527 );
528
529 tester::apply
530 ("mpldf08",
531 from_wkt<MP>("MULTIPOINT()"),
532 from_wkt<L>("LINESTRING(0 0,1 1)"),
533 from_wkt<MP>("MULTIPOINT()")
534 );
535
536 tester::apply
537 ("mpldf09",
538 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
539 from_wkt<L>("LINESTRING(-1 0,1 0)"),
540 from_wkt<MP>("MULTIPOINT(2 0)")
541 );
542
543 tester::apply
544 ("mpldf10",
545 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
546 from_wkt<L>("LINESTRING(1 0,3 0)"),
547 from_wkt<MP>("MULTIPOINT(0 0,0 0)")
548 );
549
550 tester::apply
551 ("mpldf11",
552 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
553 from_wkt<L>("LINESTRING(-1 0,3 0)"),
554 from_wkt<MP>("MULTIPOINT()")
555 );
556
557 tester::apply
558 ("mpldf12",
559 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
560 from_wkt<L>("LINESTRING(3 0,3 0)"),
561 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)")
562 );
563
564 tester::apply
565 ("mpldf13",
566 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
567 from_wkt<L>("LINESTRING(2 0,2 0)"),
568 from_wkt<MP>("MULTIPOINT(0 0,0 0)")
569 );
570
571 tester::apply
572 ("mpldf14",
573 from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
574 from_wkt<L>("LINESTRING(0 0,0 0)"),
575 from_wkt<MP>("MULTIPOINT(2 0)")
576 );
577
578 tester::apply
579 ("mpldf15",
580 from_wkt<MP>("MULTIPOINT()"),
581 from_wkt<L>("LINESTRING(0 0,1 0,2 0,3 0)"),
582 from_wkt<MP>("MULTIPOINT()")
583 );
584
585 tester::apply
586 ("mpldf16",
587 from_wkt<MP>("MULTIPOINT()"),
588 from_wkt<L>("LINESTRING()"),
589 from_wkt<MP>("MULTIPOINT()")
590 );
591 }
592
593
BOOST_AUTO_TEST_CASE(test_difference_multipoint_multilinestring)594 BOOST_AUTO_TEST_CASE( test_difference_multipoint_multilinestring )
595 {
596 #ifdef BOOST_GEOMETRY_TEST_DEBUG
597 std::cout << std::endl << std::endl << std::endl;
598 std::cout << "*** MULTIPOINT / MULTILINESTRING DIFFERENCE ***" << std::endl;
599 std::cout << std::endl;
600 #endif
601
602 typedef multi_point_type MP;
603 typedef multi_linestring_type ML;
604
605 typedef test_set_op_of_pointlike_geometries
606 <
607 MP, ML, MP, bg::overlay_difference
608 > tester;
609
610 tester::apply
611 ("mpmldf01",
612 from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0)"),
613 from_wkt<ML>("MULTILINESTRING((1 0,1 1,1 1,4 4))"),
614 from_wkt<MP>("MULTIPOINT(0 0,2 0)")
615 );
616
617 tester::apply
618 ("mpmldf02",
619 from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
620 from_wkt<ML>("MULTILINESTRING((1 0,1 1,1 1,4 4))"),
621 from_wkt<MP>("MULTIPOINT(0 0,0 0)")
622 );
623
624 tester::apply
625 ("mpmldf03",
626 from_wkt<MP>("MULTIPOINT(5 5,3 3,0 0,0 0,5 5,1 1,1 1,1 0,1 0)"),
627 from_wkt<ML>("MULTILINESTRING((1 0,1 1,1 1,4 4))"),
628 from_wkt<MP>("MULTIPOINT(5 5,5 5,0 0,0 0)")
629 );
630
631 tester::apply
632 ("mpmldf04",
633 from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
634 from_wkt<ML>("MULTILINESTRING((1 0,0 0,1 1,0 0))"),
635 from_wkt<MP>("MULTIPOINT()")
636 );
637
638 tester::apply
639 ("mpmldf05",
640 from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0,5 0)"),
641 from_wkt<ML>("MULTILINESTRING((0 1,0 0,1 2,1 0),\
642 (0 1,2 0,0 10,2 0,2 10,5 10,5 0,5 10))"),
643 from_wkt<MP>("MULTIPOINT()")
644 );
645
646 tester::apply
647 ("mpmldf05a",
648 from_wkt<MP>("MULTIPOINT(0 0,1 0,6 0,7 0,2 0,5 0,7 0,8 0)"),
649 from_wkt<ML>("MULTILINESTRING((0 1,0 0,1 2,1 0),\
650 (0 1,2 0,0 10,2 0,2 10,5 10,5 0,5 10))"),
651 from_wkt<MP>("MULTIPOINT(7 0,7 0,8 0,6 0)")
652 );
653
654 tester::apply
655 ("mpmldf06",
656 from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
657 from_wkt<ML>("MULTILINESTRING(())"),
658 from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)")
659 );
660
661 tester::apply
662 ("mpmldf07",
663 from_wkt<MP>("MULTIPOINT()"),
664 from_wkt<ML>("MULTILINESTRING(())"),
665 from_wkt<MP>("MULTIPOINT()")
666 );
667
668 tester::apply
669 ("mpmldf08",
670 from_wkt<MP>("MULTIPOINT()"),
671 from_wkt<ML>("MULTILINESTRING((0 0,1 0),(9 0,10 0))"),
672 from_wkt<MP>("MULTIPOINT()")
673 );
674 }
675