Geometry_test.cpp
Go to the documentation of this file.
1 //=============================================================================
2 // Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3 // Author: Gonzalo Mier
4 // BSD-3 License
5 //=============================================================================
6 
7 #include <gtest/gtest.h>
8 #include "fields2cover/types.h"
9 
10 template <class T>
11 class fields2cover_types_geometry : public testing::Test {};
12 
15 
17  std::vector<double> v;
18  for (double d = -50.0; d < 50.0; d += 0.1) {
19  v.push_back(TypeParam::mod_2pi(d));
20  EXPECT_NEAR(TypeParam::getAngContinuity(d - 0.1, TypeParam::mod_2pi(d)), d, 1e-5);
21  }
22  for (double d = 50.0; d > -50.0; d -= 0.1) {
23  v.push_back(TypeParam::mod_2pi(d));
24  EXPECT_NEAR(TypeParam::getAngContinuity(d + 0.1, TypeParam::mod_2pi(d)), d, 1e-5);
25  }
26  auto restored_v = TypeParam::getAngContinuity(v);
27  for (int i = 1; i < restored_v.size(); ++i) {
28  EXPECT_NEAR(fabs(restored_v[i] - restored_v[i - 1]), 0.1, 1e-5);
29  }
30 }
31 
33  EXPECT_NEAR(TypeParam::getAngleAvg(0, M_PI / 2.0), M_PI / 4.0, 1e-7);
34  EXPECT_NEAR(TypeParam::getAngleAvg(0, -M_PI / 2.0), 7.0 * M_PI / 4.0, 1e-7);
35  EXPECT_NEAR(TypeParam::getAngleAvg(M_PI, -M_PI / 2.0), 5.0 * M_PI / 4.0, 1e-7);
36  EXPECT_NEAR(TypeParam::getAngleAvg(5. * M_PI / 4., 3. * M_PI / 4.), M_PI, 1e-7);
37  EXPECT_NEAR(TypeParam::getAngleAvg(3. * M_PI / 4., 5. * M_PI / 4.), M_PI, 1e-7);
38 }
39 
41  EXPECT_NEAR(TypeParam::getAngleDiffAbs(M_PI*0.25, M_PI), 0.75*M_PI, 1e-5);
42  EXPECT_NEAR(TypeParam::getAngleDiffAbs(-M_PI*0.25, M_PI), 0.75*M_PI, 1e-5);
43  EXPECT_NEAR(TypeParam::getAngleDiffAbs(-M_PI*0.25, 0), 0.25*M_PI, 1e-5);
44  EXPECT_NEAR(TypeParam::getAngleDiffAbs(-M_PI*0.25, M_PI*0.5), 0.75*M_PI, 1e-5);
45 }
46 
48  EXPECT_EQ(TypeParam::mod(2.0, 6.5), 2.0);
49  EXPECT_EQ(TypeParam::mod(20.0, 7.0), 6.0);
50  EXPECT_EQ(TypeParam::mod(-1.0, 4.0), 3.0);
51 }
53  TypeParam t;
54  TypeParam t2 = TypeParam(t.get());
55  auto p_t3 = t->clone();
56  TypeParam t3 = TypeParam(p_t3);
57  OGRGeometryFactory::destroyGeometry(p_t3);
58  TypeParam t4 {t};
59  TypeParam t5 = TypeParam(t.operator->());
60  TypeParam t6 = TypeParam(static_cast<OGRGeometry*>(t.get()));
61  TypeParam t7 = TypeParam(static_cast<OGRGeometry const*>(t.get()));
62  TypeParam t8;
63  t8 = t;
64  EXPECT_FALSE(t != t2);
65  EXPECT_FALSE(t != t3);
66  EXPECT_TRUE(t == t2);
67  EXPECT_TRUE(t == t3);
68  EXPECT_TRUE(t == t4);
69  EXPECT_TRUE(t == t5);
70  EXPECT_TRUE(t == t6);
71  EXPECT_TRUE(t == t7);
72  EXPECT_TRUE(t == t8);
73 }
74 
76  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
77  F2CLineString line {p_t, p_n};
79  F2CMultiPoint ps {p_t, p_n};
80  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
81  F2CCell cell1 {ring1};
82  F2CCells cells1 {cell1};
83 
84  EXPECT_FALSE(p_t.intersects(p_n));
85  EXPECT_TRUE(p_t.intersects(ps));
86  EXPECT_TRUE(p_t.intersects(line));
87  EXPECT_TRUE(p_t.intersects(lines));
88  EXPECT_FALSE(p_t.intersects(ring1));
89  EXPECT_TRUE(p_t.intersects(cell1));
90  EXPECT_TRUE(p_t.intersects(cells1));
91  EXPECT_FALSE(p_n.intersects(ring1));
92  EXPECT_FALSE(p_n.intersects(cell1));
93  EXPECT_FALSE(p_n.intersects(cells1));
94 
95  EXPECT_TRUE(ps.intersects(p_n));
96  EXPECT_TRUE(ps.intersects(ps));
97  EXPECT_TRUE(ps.intersects(line));
98  EXPECT_TRUE(ps.intersects(lines));
99  EXPECT_FALSE(ps.intersects(ring1));
100  EXPECT_TRUE(ps.intersects(cell1));
101  EXPECT_TRUE(ps.intersects(cells1));
102 
103  EXPECT_TRUE(line.intersects(p_t));
104  EXPECT_TRUE(line.intersects(ps));
105  EXPECT_TRUE(line.intersects(line));
106  EXPECT_TRUE(line.intersects(lines));
107  EXPECT_FALSE(line.intersects(ring1));
108  EXPECT_TRUE(line.intersects(cell1));
109  EXPECT_TRUE(line.intersects(cells1));
110 
111  EXPECT_TRUE(lines.intersects(p_t));
112  EXPECT_TRUE(lines.intersects(ps));
113  EXPECT_TRUE(lines.intersects(line));
114  EXPECT_TRUE(lines.intersects(lines));
115  EXPECT_FALSE(lines.intersects(ring1));
116  EXPECT_TRUE(lines.intersects(cell1));
117  EXPECT_TRUE(lines.intersects(cells1));
118 
119  EXPECT_FALSE(ring1.intersects(p_t));
120  EXPECT_FALSE(ring1.intersects(ps));
121  EXPECT_FALSE(ring1.intersects(line));
122  EXPECT_FALSE(ring1.intersects(lines));
123  EXPECT_FALSE(ring1.intersects(ring1));
124  EXPECT_FALSE(ring1.intersects(cell1));
125  EXPECT_FALSE(ring1.intersects(cells1));
126 
127  EXPECT_TRUE(cell1.intersects(p_t));
128  EXPECT_TRUE(cell1.intersects(ps));
129  EXPECT_TRUE(cell1.intersects(line));
130  EXPECT_TRUE(cell1.intersects(lines));
131  EXPECT_FALSE(cell1.intersects(ring1));
132  EXPECT_TRUE(cell1.intersects(cell1));
133  EXPECT_TRUE(cell1.intersects(cells1));
134 
135  EXPECT_TRUE(cells1.intersects(p_t));
136  EXPECT_TRUE(cells1.intersects(ps));
137  EXPECT_TRUE(cells1.intersects(line));
138  EXPECT_TRUE(cells1.intersects(lines));
139  EXPECT_FALSE(cells1.intersects(ring1));
140  EXPECT_TRUE(cells1.intersects(cell1));
141  EXPECT_TRUE(cells1.intersects(cells1));
142 }
143 
145  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
146  F2CLineString line {p_t, p_n};
147  F2CMultiLineString lines {line};
148  F2CMultiPoint ps {p_t, p_n};
149  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
150  F2CCell cell1 {ring1};
151  F2CCells cells1 {cell1};
152 
153  EXPECT_FALSE(p_t.touches(p_n));
154  EXPECT_FALSE(p_t.touches(ps));
155  EXPECT_TRUE(p_t.touches(line));
156  EXPECT_TRUE(p_t.touches(lines));
157  EXPECT_FALSE(p_t.touches(ring1));
158  EXPECT_FALSE(p_t.touches(cell1));
159  EXPECT_FALSE(p_t.touches(cells1));
160  EXPECT_FALSE(p_n.touches(ring1));
161  EXPECT_FALSE(p_n.touches(cell1));
162  EXPECT_FALSE(p_n.touches(cells1));
163 
164  EXPECT_FALSE(ps.touches(p_n));
165  EXPECT_FALSE(ps.touches(ps));
166  EXPECT_TRUE(ps.touches(line));
167  EXPECT_TRUE(ps.touches(lines));
168  EXPECT_FALSE(ps.touches(ring1));
169  EXPECT_FALSE(ps.touches(cell1));
170  EXPECT_FALSE(ps.touches(cells1));
171 
172  EXPECT_TRUE(line.touches(p_t));
173  EXPECT_TRUE(line.touches(ps));
174  EXPECT_FALSE(line.touches(line));
175  EXPECT_FALSE(line.touches(lines));
176  EXPECT_FALSE(line.touches(ring1));
177  EXPECT_FALSE(line.touches(cell1));
178  EXPECT_FALSE(line.touches(cells1));
179 
180  EXPECT_TRUE(lines.touches(p_t));
181  EXPECT_TRUE(lines.touches(ps));
182  EXPECT_FALSE(lines.touches(line));
183  EXPECT_FALSE(lines.touches(lines));
184  EXPECT_FALSE(lines.touches(ring1));
185  EXPECT_FALSE(lines.touches(cell1));
186  EXPECT_FALSE(lines.touches(cells1));
187 
188  EXPECT_FALSE(ring1.touches(p_t));
189  EXPECT_FALSE(ring1.touches(ps));
190  EXPECT_FALSE(ring1.touches(line));
191  EXPECT_FALSE(ring1.touches(lines));
192  EXPECT_FALSE(ring1.touches(ring1));
193  EXPECT_FALSE(ring1.touches(cell1));
194  EXPECT_FALSE(ring1.touches(cells1));
195 
196  EXPECT_FALSE(cell1.touches(p_t));
197  EXPECT_FALSE(cell1.touches(ps));
198  EXPECT_FALSE(cell1.touches(line));
199  EXPECT_FALSE(cell1.touches(lines));
200  EXPECT_FALSE(cell1.touches(ring1));
201  EXPECT_FALSE(cell1.touches(cell1));
202  EXPECT_FALSE(cell1.touches(cells1));
203 
204  EXPECT_FALSE(cells1.touches(p_t));
205  EXPECT_FALSE(cells1.touches(ps));
206  EXPECT_FALSE(cells1.touches(line));
207  EXPECT_FALSE(cells1.touches(lines));
208  EXPECT_FALSE(cells1.touches(ring1));
209  EXPECT_FALSE(cells1.touches(cell1));
210  EXPECT_FALSE(cells1.touches(cells1));
211 }
212 
214  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
215  F2CLineString line {p_t, p_n};
216  F2CMultiLineString lines {line};
217  F2CMultiPoint ps {p_t, p_n};
218  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
219  F2CCell cell1 {ring1};
220  F2CCells cells1 {cell1};
221 
222 
223 
224  EXPECT_TRUE(p_t.disjoint(p_n));
225  EXPECT_FALSE(p_t.disjoint(ps));
226  EXPECT_FALSE(p_t.disjoint(line));
227  EXPECT_FALSE(p_t.disjoint(lines));
228  EXPECT_FALSE(p_t.disjoint(ring1));
229  EXPECT_FALSE(p_t.disjoint(cell1));
230  EXPECT_FALSE(p_t.disjoint(cells1));
231  EXPECT_FALSE(p_n.disjoint(ring1));
232  EXPECT_TRUE(p_n.disjoint(cell1));
233  EXPECT_TRUE(p_n.disjoint(cells1));
234 
235  EXPECT_FALSE(ps.disjoint(p_n));
236  EXPECT_FALSE(ps.disjoint(ps));
237  EXPECT_FALSE(ps.disjoint(line));
238  EXPECT_FALSE(ps.disjoint(lines));
239  EXPECT_FALSE(ps.disjoint(ring1));
240  EXPECT_FALSE(ps.disjoint(cell1));
241  EXPECT_FALSE(ps.disjoint(cells1));
242 
243  EXPECT_FALSE(line.disjoint(p_t));
244  EXPECT_FALSE(line.disjoint(ps));
245  EXPECT_FALSE(line.disjoint(line));
246  EXPECT_FALSE(line.disjoint(lines));
247  EXPECT_FALSE(line.disjoint(ring1));
248  EXPECT_FALSE(line.disjoint(cell1));
249  EXPECT_FALSE(line.disjoint(cells1));
250 
251  EXPECT_FALSE(lines.disjoint(p_t));
252  EXPECT_FALSE(lines.disjoint(ps));
253  EXPECT_FALSE(lines.disjoint(line));
254  EXPECT_FALSE(lines.disjoint(lines));
255  EXPECT_FALSE(lines.disjoint(ring1));
256  EXPECT_FALSE(lines.disjoint(cell1));
257  EXPECT_FALSE(lines.disjoint(cells1));
258 
259  EXPECT_FALSE(ring1.disjoint(p_t));
260  EXPECT_FALSE(ring1.disjoint(ps));
261  EXPECT_FALSE(ring1.disjoint(line));
262  EXPECT_FALSE(ring1.disjoint(lines));
263  EXPECT_FALSE(ring1.disjoint(ring1));
264  EXPECT_FALSE(ring1.disjoint(cell1));
265  EXPECT_FALSE(ring1.disjoint(cells1));
266 
267  EXPECT_FALSE(cell1.disjoint(p_t));
268  EXPECT_FALSE(cell1.disjoint(ps));
269  EXPECT_FALSE(cell1.disjoint(line));
270  EXPECT_FALSE(cell1.disjoint(lines));
271  EXPECT_FALSE(cell1.disjoint(ring1));
272  EXPECT_FALSE(cell1.disjoint(cell1));
273  EXPECT_FALSE(cell1.disjoint(cells1));
274 
275  EXPECT_FALSE(cells1.disjoint(p_t));
276  EXPECT_FALSE(cells1.disjoint(ps));
277  EXPECT_FALSE(cells1.disjoint(line));
278  EXPECT_FALSE(cells1.disjoint(lines));
279  EXPECT_FALSE(cells1.disjoint(ring1));
280  EXPECT_FALSE(cells1.disjoint(cell1));
281  EXPECT_FALSE(cells1.disjoint(cells1));
282 }
283 
285  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
286  F2CLineString line {p_t, p_n};
287  F2CMultiLineString lines {line};
288  F2CMultiPoint ps {p_t, p_n};
289  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
290  F2CCell cell1 {ring1};
291  F2CCells cells1 {cell1};
292 
293 
294  EXPECT_FALSE(p_t.within(p_n));
295  EXPECT_TRUE(p_t.within(ps));
296  EXPECT_FALSE(p_t.within(line));
297  EXPECT_FALSE(p_t.within(lines));
298  EXPECT_FALSE(p_t.within(ring1));
299  EXPECT_TRUE(p_t.within(cell1));
300  EXPECT_TRUE(p_t.within(cells1));
301  EXPECT_FALSE(p_n.within(ring1));
302  EXPECT_FALSE(p_n.within(cell1));
303  EXPECT_FALSE(p_n.within(cells1));
304 
305  EXPECT_FALSE(ps.within(p_n));
306  EXPECT_TRUE(ps.within(ps));
307  EXPECT_FALSE(ps.within(line));
308  EXPECT_FALSE(ps.within(lines));
309  EXPECT_FALSE(ps.within(ring1));
310  EXPECT_FALSE(ps.within(cell1));
311  EXPECT_FALSE(ps.within(cells1));
312 
313  EXPECT_FALSE(line.within(p_t));
314  EXPECT_FALSE(line.within(ps));
315  EXPECT_TRUE(line.within(line));
316  EXPECT_TRUE(line.within(lines));
317  EXPECT_FALSE(line.within(ring1));
318  EXPECT_FALSE(line.within(cell1));
319  EXPECT_FALSE(line.within(cells1));
320 
321  EXPECT_FALSE(lines.within(p_t));
322  EXPECT_FALSE(lines.within(ps));
323  EXPECT_TRUE(lines.within(line));
324  EXPECT_TRUE(lines.within(lines));
325  EXPECT_FALSE(lines.within(ring1));
326  EXPECT_FALSE(lines.within(cell1));
327  EXPECT_FALSE(lines.within(cells1));
328 
329  EXPECT_FALSE(ring1.within(p_t));
330  EXPECT_FALSE(ring1.within(ps));
331  EXPECT_FALSE(ring1.within(line));
332  EXPECT_FALSE(ring1.within(lines));
333  EXPECT_FALSE(ring1.within(ring1));
334  EXPECT_FALSE(ring1.within(cell1));
335  EXPECT_FALSE(ring1.within(cells1));
336 
337  EXPECT_FALSE(cell1.within(p_t));
338  EXPECT_FALSE(cell1.within(ps));
339  EXPECT_FALSE(cell1.within(line));
340  EXPECT_FALSE(cell1.within(lines));
341  EXPECT_FALSE(cell1.within(ring1));
342  EXPECT_TRUE(cell1.within(cell1));
343  EXPECT_TRUE(cell1.within(cells1));
344 
345  EXPECT_FALSE(cells1.within(p_t));
346  EXPECT_FALSE(cells1.within(ps));
347  EXPECT_FALSE(cells1.within(line));
348  EXPECT_FALSE(cells1.within(lines));
349  EXPECT_FALSE(cells1.within(ring1));
350  EXPECT_TRUE(cells1.within(cell1));
351  EXPECT_TRUE(cells1.within(cells1));
352 }
353 
355  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
356  F2CLineString line {p_t, p_n};
357  F2CMultiLineString lines {line};
358  F2CMultiPoint ps {p_t, p_n};
359  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
360  F2CCell cell1 {ring1};
361  F2CCells cells1 {cell1};
362 
363 
364  EXPECT_FALSE(p_t.crosses(p_n));
365  EXPECT_FALSE(p_t.crosses(ps));
366  EXPECT_FALSE(p_t.crosses(line));
367  EXPECT_FALSE(p_t.crosses(lines));
368  EXPECT_FALSE(p_t.crosses(ring1));
369  EXPECT_FALSE(p_t.crosses(cell1));
370  EXPECT_FALSE(p_t.crosses(cells1));
371  EXPECT_FALSE(p_n.crosses(ring1));
372  EXPECT_FALSE(p_n.crosses(cell1));
373  EXPECT_FALSE(p_n.crosses(cells1));
374 
375  EXPECT_FALSE(ps.crosses(p_n));
376  EXPECT_FALSE(ps.crosses(ps));
377  EXPECT_FALSE(ps.crosses(line));
378  EXPECT_FALSE(ps.crosses(lines));
379  EXPECT_FALSE(ps.crosses(ring1));
380  EXPECT_TRUE(ps.crosses(cell1));
381  EXPECT_TRUE(ps.crosses(cells1));
382 
383  EXPECT_FALSE(line.crosses(p_t));
384  EXPECT_FALSE(line.crosses(ps));
385  EXPECT_FALSE(line.crosses(line));
386  EXPECT_FALSE(line.crosses(lines));
387  EXPECT_FALSE(line.crosses(ring1));
388  EXPECT_TRUE(line.crosses(cell1));
389  EXPECT_TRUE(line.crosses(cells1));
390 
391  EXPECT_FALSE(lines.crosses(p_t));
392  EXPECT_FALSE(lines.crosses(ps));
393  EXPECT_FALSE(lines.crosses(line));
394  EXPECT_FALSE(lines.crosses(lines));
395  EXPECT_FALSE(lines.crosses(ring1));
396  EXPECT_TRUE(lines.crosses(cell1));
397  EXPECT_TRUE(lines.crosses(cells1));
398 
399  EXPECT_FALSE(ring1.crosses(p_t));
400  EXPECT_FALSE(ring1.crosses(ps));
401  EXPECT_FALSE(ring1.crosses(line));
402  EXPECT_FALSE(ring1.crosses(lines));
403  EXPECT_FALSE(ring1.crosses(ring1));
404  EXPECT_FALSE(ring1.crosses(cell1));
405  EXPECT_FALSE(ring1.crosses(cells1));
406 
407  EXPECT_FALSE(cell1.crosses(p_t));
408  EXPECT_TRUE(cell1.crosses(ps));
409  EXPECT_TRUE(cell1.crosses(line));
410  EXPECT_TRUE(cell1.crosses(lines));
411  EXPECT_FALSE(cell1.crosses(ring1));
412  EXPECT_FALSE(cell1.crosses(cell1));
413  EXPECT_FALSE(cell1.crosses(cells1));
414 
415  EXPECT_FALSE(cells1.crosses(p_t));
416  EXPECT_TRUE(cells1.crosses(ps));
417  EXPECT_TRUE(cells1.crosses(line));
418  EXPECT_TRUE(cells1.crosses(lines));
419  EXPECT_FALSE(cells1.crosses(ring1));
420  EXPECT_FALSE(cells1.crosses(cell1));
421  EXPECT_FALSE(cells1.crosses(cells1));
422 }
423 
425  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
426  F2CLineString line {p_t, p_n};
427  F2CMultiLineString lines {line};
428  F2CMultiPoint ps {p_t, p_n};
429  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
430  ring1.reversePoints();
431  F2CCell cell1 {ring1};
432  F2CCells cells1 {cell1};
433 
434 
435  EXPECT_NEAR(p_t.distance(p_n), sqrt(2), 1e-7);
436  EXPECT_NEAR(p_t.distance(ps), 0, 1e-7);
437  EXPECT_NEAR(p_t.distance(line), 0, 1e-7);
438  EXPECT_NEAR(p_t.distance(lines), 0, 1e-7);
439  EXPECT_NEAR(p_t.distance(ring1), -1, 1e-7);
440  EXPECT_NEAR(p_t.distance(cell1), 0, 1e-7);
441  EXPECT_NEAR(p_t.distance(cells1), 0, 1e-7);
442  EXPECT_NEAR(p_n.distance(ring1), -1, 1e-7);
443  EXPECT_NEAR(p_n.distance(cell1), sqrt(2)/2.0, 1e-7);
444  EXPECT_NEAR(p_n.distance(cells1), sqrt(2)/2.0, 1e-7);
445 
446  EXPECT_NEAR(ps.distance(p_n), 0, 1e-7);
447  EXPECT_NEAR(ps.distance(ps), 0, 1e-7);
448  EXPECT_NEAR(ps.distance(line), 0, 1e-7);
449  EXPECT_NEAR(ps.distance(lines), 0, 1e-7);
450  EXPECT_NEAR(ps.distance(ring1), -1, 1e-7);
451  EXPECT_NEAR(ps.distance(cell1), 0, 1e-7);
452  EXPECT_NEAR(ps.distance(cells1), 0, 1e-7);
453 
454  EXPECT_NEAR(line.distance(p_t), 0, 1e-7);
455  EXPECT_NEAR(line.distance(ps), 0, 1e-7);
456  EXPECT_NEAR(line.distance(line), 0, 1e-7);
457  EXPECT_NEAR(line.distance(lines), 0, 1e-7);
458  EXPECT_NEAR(line.distance(ring1), -1, 1e-7);
459  EXPECT_NEAR(line.distance(cell1), 0, 1e-7);
460  EXPECT_NEAR(line.distance(cells1), 0, 1e-7);
461 
462  EXPECT_NEAR(lines.distance(p_t), 0, 1e-7);
463  EXPECT_NEAR(lines.distance(ps), 0, 1e-7);
464  EXPECT_NEAR(lines.distance(line), 0, 1e-7);
465  EXPECT_NEAR(lines.distance(lines), 0, 1e-7);
466  EXPECT_NEAR(lines.distance(ring1), -1, 1e-7);
467  EXPECT_NEAR(lines.distance(cell1), 0, 1e-7);
468  EXPECT_NEAR(lines.distance(cells1), 0, 1e-7);
469 
470  EXPECT_NEAR(ring1.distance(p_t), -1, 1e-7);
471  EXPECT_NEAR(ring1.distance(ps), -1, 1e-7);
472  EXPECT_NEAR(ring1.distance(line), -1, 1e-7);
473  EXPECT_NEAR(ring1.distance(lines), -1, 1e-7);
474  EXPECT_NEAR(ring1.distance(ring1), -1, 1e-7);
475  EXPECT_NEAR(ring1.distance(cell1), -1, 1e-7);
476  EXPECT_NEAR(ring1.distance(cells1), -1, 1e-7);
477 
478  EXPECT_NEAR(cell1.distance(p_t), 0, 1e-7);
479  EXPECT_NEAR(cell1.distance(ps), 0, 1e-7);
480  EXPECT_NEAR(cell1.distance(line), 0, 1e-7);
481  EXPECT_NEAR(cell1.distance(lines), 0, 1e-7);
482  EXPECT_NEAR(cell1.distance(ring1), -1, 1e-7);
483  EXPECT_NEAR(cell1.distance(cell1), 0, 1e-7);
484  EXPECT_NEAR(cell1.distance(cells1), 0, 1e-7);
485 
486  EXPECT_NEAR(cells1.distance(p_t), 0, 1e-7);
487  EXPECT_NEAR(cells1.distance(ps), 0, 1e-7);
488  EXPECT_NEAR(cells1.distance(line), 0, 1e-7);
489  EXPECT_NEAR(cells1.distance(lines), 0, 1e-7);
490  EXPECT_NEAR(cells1.distance(ring1), -1, 1e-7);
491  EXPECT_NEAR(cells1.distance(cell1), 0, 1e-7);
492  EXPECT_NEAR(cells1.distance(cells1), 0, 1e-7);
493 
494 
495 }
496 
498  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
499  F2CLineString line {p_t, p_n};
500  F2CMultiLineString lines {line};
501  F2CMultiPoint ps {p_t, p_n};
502  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
503  F2CCell cell1 {ring1};
504  F2CCells cells1 {cell1};
505 
506  EXPECT_NEAR(p_t.getDimMinX(), 0.5, 1e-7);
507  EXPECT_NEAR(ps.getDimMinX(), -0.5, 1e-7);
508  EXPECT_NEAR(ring1.getDimMinX(), 0, 1e-7);
509  EXPECT_NEAR(line.getDimMinX(), -0.5, 1e-7);
510  EXPECT_NEAR(lines.getDimMinX(), -0.5, 1e-7);
511  EXPECT_NEAR(cell1.getDimMinX(), 0, 1e-7);
512  EXPECT_NEAR(cells1.getDimMinX(), 0, 1e-7);
513 }
514 
516  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
517  F2CLineString line {p_t, p_n};
518  F2CMultiLineString lines {line};
519  F2CMultiPoint ps {p_t, p_n};
520  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
521  F2CCell cell1 {ring1};
522  F2CCells cells1 {cell1};
523 
524  EXPECT_NEAR(p_t.getDimMinY(), 0.5, 1e-7);
525  EXPECT_NEAR(ps.getDimMinY(), -0.5, 1e-7);
526  EXPECT_NEAR(ring1.getDimMinY(), 0, 1e-7);
527  EXPECT_NEAR(line.getDimMinY(), -0.5, 1e-7);
528  EXPECT_NEAR(lines.getDimMinY(), -0.5, 1e-7);
529  EXPECT_NEAR(cell1.getDimMinY(), 0, 1e-7);
530  EXPECT_NEAR(cells1.getDimMinY(), 0, 1e-7);
531 }
532 
534  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
535  F2CLineString line {p_t, p_n};
536  F2CMultiLineString lines {line};
537  F2CMultiPoint ps {p_t, p_n};
538  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
539  F2CCell cell1 {ring1};
540  F2CCells cells1 {cell1};
541 
542  EXPECT_NEAR(p_t.getDimMaxX(), 0.5, 1e-7);
543  EXPECT_NEAR(ps.getDimMaxX(), 0.5, 1e-7);
544  EXPECT_NEAR(ring1.getDimMaxX(), 4, 1e-7);
545  EXPECT_NEAR(line.getDimMaxX(), 0.5, 1e-7);
546  EXPECT_NEAR(lines.getDimMaxX(), 0.5, 1e-7);
547  EXPECT_NEAR(cell1.getDimMaxX(), 4, 1e-7);
548  EXPECT_NEAR(cells1.getDimMaxX(), 4, 1e-7);
549 }
550 
552  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
553  F2CLineString line {p_t, p_n};
554  F2CMultiLineString lines {line};
555  F2CMultiPoint ps {p_t, p_n};
556  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
557  F2CCell cell1 {ring1};
558  F2CCells cells1 {cell1};
559 
560  EXPECT_NEAR(p_t.getDimMaxY(), 0.5, 1e-7);
561  EXPECT_NEAR(ps.getDimMaxY(), 0.5, 1e-7);
562  EXPECT_NEAR(ring1.getDimMaxY(), 3, 1e-7);
563  EXPECT_NEAR(line.getDimMaxY(), 0.5, 1e-7);
564  EXPECT_NEAR(lines.getDimMaxY(), 0.5, 1e-7);
565  EXPECT_NEAR(cell1.getDimMaxY(), 3, 1e-7);
566  EXPECT_NEAR(cells1.getDimMaxY(), 3, 1e-7);
567 }
568 
570  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
571  F2CLineString line {p_t, p_n};
572  F2CMultiLineString lines {line};
573  F2CMultiPoint ps {p_t, p_n};
574  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
575  F2CCell cell1 {ring1};
576  F2CCells cells1 {cell1};
577 
578  EXPECT_NEAR(p_t.getHeight(), 0, 1e-7);
579  EXPECT_NEAR(ps.getHeight(), 1, 1e-7);
580  EXPECT_NEAR(ring1.getHeight(), 3, 1e-7);
581  EXPECT_NEAR(line.getHeight(), 1, 1e-7);
582  EXPECT_NEAR(lines.getHeight(), 1, 1e-7);
583  EXPECT_NEAR(cell1.getHeight(), 3, 1e-7);
584  EXPECT_NEAR(cells1.getHeight(), 3, 1e-7);
585 }
586 
588  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
589  F2CLineString line {p_t, p_n};
590  F2CMultiLineString lines {line};
591  F2CMultiPoint ps {p_t, p_n};
592  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
593  F2CCell cell1 {ring1};
594  F2CCells cells1 {cell1};
595 
596  EXPECT_NEAR(p_t.getWidth(), 0, 1e-7);
597  EXPECT_NEAR(ps.getWidth(), 1, 1e-7);
598  EXPECT_NEAR(ring1.getWidth(), 4, 1e-7);
599  EXPECT_NEAR(line.getWidth(), 1, 1e-7);
600  EXPECT_NEAR(lines.getWidth(), 1, 1e-7);
601  EXPECT_NEAR(cell1.getWidth(), 4, 1e-7);
602  EXPECT_NEAR(cells1.getWidth(), 4, 1e-7);
603 }
604 
605 TEST(fields2cover_types_geometry, getMinSafeLength) {
606  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
607  F2CLineString line {p_t, p_n};
608  F2CMultiLineString lines {line};
609  F2CMultiPoint ps {p_t, p_n};
610  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
611  F2CCell cell1 {ring1};
612  F2CCells cells1 {cell1};
613 
614  EXPECT_NEAR(p_t.getMinSafeLength(), 0, 1e-7);
615  EXPECT_NEAR(ps.getMinSafeLength(), 2, 1e-7);
616  EXPECT_NEAR(ring1.getMinSafeLength(), 7, 1e-7);
617  EXPECT_NEAR(line.getMinSafeLength(), 2, 1e-7);
618  EXPECT_NEAR(lines.getMinSafeLength(), 2, 1e-7);
619  EXPECT_NEAR(cell1.getMinSafeLength(), 7, 1e-7);
620  EXPECT_NEAR(cells1.getMinSafeLength(), 7, 1e-7);
621 }
622 
623 
625  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
626  F2CLineString line {p_t, p_n};
627  F2CMultiLineString lines {line};
628  F2CMultiPoint ps {p_t, p_n};
629  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(3,3), F2CPoint(3,1), F2CPoint(1,1), F2CPoint(1,3), F2CPoint(0,3), F2CPoint(0,0)};
630  F2CCell cell1 {ring1};
631  F2CCells cells1 {cell1};
632 
633  EXPECT_TRUE(p_t == p_t);
634  EXPECT_TRUE(ps == ps);
635  EXPECT_TRUE(line == line);
636  EXPECT_TRUE(lines == lines);
637  EXPECT_TRUE(ring1 == ring1);
638  EXPECT_TRUE(cell1 == cell1);
639  EXPECT_TRUE(cells1 == cells1);
640 
641  EXPECT_FALSE(p_t != p_t);
642  EXPECT_FALSE(ps != ps);
643  EXPECT_FALSE(line != line);
644  EXPECT_FALSE(lines != lines);
645  EXPECT_FALSE(ring1 != ring1);
646  EXPECT_FALSE(cell1 != cell1);
647  EXPECT_FALSE(cells1 != cells1);
648 }
649 
651  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
652  F2CLineString line {p_t, p_n};
653  F2CMultiLineString lines {line};
654  F2CMultiPoint ps {p_t, p_n};
655  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(0,0)};
656  F2CCell cell1 {ring1};
657  F2CCells cells1 {cell1};
658 
659  EXPECT_EQ(p_t.exportToGML(), "<gml:Point><gml:coordinates>0.5,0.5,0</gml:coordinates></gml:Point>");
660  EXPECT_EQ(ps.exportToGML(), "<gml:MultiPoint><gml:pointMember><gml:Point><gml:coordinates>0.5,0.5,0</gml:coordinates></gml:Point></gml:pointMember><gml:pointMember><gml:Point><gml:coordinates>-0.5,-0.5,0</gml:coordinates></gml:Point></gml:pointMember></gml:MultiPoint>");
661  EXPECT_EQ(ring1.exportToGML(), "<gml:LinearRing><gml:coordinates>0,0,0 4,0,0 4,3,0 0,0,0</gml:coordinates></gml:LinearRing>");
662  EXPECT_EQ(line.exportToGML(), "<gml:LineString><gml:coordinates>0.5,0.5,0 -0.5,-0.5,0</gml:coordinates></gml:LineString>");
663  EXPECT_EQ(lines.exportToGML(), "<gml:MultiLineString><gml:lineStringMember><gml:LineString><gml:coordinates>0.5,0.5,0 -0.5,-0.5,0</gml:coordinates></gml:LineString></gml:lineStringMember></gml:MultiLineString>");
664  EXPECT_EQ(cell1.exportToGML(), "<gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,0,0 4,0,0 4,3,0 0,0,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon>");
665  EXPECT_EQ(cells1.exportToGML(), "<gml:MultiPolygon><gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>0,0,0 4,0,0 4,3,0 0,0,0</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>");
666 }
667 
669  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
670  F2CLineString line {p_t, p_n};
671  F2CMultiLineString lines {line};
672  F2CMultiPoint ps {p_t, p_n};
673  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(0,0)};
674  F2CCell cell1 {ring1};
675  F2CCells cells1 {cell1};
676 
677  EXPECT_EQ(p_t.exportToKML(), "<Point><coordinates>0.5,0.5,0</coordinates></Point>");
678  EXPECT_EQ(ps.exportToKML(), "<MultiGeometry><Point><coordinates>0.5,0.5,0</coordinates></Point><Point><coordinates>-0.5,-0.5,0</coordinates></Point></MultiGeometry>");
679  EXPECT_EQ(ring1.exportToKML(), "<LinearRing><coordinates>0,0,0 4,0,0 4,3,0 0,0,0</coordinates></LinearRing>");
680  EXPECT_EQ(line.exportToKML(), "<LineString><coordinates>0.5,0.5,0 -0.5,-0.5,0</coordinates></LineString>");
681  EXPECT_EQ(lines.exportToKML(), "<MultiGeometry><LineString><coordinates>0.5,0.5,0 -0.5,-0.5,0</coordinates></LineString></MultiGeometry>");
682  EXPECT_EQ(cell1.exportToKML(), "<Polygon><outerBoundaryIs><LinearRing><coordinates>0,0,0 4,0,0 4,3,0 0,0,0</coordinates></LinearRing></outerBoundaryIs></Polygon>");
683  EXPECT_EQ(cells1.exportToKML(), "<MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates>0,0,0 4,0,0 4,3,0 0,0,0</coordinates></LinearRing></outerBoundaryIs></Polygon></MultiGeometry>");
684 }
685 
687  F2CPoint p_t(0.5, 0.5), p_n(-0.5, -0.5);
688  F2CLineString line {p_t, p_n};
689  F2CMultiLineString lines {line};
690  F2CMultiPoint ps {p_t, p_n};
691  F2CLinearRing ring1 {F2CPoint(0,0), F2CPoint(4,0), F2CPoint(4,3), F2CPoint(0,0)};
692  F2CCell cell1 {ring1};
693  F2CCells cells1 {cell1};
694 
695  EXPECT_EQ(p_t.exportToJson(), "{ \"type\": \"Point\", \"coordinates\": [ 0.5, 0.5, 0.0 ] }");
696  EXPECT_EQ(ps.exportToJson(), "{ \"type\": \"MultiPoint\", \"coordinates\": [ [ 0.5, 0.5, 0.0 ], [ -0.5, -0.5, 0.0 ] ] }");
697  EXPECT_EQ(ring1.exportToJson(), "{ \"type\": \"LineString\", \"coordinates\": [ [ 0.0, 0.0, 0.0 ], [ 4.0, 0.0, 0.0 ], [ 4.0, 3.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] }");
698  EXPECT_EQ(line.exportToJson(), "{ \"type\": \"LineString\", \"coordinates\": [ [ 0.5, 0.5, 0.0 ], [ -0.5, -0.5, 0.0 ] ] }");
699  EXPECT_EQ(lines.exportToJson(), "{ \"type\": \"MultiLineString\", \"coordinates\": [ [ [ 0.5, 0.5, 0.0 ], [ -0.5, -0.5, 0.0 ] ] ] }");
700  EXPECT_EQ(cell1.exportToJson(), "{ \"type\": \"Polygon\", \"coordinates\": [ [ [ 0.0, 0.0, 0.0 ], [ 4.0, 0.0, 0.0 ], [ 4.0, 3.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ] }");
701  EXPECT_EQ(cells1.exportToJson(), "{ \"type\": \"MultiPolygon\", \"coordinates\": [ [ [ [ 0.0, 0.0, 0.0 ], [ 4.0, 0.0, 0.0 ], [ 4.0, 3.0, 0.0 ], [ 0.0, 0.0, 0.0 ] ] ] ] }");
702 }
703 
705  F2CPoint p_in(1, 0), p_out(1, 0);
706  double pi = boost::math::constants::pi<double>();
707  p_out = F2CPoint(0,0).rotateFromPoint(pi/2.0, p_out);
708  EXPECT_NEAR(p_out.getX(), 0, 1e-7);
709  EXPECT_NEAR(p_out.getY(), 1, 1e-7);
710  p_out = F2CPoint(0,0).rotateFromPoint(pi/2.0, p_out);
711  EXPECT_NEAR(p_out.getX(), -1, 1e-7);
712  EXPECT_NEAR(p_out.getY(), 0, 1e-7);
713  p_out = F2CPoint(0,0).rotateFromPoint(pi/2.0, p_out);
714  EXPECT_NEAR(p_out.getX(), 0, 1e-7);
715  EXPECT_NEAR(p_out.getY(), -1, 1e-7);
716  p_out = F2CPoint(0,0).rotateFromPoint(pi/2.0, p_out);
717  EXPECT_NEAR(p_out.getX(), 1, 1e-7);
718  EXPECT_NEAR(p_out.getY(), 0, 1e-7);
719  p_out = p_in.rotateFromPoint(pi/2.0, p_out);
720  EXPECT_NEAR(p_out.getX(), 1, 1e-7);
721  EXPECT_NEAR(p_out.getY(), 0, 1e-7);
722  p_out = F2CPoint(0.5, 0).rotateFromPoint(pi/2.0, p_out);
723  EXPECT_NEAR(p_out.getX(), 0.5, 1e-7);
724  EXPECT_NEAR(p_out.getY(), 0.5, 1e-7);
725 
726  F2CLineString line;
727  line->addPoint(1, 2);
728  line->addPoint(3, 4);
729  line = F2CPoint(5, 6).rotateFromPoint(pi, line);
730  p_out = line.startPoint();
731  EXPECT_NEAR(p_out.getX(), 9, 1e-7);
732  EXPECT_NEAR(p_out.getY(), 10, 1e-7);
733  p_out = line.endPoint();
734  EXPECT_NEAR(p_out.getX(), 7, 1e-7);
735  EXPECT_NEAR(p_out.getY(), 8, 1e-7);
736 }
737 
738 
Implementations
::testing::Types< f2c::types::Geometry< OGRPoint, wkbPoint >, F2CPoint, f2c::types::Geometry< OGRLinearRing, wkbLinearRing >, F2CLinearRing, f2c::types::Geometry< OGRLineString, wkbLineString >, F2CLineString, f2c::types::Geometry< OGRMultiPoint, wkbMultiPoint >, F2CMultiPoint, f2c::types::Geometry< OGRMultiLineString, wkbMultiLineString >, F2CMultiLineString, f2c::types::Geometry< OGRPolygon, wkbPolygon >, F2CCell, f2c::types::Geometry< OGRMultiPolygon, wkbMultiPolygon >, F2CCells > Implementations
Definition: Geometry_test.cpp:13
f2c::types::Geometry::within
bool within(const Geometry< T2, R2 > &geom) const
Check if this geometry is inside another geometry.
Definition: Geometry_impl.hpp:163
f2c::types::Geometry::touches
bool touches(const Geometry< T2, R2 > &geom) const
Check if this and another geometry touch each other.
Definition: Geometry_impl.hpp:157
TYPED_TEST_CASE
TYPED_TEST_CASE(fields2cover_types_geometry, Implementations)
f2c::types::Geometry
Definition: Geometry.h:26
types.h
f2c::types::Geometry::intersects
bool intersects(const Geometry< T2, R2 > &geom) const
Check if this and another geometry intersects.
Definition: Geometry_impl.hpp:169
F2CCell
f2c::types::Cell F2CCell
Definition: types.h:43
TYPED_TEST
TYPED_TEST(fields2cover_types_geometry, getAngContinuity)
Definition: Geometry_test.cpp:16
f2c::types::MultiLineString
Definition: MultiLineString.h:18
f2c::types::LinearRing
Definition: LinearRing.h:18
TEST
TEST(fields2cover_types_geometry, intersects)
Definition: Geometry_test.cpp:75
f2c::types::Cell
Definition: Cell.h:32
f2c::types::Point::rotateFromPoint
Point rotateFromPoint(double angle, const Point &p_r) const
Definition: Point.cpp:121
f2c::types::Geometry::crosses
bool crosses(const Geometry< T2, R2 > &geom) const
Check if this and another geometry cross.
Definition: Geometry_impl.hpp:151
f2c::types::MultiPoint
Definition: MultiPoint.h:18
f2c::types::LineString::startPoint
const Point startPoint() const
Definition: LineString.cpp:114
f2c::types::LineString
Definition: LineString.h:19
F2CLinearRing
f2c::types::LinearRing F2CLinearRing
Definition: types.h:41
8_complete_flow.ps
list ps
Definition: 8_complete_flow.py:43
f2c::types::Cells
Definition: Cells.h:21
F2CLineString
f2c::types::LineString F2CLineString
Definition: types.h:40
f2c::types::LineString::addPoint
void addPoint(double x, double y, double z=0)
Definition: LineString.cpp:107
fields2cover_types_geometry
Definition: Geometry_test.cpp:11
f2c::types::Point
Definition: Point.h:21
f2c::types::Geometry::distance
double distance(const Geometry< T2, R2 > &p) const
Compute shortest distance between this and another geometry.
Definition: Geometry_impl.hpp:139
f2c::types::LineString::endPoint
const Point endPoint() const
Definition: LineString.cpp:118
F2CMultiLineString
f2c::types::MultiLineString F2CMultiLineString
Definition: types.h:42
f2c::types::Point::getY
double getY() const
Definition: Point.cpp:96
1_basic_types.lines
lines
Definition: 1_basic_types.py:73
f2c::types::Point::getX
double getX() const
Definition: Point.cpp:95
F2CMultiPoint
f2c::types::MultiPoint F2CMultiPoint
Definition: types.h:39
F2CPoint
f2c::types::Point F2CPoint
Definition: types.h:38
f2c::types::Geometry::disjoint
bool disjoint(const Geometry< T2, R2 > &geom) const
Check if this and another geometry are disjoint.
Definition: Geometry_impl.hpp:145


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31