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_intersection_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_intersection_point_segment)39 BOOST_AUTO_TEST_CASE( test_intersection_point_segment )
40 {
41 #ifdef BOOST_GEOMETRY_TEST_DEBUG
42     std::cout << std::endl << std::endl << std::endl;
43     std::cout << "*** POINT / SEGMENT INTERSECTION ***" << std::endl;
44     std::cout << std::endl;
45 #endif
46 
47     typedef point_type P;
48     typedef segment_type S;
49     typedef multi_point_type MP;
50 
51     typedef test_set_op_of_pointlike_geometries
52         <
53             P, S, MP, bg::overlay_intersection
54         > tester;
55 
56     tester::apply
57         ("psi01",
58          from_wkt<P>("POINT(0 0)"),
59          from_wkt<S>("SEGMENT(1 1,2 2)"),
60          from_wkt<MP>("MULTIPOINT()")
61          );
62 
63     tester::apply
64         ("psi02",
65          from_wkt<P>("POINT(0 0)"),
66          from_wkt<S>("SEGMENT(0 0,1 1)"),
67          from_wkt<MP>("MULTIPOINT(0 0)")
68          );
69 
70     tester::apply
71         ("psi03",
72          from_wkt<P>("POINT(1 1)"),
73          from_wkt<S>("SEGMENT(0 0,2 2)"),
74          from_wkt<MP>("MULTIPOINT(1 1)")
75          );
76 
77     tester::apply
78         ("psi04",
79          from_wkt<P>("POINT(3 3)"),
80          from_wkt<S>("SEGMENT(0 0,2 2)"),
81          from_wkt<MP>("MULTIPOINT()")
82          );
83 }
84 
85 
BOOST_AUTO_TEST_CASE(test_intersection_point_linestring)86 BOOST_AUTO_TEST_CASE( test_intersection_point_linestring )
87 {
88 #ifdef BOOST_GEOMETRY_TEST_DEBUG
89     std::cout << std::endl << std::endl << std::endl;
90     std::cout << "*** POINT / LINESTRING INTERSECTION ***" << std::endl;
91     std::cout << std::endl;
92 #endif
93 
94     typedef point_type P;
95     typedef linestring_type L;
96     typedef multi_point_type MP;
97 
98     typedef test_set_op_of_pointlike_geometries
99         <
100             P, L, MP, bg::overlay_intersection
101         > tester;
102 
103     tester::apply
104         ("pli01",
105          from_wkt<P>("POINT(0 0)"),
106          from_wkt<L>("LINESTRING(1 1,2 2)"),
107          from_wkt<MP>("MULTIPOINT()")
108          );
109 
110     tester::apply
111         ("pli02",
112          from_wkt<P>("POINT(0 0)"),
113          from_wkt<L>("LINESTRING(0 0,1 1)"),
114          from_wkt<MP>("MULTIPOINT(0 0)")
115          );
116 
117     tester::apply
118         ("pli03",
119          from_wkt<P>("POINT(1 1)"),
120          from_wkt<L>("LINESTRING(0 0,2 2)"),
121          from_wkt<MP>("MULTIPOINT(1 1)")
122          );
123 
124     tester::apply
125         ("pli04",
126          from_wkt<P>("POINT(3 3)"),
127          from_wkt<L>("LINESTRING(0 0,2 2)"),
128          from_wkt<MP>("MULTIPOINT()")
129          );
130 
131     // linestrings with more than two points
132     tester::apply
133         ("pli05",
134          from_wkt<P>("POINT(1 1)"),
135          from_wkt<L>("LINESTRING(0 0,1 1,2 2)"),
136          from_wkt<MP>("MULTIPOINT(1 1)")
137          );
138 
139     tester::apply
140         ("pli06",
141          from_wkt<P>("POINT(2 2)"),
142          from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
143          from_wkt<MP>("MULTIPOINT(2 2)")
144          );
145 
146     tester::apply
147         ("pli07",
148          from_wkt<P>("POINT(10 10)"),
149          from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
150          from_wkt<MP>("MULTIPOINT()")
151          );
152 
153     tester::apply
154         ("pli08",
155          from_wkt<P>("POINT(0 1)"),
156          from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
157          from_wkt<MP>("MULTIPOINT()")
158          );
159 
160     tester::apply
161         ("pli09",
162          from_wkt<P>("POINT(4 4)"),
163          from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
164          from_wkt<MP>("MULTIPOINT(4 4)")
165          );
166 
167     tester::apply
168         ("pli10",
169          from_wkt<P>("POINT(0 0)"),
170          from_wkt<L>("LINESTRING(0 0,1 1,4 4)"),
171          from_wkt<MP>("MULTIPOINT(0 0)")
172          );
173 }
174 
175 
BOOST_AUTO_TEST_CASE(test_intersection_point_multilinestring)176 BOOST_AUTO_TEST_CASE( test_intersection_point_multilinestring )
177 {
178 #ifdef BOOST_GEOMETRY_TEST_DEBUG
179     std::cout << std::endl << std::endl << std::endl;
180     std::cout << "*** POINT / MULTILINESTRING INTERSECTION ***" << std::endl;
181     std::cout << std::endl;
182 #endif
183 
184     typedef point_type P;
185     typedef multi_linestring_type ML;
186     typedef multi_point_type MP;
187 
188     typedef test_set_op_of_pointlike_geometries
189         <
190             P, ML, MP, bg::overlay_intersection
191         > tester;
192 
193     tester::apply
194         ("pmli01",
195          from_wkt<P>("POINT(0 0)"),
196          from_wkt<ML>("MULTILINESTRING((1 1,2 2))"),
197          from_wkt<MP>("MULTIPOINT()")
198          );
199 
200     tester::apply
201         ("pmli02",
202          from_wkt<P>("POINT(0 0)"),
203          from_wkt<ML>("MULTILINESTRING((0 0,1 1))"),
204          from_wkt<MP>("MULTIPOINT(0 0)")
205          );
206 
207     tester::apply
208         ("pmli03",
209          from_wkt<P>("POINT(1 1)"),
210          from_wkt<ML>("MULTILINESTRING((0 0,2 2))"),
211          from_wkt<MP>("MULTIPOINT(1 1)")
212          );
213 
214     tester::apply
215         ("pmli04",
216          from_wkt<P>("POINT(3 3)"),
217          from_wkt<ML>("MULTILINESTRING((0 0,2 2))"),
218          from_wkt<MP>("MULTIPOINT()")
219          );
220 
221     // linestrings with more than two points
222     tester::apply
223         ("pmli05",
224          from_wkt<P>("POINT(1 1)"),
225          from_wkt<ML>("MULTILINESTRING((0 0,1 1,2 2))"),
226          from_wkt<MP>("MULTIPOINT(1 1)")
227          );
228 
229     tester::apply
230         ("pmli06",
231          from_wkt<P>("POINT(2 2)"),
232          from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
233          from_wkt<MP>("MULTIPOINT(2 2)")
234          );
235 
236     tester::apply
237         ("pmli07",
238          from_wkt<P>("POINT(10 10)"),
239          from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
240          from_wkt<MP>("MULTIPOINT()")
241          );
242 
243     tester::apply
244         ("pmli08",
245          from_wkt<P>("POINT(0 1)"),
246          from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
247          from_wkt<MP>("MULTIPOINT()")
248          );
249 
250     tester::apply
251         ("pmli09",
252          from_wkt<P>("POINT(4 4)"),
253          from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
254          from_wkt<MP>("MULTIPOINT(4 4)")
255          );
256 
257     tester::apply
258         ("pmli10",
259          from_wkt<P>("POINT(0 0)"),
260          from_wkt<ML>("MULTILINESTRING((0 0,1 1,4 4))"),
261          from_wkt<MP>("MULTIPOINT(0 0)")
262          );
263 
264     // multilinestrings with more than one linestring
265     tester::apply
266         ("pmli11",
267          from_wkt<P>("POINT(0 0)"),
268          from_wkt<ML>("MULTILINESTRING((-10,-10),(0 0,1 1,4 4))"),
269          from_wkt<MP>("MULTIPOINT(0 0)")
270          );
271 
272     tester::apply
273         ("pmli12",
274          from_wkt<P>("POINT(0 0)"),
275          from_wkt<ML>("MULTILINESTRING((-10 0,0 0,10 0),(0 0,1 1,4 4))"),
276          from_wkt<MP>("MULTIPOINT(0 0)")
277          );
278 
279     tester::apply
280         ("pmli13",
281          from_wkt<P>("POINT(0 0)"),
282          from_wkt<ML>("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"),
283          from_wkt<MP>("MULTIPOINT(0 0)")
284          );
285 
286     tester::apply
287         ("pmli14",
288          from_wkt<P>("POINT(-20 0)"),
289          from_wkt<ML>("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"),
290          from_wkt<MP>("MULTIPOINT()")
291          );
292 
293     tester::apply
294         ("pmli15",
295          from_wkt<P>("POINT(0 1)"),
296          from_wkt<ML>("MULTILINESTRING((-10 0,10 0),(0 0,1 1,4 4))"),
297          from_wkt<MP>("MULTIPOINT()")
298          );
299 
300     tester::apply
301         ("pmli16",
302          from_wkt<P>("POINT(1 0)"),
303          from_wkt<ML>("MULTILINESTRING((-10 0,10 0),(-1 0,2 0,20 0))"),
304          from_wkt<MP>("MULTIPOINT(1 0)")
305          );
306 
307     tester::apply
308         ("pmli17",
309          from_wkt<P>("POINT(1 0)"),
310          from_wkt<ML>("MULTILINESTRING((-10 0,10 0),(0 -1,0 2,0 4))"),
311          from_wkt<MP>("MULTIPOINT(1 0)")
312          );
313 }
314 
315 
BOOST_AUTO_TEST_CASE(test_intersection_multipoint_segment)316 BOOST_AUTO_TEST_CASE( test_intersection_multipoint_segment )
317 {
318 #ifdef BOOST_GEOMETRY_TEST_DEBUG
319     std::cout << std::endl << std::endl << std::endl;
320     std::cout << "*** MULTIPOINT / SEGMENT INTERSECTION ***" << std::endl;
321     std::cout << std::endl;
322 #endif
323 
324     typedef multi_point_type MP;
325     typedef segment_type S;
326 
327     typedef test_set_op_of_pointlike_geometries
328         <
329             MP, S, MP, bg::overlay_intersection
330         > tester;
331 
332     tester::apply
333         ("mpsi01",
334          from_wkt<MP>("MULTIPOINT(0 0)"),
335          from_wkt<S>("SEGMENT(1 1,2 2)"),
336          from_wkt<MP>("MULTIPOINT()")
337          );
338 
339     tester::apply
340         ("mpsi02",
341          from_wkt<MP>("MULTIPOINT(0 0)"),
342          from_wkt<S>("SEGMENT(0 0,1 1)"),
343          from_wkt<MP>("MULTIPOINT(0 0)")
344          );
345 
346     tester::apply
347         ("mpsi03",
348          from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
349          from_wkt<S>("SEGMENT(1 1,2 2)"),
350          from_wkt<MP>("MULTIPOINT()")
351          );
352 
353     tester::apply
354         ("mpsi04",
355          from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
356          from_wkt<S>("SEGMENT(0 0,1 1)"),
357          from_wkt<MP>("MULTIPOINT(0 0,0 0)")
358          );
359 
360     tester::apply
361         ("mpsi05",
362          from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
363          from_wkt<S>("SEGMENT(1 1,2 2)"),
364          from_wkt<MP>("MULTIPOINT()")
365          );
366 
367     tester::apply
368         ("mpsf06",
369          from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
370          from_wkt<S>("SEGMENT(1 0,2 0)"),
371          from_wkt<MP>("MULTIPOINT(1 0)")
372          );
373 
374     tester::apply
375         ("mpsi07",
376          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
377          from_wkt<S>("SEGMENT(0 0,1 0)"),
378          from_wkt<MP>("MULTIPOINT(0 0,0 0)")
379          );
380 
381     tester::apply
382         ("mpsi07a",
383          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
384          from_wkt<S>("SEGMENT(0 0,3 0)"),
385          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)")
386          );
387 
388     tester::apply
389         ("mpsi08",
390          from_wkt<MP>("MULTIPOINT()"),
391          from_wkt<S>("SEGMENT(0 0,1 1)"),
392          from_wkt<MP>("MULTIPOINT()")
393          );
394 
395     tester::apply
396         ("mpsi09",
397          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
398          from_wkt<S>("SEGMENT(-1 0,1 0)"),
399          from_wkt<MP>("MULTIPOINT(0 0,0 0)")
400          );
401 
402     tester::apply
403         ("mpsi10",
404          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
405          from_wkt<S>("SEGMENT(1 0,3 0)"),
406          from_wkt<MP>("MULTIPOINT(2 0)")
407          );
408 
409     tester::apply
410         ("mpsi11",
411          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
412          from_wkt<S>("SEGMENT(-1 0,3 0)"),
413          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)")
414          );
415 
416     tester::apply
417         ("mpsi12",
418          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
419          from_wkt<S>("SEGMENT(3 0,3 0)"),
420          from_wkt<MP>("MULTIPOINT()")
421          );
422 
423     tester::apply
424         ("mpsi12a",
425          from_wkt<MP>("MULTIPOINT(0 0,2 0,0 0)"),
426          from_wkt<S>("SEGMENT(3 0,3 0)"),
427          from_wkt<MP>("MULTIPOINT()")
428          );
429 
430     tester::apply
431         ("mpsi12b",
432          from_wkt<MP>("MULTIPOINT(0 0,2 0,0 0,2 0)"),
433          from_wkt<S>("SEGMENT(3 0,3 0)"),
434          from_wkt<MP>("MULTIPOINT()")
435          );
436 
437     tester::apply
438         ("mpsi12c",
439          from_wkt<MP>("MULTIPOINT(0 0,2 0,0 0,2 0,0 0)"),
440          from_wkt<S>("SEGMENT(3 0,3 0)"),
441          from_wkt<MP>("MULTIPOINT()")
442          );
443 
444     tester::apply
445         ("mpsi13",
446          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
447          from_wkt<S>("SEGMENT(2 0,2 0)"),
448          from_wkt<MP>("MULTIPOINT(2 0)")
449          );
450 
451     tester::apply
452         ("mpsi14",
453          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
454          from_wkt<S>("SEGMENT(0 0,0 0)"),
455          from_wkt<MP>("MULTIPOINT(0 0,0 0)")
456          );
457 
458     tester::apply
459         ("mpsi15",
460          from_wkt<MP>("MULTIPOINT()"),
461          from_wkt<S>("SEGMENT(0 0,1 0)"),
462          from_wkt<MP>("MULTIPOINT()")
463          );
464 
465     tester::apply
466         ("mpsi16",
467          from_wkt<MP>("MULTIPOINT(0 0,2 0,0 0,2 0,0 0)"),
468          from_wkt<S>("SEGMENT(-1 0,10 0)"),
469          from_wkt<MP>("MULTIPOINT(0 0,0 0,0 0,2 0,2 0)")
470          );
471 }
472 
473 
BOOST_AUTO_TEST_CASE(test_intersection_multipoint_linestring)474 BOOST_AUTO_TEST_CASE( test_intersection_multipoint_linestring )
475 {
476 #ifdef BOOST_GEOMETRY_TEST_DEBUG
477     std::cout << std::endl << std::endl << std::endl;
478     std::cout << "*** MULTIPOINT / LINESTRING INTERSECTION ***" << std::endl;
479     std::cout << std::endl;
480 #endif
481 
482     typedef multi_point_type MP;
483     typedef linestring_type L;
484 
485     typedef test_set_op_of_pointlike_geometries
486         <
487             MP, L, MP, bg::overlay_intersection
488         > tester;
489 
490     tester::apply
491         ("mpli01",
492          from_wkt<MP>("MULTIPOINT(0 0)"),
493          from_wkt<L>("LINESTRING(1 1,2 2,3 3,4 4,5 5)"),
494          from_wkt<MP>("MULTIPOINT()")
495          );
496 
497     tester::apply
498         ("mpli02",
499          from_wkt<MP>("MULTIPOINT(0 0)"),
500          from_wkt<L>("LINESTRING(0 0,1 1)"),
501          from_wkt<MP>("MULTIPOINT(0 0)")
502          );
503 
504     tester::apply
505         ("mpli03",
506          from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
507          from_wkt<L>("LINESTRING(1 1,2 2)"),
508          from_wkt<MP>("MULTIPOINT()")
509          );
510 
511     tester::apply
512         ("mpli04",
513          from_wkt<MP>("MULTIPOINT(0 0,0 0)"),
514          from_wkt<L>("LINESTRING(0 0,1 1)"),
515          from_wkt<MP>("MULTIPOINT(0 0,0 0)")
516          );
517 
518     tester::apply
519         ("mpli05",
520          from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
521          from_wkt<L>("LINESTRING(1 1,2 2)"),
522          from_wkt<MP>("MULTIPOINT()")
523          );
524 
525     tester::apply
526         ("mpli06",
527          from_wkt<MP>("MULTIPOINT(0 0,0 0,1 0)"),
528          from_wkt<L>("LINESTRING(1 0,2 0)"),
529          from_wkt<MP>("MULTIPOINT(1 0)")
530          );
531 
532     tester::apply
533         ("mpli07",
534          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
535          from_wkt<L>("LINESTRING(0 0,1 0)"),
536          from_wkt<MP>("MULTIPOINT(0 0,0 0)")
537          );
538 
539     tester::apply
540         ("mpli08",
541          from_wkt<MP>("MULTIPOINT()"),
542          from_wkt<L>("LINESTRING(0 0,1 1)"),
543          from_wkt<MP>("MULTIPOINT()")
544          );
545 
546     tester::apply
547         ("mpli09",
548          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
549          from_wkt<L>("LINESTRING(-1 0,1 0)"),
550          from_wkt<MP>("MULTIPOINT(0 0,0 0)")
551          );
552 
553     tester::apply
554         ("mpli10",
555          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
556          from_wkt<L>("LINESTRING(1 0,3 0)"),
557          from_wkt<MP>("MULTIPOINT(2 0)")
558          );
559 
560     tester::apply
561         ("mpli10a",
562          from_wkt<MP>("MULTIPOINT(2 0,0 0,2 0,0 0,2 0)"),
563          from_wkt<L>("LINESTRING(1 0,3 0)"),
564          from_wkt<MP>("MULTIPOINT(2 0,2 0,2 0)")
565          );
566 
567     tester::apply
568         ("mpli11",
569          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
570          from_wkt<L>("LINESTRING(-1 0,3 0)"),
571          from_wkt<MP>("MULTIPOINT(2 0,0 0,0 0)")
572          );
573 
574     tester::apply
575         ("mpli12",
576          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
577          from_wkt<L>("LINESTRING(3 0,3 0)"),
578          from_wkt<MP>("MULTIPOINT()")
579          );
580 
581     tester::apply
582         ("mpli13",
583          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
584          from_wkt<L>("LINESTRING(2 0,2 0)"),
585          from_wkt<MP>("MULTIPOINT(2 0)")
586          );
587 
588     tester::apply
589         ("mpli14",
590          from_wkt<MP>("MULTIPOINT(0 0,0 0,2 0)"),
591          from_wkt<L>("LINESTRING(0 0,0 0)"),
592          from_wkt<MP>("MULTIPOINT(0 0,0 0)")
593          );
594 
595     tester::apply
596         ("mpli15",
597          from_wkt<MP>("MULTIPOINT()"),
598          from_wkt<L>("LINESTRING(0 0,1 0,2 0,3 0)"),
599          from_wkt<MP>("MULTIPOINT()")
600          );
601 
602     tester::apply
603         ("mpli16",
604          from_wkt<MP>("MULTIPOINT()"),
605          from_wkt<L>("LINESTRING()"),
606          from_wkt<MP>("MULTIPOINT()")
607          );
608 }
609 
610 
BOOST_AUTO_TEST_CASE(test_intersection_multipoint_multilinestring)611 BOOST_AUTO_TEST_CASE( test_intersection_multipoint_multilinestring )
612 {
613 #ifdef BOOST_GEOMETRY_TEST_DEBUG
614     std::cout << std::endl << std::endl << std::endl;
615     std::cout << "*** MULTIPOINT / MULTILINESTRING INTERSECTION ***"
616               << std::endl;
617     std::cout << std::endl;
618 #endif
619 
620     typedef multi_point_type MP;
621     typedef multi_linestring_type ML;
622 
623     typedef test_set_op_of_pointlike_geometries
624         <
625             MP, ML, MP, bg::overlay_intersection
626         > tester;
627 
628     tester::apply
629         ("mpmli01",
630          from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0)"),
631          from_wkt<ML>("MULTILINESTRING((1 0,1 1,1 1,4 4))"),
632          from_wkt<MP>("MULTIPOINT(1 0)")
633          );
634 
635     tester::apply
636         ("mpmli02",
637          from_wkt<MP>("MULTIPOINT(2 2,3 3,0 0,0 0,2 2,1 1,1 1,1 0,1 0)"),
638          from_wkt<ML>("MULTILINESTRING((1 0,1 1,1 1,4 4))"),
639          from_wkt<MP>("MULTIPOINT(2 2,2 2,3 3,1 1,1 1,1 0,1 0)")
640          );
641 
642     tester::apply
643         ("mpmli03",
644          from_wkt<MP>("MULTIPOINT(5 5,3 3,0 0,0 0,5 5,1 1,1 1,1 0,1 0)"),
645          from_wkt<ML>("MULTILINESTRING((1 0,1 1,1 1,4 4))"),
646          from_wkt<MP>("MULTIPOINT(1 0,1 0,3 3,1 1,1 1)")
647          );
648 
649     tester::apply
650         ("mpmli04",
651          from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
652          from_wkt<ML>("MULTILINESTRING((1 0,0 0,1 1,0 0))"),
653          from_wkt<MP>("MULTIPOINT(1 0,0 0,1 1,1 1)")
654          );
655 
656     tester::apply
657         ("mpmli05",
658          from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0,5 0)"),
659          from_wkt<ML>("MULTILINESTRING((0 1,0 0,1 2,1 0),\
660                       (0 1,2 0,0 10,2 0,2 10,5 10,5 0,5 10))"),
661          from_wkt<MP>("MULTIPOINT(0 0,1 0,2 0,5 0)")
662          );
663 
664     tester::apply
665         ("mpmli06",
666          from_wkt<MP>("MULTIPOINT(0 0,1 1,1 0,1 1)"),
667          from_wkt<ML>("MULTILINESTRING(())"),
668          from_wkt<MP>("MULTIPOINT()")
669          );
670 
671     tester::apply
672         ("mpmli07",
673          from_wkt<MP>("MULTIPOINT()"),
674          from_wkt<ML>("MULTILINESTRING(())"),
675          from_wkt<MP>("MULTIPOINT()")
676          );
677 
678     tester::apply
679         ("mpmli08",
680          from_wkt<MP>("MULTIPOINT()"),
681          from_wkt<ML>("MULTILINESTRING((0 0,1 0),(9 0,10 0))"),
682          from_wkt<MP>("MULTIPOINT()")
683          );
684 
685     tester::apply
686         ("mpmli09",
687          from_wkt<MP>("MULTIPOINT(0 0,1 1,0 0,0 0,0 0,0 0,0 0,0 0,\
688                       0 0,0 0,0 0,0 0,0 0)"),
689          from_wkt<ML>("MULTILINESTRING((0 0,0 1),(0 0,2 0),(0 0,0 3),\
690                       (0 0,4 0),(0 0,0 5),(0 0,6 0),(0 0,7 0),(0 0,8 0))"),
691          from_wkt<MP>("MULTIPOINT(0 0,0 0,0 0,0 0,0 0,0 0,0 0,\
692                       0 0,0 0,0 0,0 0,0 0)")
693          );
694 
695     tester::apply
696         ("mpmli09a",
697          from_wkt<MP>("MULTIPOINT(0 0,1 1,0 0)"),
698          from_wkt<ML>("MULTILINESTRING((0 0,0 1),(0 0,2 0),(0 0,0 3),\
699                       (0 0,4 0),(0 0,0 5),(0 0,6 0),(0 0,7 0),(0 0,8 0))"),
700          from_wkt<MP>("MULTIPOINT(0 0,0 0)")
701          );
702 }
703