Skip to main content

Advertisement

Log in

Affine-invariant querying of spatial data using a triangle-based logic

  • Published:
GeoInformatica Aims and scope Submit manuscript

Abstract

If the same land area is photographed from two different angles, then a computer can recognize the two images to show the same land area by proving that the images are affine-invariant. In practice, images are abstracted as a type of spatial data that is a finite set of triangles. Hence we propose a simple affine-generic query language with variables over finite sets of triangles. The proposed query language is intuitive and has the same expressive power as the affine-generic fragment of first-order logic over the reals on triangle databases.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Similar content being viewed by others

Notes

  1. To be exact, they are topological concepts. The affinities of the plane are a subgroup of the homeomorphisms of the plane, so the invariance under the boundary and interior operations carry over naturally.

References

  1. Aiello M, van Benthem J (2002) Logical patterns in space. In: Barker-Plummer D, Beaver D, van Benthem J, Scotto di Luzio P (eds) Words, Proofs, and Diagrams, pages 5–25. CSLI

  2. Aiello M, van Benthem J (2002) A modal walk through space. Journal of Applied Non-Classical Logics 12(3-4):319–363

    Article  Google Scholar 

  3. Anderson S, Revesz PZ (2009) Efficient maxcount and threshold operators of moving objects. Geoinformatica 13(4):355–396

    Article  Google Scholar 

  4. De berg M, van Kreveld M, Schwarzkopf O (2000) Computational Geometry. Springer-Verlag Overmars M (ed)

  5. Bochnak J, Coste M, Roy MF (1987) Géométrie algébrique réelle. Springer-Verlag, Berlin

    Google Scholar 

  6. Chen CX, Zaniolo C (2000) SQLST: A spatio-temporal data model and query language. In: Storey VC, Laender AHF, Liddle SW (eds) Conceptual Modeling, 19th International Conference on Conceptual Modeling (ER’00), volume 1920 of Lecture Notes in Computer Science. Springer-Verlag, pp 96–111

  7. Chomicki J, Haesevoets S, Kuijpers B, Revesz PZ (2003) Classes of spatiotemporal objects and their closure properties. Annals of Mathematics and Artificial Intelligence 39(4):431–461

    Article  Google Scholar 

  8. Chomicki J, Haesevoets S, Kuijpers B, Revesz PZ (2003) Classes of spatiotemporal objects and their closure properties. Annals of Mathematics and Artificial Intelligence 39(4):431–461

    Article  Google Scholar 

  9. Chomicki J, Revesz PZ (1999) Constraint-based interoperability of spatiotemporal databases. Geoinformatica 3(3):211–243

    Article  Google Scholar 

  10. Codd E (1970) A relational model for large shared databanks. Communications of the ACM 13(6):377–387

    Article  Google Scholar 

  11. Daggumati S, Revesz PZ, Svehla C (2016) The A-Maze-D advanced maze development system for fast game design and implementation. International Journal of Systems Applications, Engineering and Development 10:195–204

    Google Scholar 

  12. Dou J, Li J (2014) Image matching based local delaunay triangulation and affine invariant geometric constraint. Optik 125:526–531

    Article  Google Scholar 

  13. Egenhofer M, Herring J (1990) A mathematical framework for the definition of topological relationships. In: Brassel K, Kishimoto H (eds) Proceedings of the Fourth International Symposium on Spatial Data Handling, pp 803–813

  14. Geerts F, Haesevoets S, Kuijpers B (2002) A theory of spatio-temporal database queries. In: Ghelli G, Grahne G (eds) Database Programming Languages, 8th International Workshop, DBPL 2001, volume 2397 of Lecture Notes in Computer Science. Springer, pp 198–212

  15. Gottfried B (2015) A comparative study of linear and region based diagrams. J Spatial Information Science 10(1):3–20

    Google Scholar 

  16. Grumbach S, Rigaux P, Segoufin L (1998) The dedale system for complex spatial queries. SIGMOD Rec. 27(2):213–224

    Article  Google Scholar 

  17. Gyssens M, Van den Bussche J, Van Gucht D (1999) Complete geometric query languages. Journal of Computer and System Sciences 58(3):483–511

    Article  Google Scholar 

  18. Haesevoets S, Kuijpers B, Revesz PZ (2017) Affine-invariant triangulation of spatio-temporal data with an application to image retrieval. ISPRS International Journal of Geo-Information 6(4):100

    Article  Google Scholar 

  19. Hagedoorn M, Veldkamp RC (1999) Reliable and efficient pattern matching using an affine invariant metric. International Journal of Computer Vision 31:203–225

    Article  Google Scholar 

  20. Hoff DJ, Olver PJ (2013) Extensions of invariant signatures for object recognition. Journal of Mathematical Imaging and Vision 45:176–185

    Article  Google Scholar 

  21. Huttenlocher DP, Klauderman GA, Rucklidge WJ (1998) Comparing images using the Hausdorff distance. IEEE Transactions on Pattern Analysis and Machine Intelligence 15:850–863

    Article  Google Scholar 

  22. Kanellakis PC, Kuper GM, Revesz PZ (1995) Constraint query languages. Journal of Computer and System Sciences 51:26–52

    Article  Google Scholar 

  23. Kuijpers B, Paredaens J, Van den Bussche J (1997) On topological elementary equivalence of spatial databases. In: Afrati F, Kolaitis P (eds) Proceedings of the 6th International Conference on Database Theory (ICDT’97), volume 1186 of Lecture Notes in Computer Science. Springer-Verlag, pp 432–446

  24. Lamdan Y, Schwartz JT, Wolfson HJ (1990) Affine-invariant model-based object recognition. IEEE Journal of Robotics and Automation 6:578–589

    Article  Google Scholar 

  25. Laurini R, Thompson D (1992) Fundamentals of spatial information systems number 37 in APIC series academic press

  26. Li L, Revesz PZ (2004) Interpolation methods for spatio-temporal geographic data. Computers, Environment and Urban Systems 28(3):201–227

    Article  Google Scholar 

  27. Liu Z. h., Wang Y, Jing Y (2014) A feature matching algorithm based on an illumination and affine invariant for aerial image registration. Sensors & Transducers 163:82–89

    Google Scholar 

  28. Matos L, Moreira J, Carvalho A (2012) Representation and management of spatiotemporal data in object-relational databases. In: Proceedings of the 27th Annual ACM Symposium on Applied Computing. ACM Press, New York, NY, USA

  29. G. Nielson (1993) A characterization of an affine invariant triangulation. In: Farin G, Hagen H, Noltemeier H (eds) Geometric Modelling Computing Supplementum 8, pp 191–210

  30. Papdimitriou CH, Suciu D, Vianu V (1996) Topological queries in spatial databases. In: Proceedings of the 15th ACM Symposium on Principles of Database Systems, ACM Press, pp 81–92

  31. Paredaens J, Van den Bussche J, Van Gucht D (1994) Towards a theory of spatial database queries. In: Proceedings of the 13th ACM Symposium on Principles of Database Systems, ACM Press, pp 279–288

  32. Paredaens J, Kuper G, Libkin L (2000) Constraint databases, Springer-Verlag

  33. Raviv Dan, Kimmel Ron (2015) Affine invariant geometry for non-rigid shapes. International Journal of Computer Vision 111(1):1–11

    Article  Google Scholar 

  34. Revesz PZ (2002) Introduction to constraint databases, Springer-Verlag

  35. Revesz PZ (2008) Robust affine-invariant similarity measures for patterned triangles. In: 10th IASTED Int. Conf. on Computer Graphics and Imaging. ACTA Press, pp 292–297

  36. Revesz PZ (2010) Introduction to databases: from biological to Spatio-Temporal Springer-Verlag

  37. Revesz PZ, Chen R, Kanjamala P, Li Y, Liu Y, Wang Y (2000) The MLPQ/GIS constraint database system. In: Chen W, Naughton JF , Bernstein PA (eds) Proceedings of the 2000 ACM SIGMOD International Conference on Management of Data, May 16-18. ACM, Dallas, Texas, USA, p 601

  38. Roberts LG (1963) Machine perception of three-dimensional solids, Ph.D. Thesis, Massachusetts Institute of Technology, Dept. of Electrical Engineering

  39. Tuzel O, Marks TK, Tambe S (2016) Robust face alignment using a mixture of invariant experts. In: European Conference on Computer Vision. Springer-Verlag, pp 825–841

  40. Vieira TH, Martinez D, Andrade M, Lewiner TH (2016) Estimating affine-invariant structures on triangle meshes. Computers & Graphics 60:83–92

    Article  Google Scholar 

  41. Worboys M (1994) A unified model for spatial and temporal information. Computer Journal 37:26–34

    Article  Google Scholar 

  42. Worboys MF, Duckham M (2018) GIS - a computing perspective (3. ed.) CRC Press

  43. Yue H, Rilett LR, Revesz PZ (2016) Spatio-temporal traffic video data archiving and retrieval system. Geoinformatica 20(1):59–94

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Bart Kuijpers.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendix

Appendix

We collect below some of the technical proofs, starting with the proof of the soundness lemma.

Proof of Lemma 4.2. Let \(\hat {\sigma } = \{\hat {R}_{1}, \hat {R}_{2}, \ldots , \hat {R}_{m}\}\) be a triangle database schema. Let \(\dot {R}_{i}\) be the corresponding spatial point relation names of arity \(3 \cdot ar(\hat {R}_{i})\), for 1 ≤ im, and let \(\dot {\sigma }\) be the corresponding point database schema \(\{\dot {R}_{1}, \dot {R}_{2}, \ldots , \dot {R}_{m}\}\). We translate each formula \(\hat {\varphi }\) of FO({PartOf}, \(\hat {\sigma })\) into an equivalent formula in FO{Between}, \(\dot {\sigma }\). We do this by induction on the structure of FO({PartOf}, \(\hat {\sigma })\)-formulas.

First, we translate the variables of \(\hat {\varphi }\). Each triangle variable △ is naturally translated into three spatial point variables p1, p2 and p3. We allow one or more of the corner points of a triangle to coincide, so there are no further restrictions on the variables pj, for 1 ≤ i ≤ 3.

The atomic formulas of FO({PartOf}, \(\hat {\sigma })\) are equality expressions on triangle variables, expressions of the form PartOf(△1,△2), and expressions of the form \({\hat {R}_{i}}(\bigtriangleup _{1}, \bigtriangleup _{2}, \ldots , \bigtriangleup _{k_{i}})\), where \(k_{i} = ar(\hat {R}_{i})\), for 1 ≤ im. More complex formulas can be constructed using the Boolean operators ∧, ∨ and ¬ and existential quantification.

The translation of atomic formulas.

We first show that all atomic formulas of FO({PartOf}, \(\hat {\sigma })\) can be expressed in the language FO{Between}, \(\dot {\sigma }\).

  1. (i)

    The translation of (△1 = △2), where △1 is translated into p1,1, p1,2 and p1,3 and △2 is translated into p2,1, p2,2 and p2,3, equals

    $$ \displaylines{\qquad \bigvee_{\sigma(1,2,3) = (j_{1}, j_{2}, j_{3}), \sigma \in {\mathcal{S}}_{3}} (p_{1,1} \mathrel{=} p_{2,{j_{1}}}\land p_{1,2} \mathrel{=} p_{2,{j_{2}}}\land p_{1,3} \mathrel{=} p_{2,{j_{3}}}),\qquad} $$

    where \({\mathcal {S}}_{3}\) is the set of all permutations of {1, 2, 3}. This formula expresses, that the corner points of △1 and △2 coincide, when taken in the right order. The correctness of this translation follows trivially from the definition of triangle equality (see Definition 4.2).

  2. (ii)

    The translation of PartOF(△12), where △1 is translated into p1,1, p1,2 and p1,3 and △2 is translated into p2,1, p2,2 and p2,3, is

    $$ \displaylines{\qquad\bigwedge\limits_{i=1}^{3} \textbf{InTriangle}(p_{1,i}, p_{2,1}, p_{2,2}, p_{2,3}),\qquad} $$

    where the definition of InTriangle is:

    $$ \textbf{InTriangle}(p, p_{1}, p_{2}, p_{3}) := \exists p_{4}(\textbf{Between}({p_{1}}{p_{4}}{p_{2}}) \mathrel{\land} \textbf{Between}({p_{4}}{p}{p_{3}})). $$

    Figure 9 illustrates the corresponding geometric construction. The correctness of this translation follows from the definition of the predicate PartOF (see Definition 4.1).

  3. (iii)

    The translation of \({\hat {R}}_{i}(\bigtriangleup _{1}, \bigtriangleup _{2}, \ldots , \bigtriangleup _{k})\), where △i is translated into pi,1, pi,2 and pi,3 for 1 ≤ ik, is

    $$ \dot{R}_{i}(p_{1,1}, p_{1,2}, p_{1,3}, p_{2,1}, p_{2,2}, p_{2,3}, \ldots, p_{k,1}, p_{k,2}, p_{k,3}). $$

    The correctness of this translation follows from Definition 3.2 and Remark 3.1.

Fig. 9
figure 9

In this illustration, the expression InTriangle(p, p1, p2, p3) is true because there exists a point p4 between p1 and p2 such that p lies between p4 and p3

The translation of composed formulas.

Assume that we already correctly translated the FO\((\{\textbf {PartOf}\}, \hat {\sigma })\)-formulas \(\hat {\varphi }\) and \(\hat {\psi }\) into the FO({Between}, \(\dot {\sigma }\))-formulas \(\dot {\varphi }\) and \(\dot {\psi }\). Suppose that the number of free variables in \(\hat {\varphi }\) is kφ and that of \(\hat {\psi }\) is kψ. Therefore, we can assume that, for each triangle database \(\hat {\mathcal {D}}\) over the input schema \(\hat {\sigma }\), and for each kφ-tuple of triangles (T1, T2,…,Tkφ) given as \((({\mathsf {p}}_{1,1}, {\mathsf {p}}_{1,2}, {\mathsf {p}}_{1,3}), ({\mathsf {p}}_{2,1}, {\mathsf {p}}_{2,2}, {\mathsf {p}}_{2,3}), \ldots , ({\mathsf {p}}_{k_{\varphi },1}, {\mathsf {p}}_{k_{\varphi },2}, {\mathsf {p}}_{k_{\varphi },3}))\) that

$$ \begin{array}{@{}rcl@{}} \hat{\mathcal{D}}\models\hat{\varphi}[ \mathsf{T}_{1}, \mathsf{T}_{2}, \ldots, \mathsf{T}{k_{\varphi}}] \text{ if and only if }\\ \dot{\mathcal{D}} \models\dot{\varphi}[{\mathsf{p}}_{1,1}, {\mathsf{p}}_{1,2}, {\mathsf{p}}_{1,3}, {\mathsf{p}}_{2,1}, {\mathsf{p}}_{2,2}, {\mathsf{p}}_{2,3}, \ldots, {\mathsf{p}}_{k_{\varphi},1}, {\mathsf{p}}_{k_{\varphi},2}, {\mathsf{p}}_{k_{\varphi},3}] \end{array} $$

is true when \(\dot {\mathcal {D}}\) is the point database over the input schema \(\dot {\sigma }\), obtained from \(\hat {\mathcal {D}}\) by applying the canonical bijection cantr between \(((\mathbb {R}^{2})^{3})^{k_{\varphi }}\) and \((\mathbb {R}^{2})^{3k_{\varphi }}\), on \(\hat {\mathcal {D}}\). For the formula \(\hat {\psi }\) the analog holds.

In the following, we omit the kφ-tuples (resp., kψ-tuples) of triangles and 3kφ-tuples (resp., 3kψ-tuples) of points on which the formulas are applied, to make the proofs more readable.

  1. (i)

    The translation of \(\hat {\varphi } \mathrel {\land } \hat {\psi }\) is \(\dot {\varphi }\mathrel {\land }\dot {\psi }\). Indeed,

    $$ \begin{array}{@{}rcl@{}} &\dot{\mathcal{D}} \models (\dot{\varphi}\mathrel{\land}\dot{\psi}) \\ iff. & \dot{\mathcal{D}} \models \dot{\varphi}\ and\ \dot{\mathcal{D}} \models\dot{\psi} \\ iff. & \hat{\mathcal{D}}\models \hat{\varphi}\ and\ \hat{\mathcal{D}}\models\hat{\psi}\\ iff. & \hat{\mathcal{D}}\models (\hat{\varphi}\mathrel{\land}\hat{\psi}). \end{array} $$
  2. (ii)

    The translation of \(\hat {\varphi } \mathrel {\lor } \hat {\psi }\) is \(\dot {\varphi }\mathrel {\lor }\dot {\psi }\). Indeed,

    $$ \begin{array}{@{}rcl@{}} &\dot{\mathcal{D}} \models (\dot{\varphi}\mathrel{\lor}\dot{\psi}) \\ iff. &\dot{\mathcal{D}} \models \dot{\varphi}\ or\ \dot{\mathcal{D}} \models\dot{\psi}\\ iff. & \hat{\mathcal{D}}\models \hat{\varphi}\ or\ \hat{\mathcal{D}}\models\hat{\psi} \\ iff. & \hat{\mathcal{D}}\models (\hat{\varphi}\mathrel{\lor}\hat{\psi}). \end{array} $$
  3. (iii)

    The translation of \(\neg \hat {\varphi }\) is \(\neg \dot {\varphi }\). Indeed,

    $$ \begin{array}{@{}rcl@{}} & \dot{\mathcal{D}} \models \neg\dot{\varphi} \\ iff. & \text{ it is not true that } \dot{\mathcal{D}} \models \dot{\varphi}\\ iff. & \text{ it is not true that } \hat{\mathcal{D}}\models \hat{\varphi}\\ iff. & \hat{\mathcal{D}}\models \neg\hat{\varphi}. \end{array} $$
  4. (iv)

    Assume that \(\hat {\varphi }\) has free variables △,△1,…,△k and △ is translated into p1, p2, p3 and △i is translated into pi,1, pi,2, pi,3, for 1 ≤ ik. The translation of

    $$\exists\bigtriangleup \hat{\varphi}(\bigtriangleup, \bigtriangleup_{1}, \bigtriangleup_{2}, \ldots, \bigtriangleup_{k})$$
    $$\text{is }\exists p_{1} \exists p_{2} \exists p_{3} \dot{\varphi}(p_{1}, p_{2}, p_{3}, p_{1,1}, p_{1,2}, p_{1,3}, \ldots, p_{k,1}, p_{k,2}, p_{k,3}).$$

    Indeed,

    $$ \begin{array}{@{}rcl@{}} & \dot{\mathcal{D}} \models \exists p_{1} \exists p_{2} \exists p_{3} \dot{\varphi}(p_{1}, p_{2}, p_{3})[{\mathsf{p}}_{1,1}, {\mathsf{p}}_{1,2}, {\mathsf{p}}_{1,3}, \ldots, {\mathsf{p}}_{k,1}, {\mathsf{p}}_{k,2}, {\mathsf{p}}_{k,3}] \\ iff. & \text{ there exist points } {\mathsf{p}}_{1}, {\mathsf{p}}_{2}, {\mathsf{p}}_{3}\ in\ \mathbb{R}^{2} \text{ such that } \\ & \dot{\mathcal{D}} \models \dot{\varphi}[{\mathsf{p}}_{1}, {\mathsf{p}}_{2}, {\mathsf{p}}_{3}, {\mathsf{p}}_{1,1}, {\mathsf{p}}_{1,2}, {\mathsf{p}}_{1,3}, \ldots, {\mathsf{p}}_{k,1}, {\mathsf{p}}_{k,2}, {\mathsf{p}}_{k,3}]\\ iff. & \text{ there exists a triangle } \mathsf{T}{} \text{ such that } \hat{\mathcal{D}}\models \hat{\varphi}[\mathsf{T}{}, \mathsf{T}_{1}, \ldots, \mathsf{T}{k}], \text{ where } \\ & \mathsf{T}{i} \text{is the triangle with corner points}\ {\mathsf{p}}_{i,1}, {\mathsf{p}}_{i,2}\ \text{and}\ {\mathsf{p}}_{i,3} for 1 \leq i \leq k\\ iff. & \hat{\mathcal{D}}\models \exists\mathsf{T}{} \hat{\varphi}(\mathsf{T}{})[ \mathsf{T}_{1}, \ldots, \mathsf{T}{k}]. \end{array} $$

To summarize the proof strategy, let \(\hat {\sigma } = \{\hat {R}_{1}, \hat {R}_{2}, \ldots , \hat {R}_{m}\}\) be a triangle database schema. Let \(\dot {\sigma } = \{\dot {R}_{1}, \dot {R}_{2}, \ldots , \dot {R}_{m}\}\) be the corresponding point database schema. Each formula \(\hat {\varphi }\) in FO({PartOf}, \(\hat {\sigma })\), with free variables △1,△2,…,△k can be translated into a FO{Between}, \(\dot {\sigma }\)-formula \(\dot {\varphi }\) with free variables p1, p2, p3, p1,1, p1,2, p1,3, p2,1, p2,2, p2,3,…,pk,1, pk,2, pk,3. This translation is such that, for all triangle databases \(\hat {\mathcal {D}}\) over \(\hat {\sigma }\), \(\hat {\mathcal {D}}\models \hat {\varphi }\) iff. \(\dot {\mathcal {D}} \models \dot {\varphi }\). Here, \(\dot {\mathcal {D}}\) is the point database over \(\dot {\sigma }\) which is the image of \(\hat {\mathcal {D}}\) under the canonical bijection between \((\mathbb {R}^{2})^{3})^{k}\) and \((\mathbb {R}^{2})^{3k}\). This completes the soundness proof.

Next, we give the proof of the completeness lemma.

Proof of Lemma 4.3. Let \(\hat {\sigma } = \{\hat {R}_{1}, \hat {R}_{2}, \ldots , \hat {R}_{m}\}\) be a triangle database schema and \(\dot {\sigma }\) be the corresponding point database schema. We have to prove that we can translate every triangle database query, expressed in the language FO{Between}, \(\dot {\sigma }\), into a triangle database query in the language FO({PartOf}, \(\hat {\sigma })\) over triangle databases.

We first show how we can simulate point variables by a degenerated triangle, and any FO{Between}, \(\dot {\sigma }\)-formula \(\dot {\varphi }(p_{1}, p_{2}, \ldots , p_{k})\) by a formula φ(△1,△2,…,△k), where △1,△2,…,△k represent triangles that are degenerated into points. We prove this by induction on the structure of FO{Between}, \(\dot {\sigma }\)-formulas. Initially, each FO{Between}, \(\dot {\sigma }\)-formula \(\dot {\varphi }(p_{1}, p_{2}, \ldots , p_{k})\) will be translated into a FO({PartOf}, \(\hat {\sigma })\)-formula \(\hat {\varphi }(\bigtriangleup _{1}, \bigtriangleup _{2}, \ldots , \bigtriangleup _{k})\) with the same number of free variables.

The translation of a point variable p is the triangle variable △, and we add the condition Point△ as a conjunct to the beginning of the translation of the formula. The definition of Point△ is

$$ \forall \bigtriangleup{^{\prime}} (\textbf{PartOf}({\bigtriangleup{^{\prime}}, \bigtriangleup}\rightarrow (\bigtriangleup \mathrel= \bigtriangleup{^{\prime}})). $$

In the following, we always assume that such formulas Point△ are already added to the translation as a conjunct.

The translation of atomic formulas.

The atomic formulas of the language FO({Between}, \(\dot {\sigma }\)) are equality constraints on point variables, formulas of the form Between(p1, p2, p3), and formulas of the type \(\dot {R}_{i}(p_{1}, p_{2}, \ldots , p_{k_{i}})\), where \(k_{i} = 3 \cdot ar(\hat {R}_{i})\). We show that all of those can be simulated by an equivalent formula of FO({PartOf}, \(\hat {\sigma })\).

  1. (i)

    The translation of (p1 = p2) is \((\bigtriangleup _{1} =_{\vartriangle } \bigtriangleup _{2})\).

  2. (ii)

    The translation of Between(p1p2p3), where △1, △2 and △3 (which as assumed are already declared points) are the translations of p1, p2 and p3, respectively, is expressed by saying that all triangles that contain both △1 and △3 should also contain △2. It then follows from the convexity of triangles (or line segments, in the degenerated case) that △2 lies on the line segment between △1 and △3. Figure 10 illustrates this principle. We now give the formula translating Between(p1p2p3):

    $$ \forall \bigtriangleup_{4} ((\textbf{PartOf}({\bigtriangleup_{1}}{\bigtriangleup_{4}})\land \textbf{PartOf}({\bigtriangleup_{3}}{\bigtriangleup_{4}}) \rightarrow \textbf{PartOf}({\bigtriangleup_{2}}{\bigtriangleup_{4}})). $$

    The correctness of this translation follows from the fact that triangles are convex objects.

  3. (iii)

    Let \(\dot {R}_{j}\) be a relation name from \(\dot {\sigma } = \{\dot {R}_{1}, \dot {R}_{2}, \ldots , \dot {R}_{m}\}\). Let \(ar(\hat {R}_{j}) = k_{j}\) and thus \(ar(\dot {R}_{j}) = 3k_{j}\), for 1 ≤ jm. The translation of \(\dot {R}_{j}(p_{1,1}, p_{1,2}, p_{1,3}, p_{2,1}, p_{2,2}, p_{2,3}, \ldots , p_{k,1}, p_{k,2}, p_{k,3})\) is:

    $$ \exists\bigtriangleup_{1}\exists\bigtriangleup_{2}\ldots\exists\bigtriangleup_{k}({\hat{R}_{j}}(\bigtriangleup_{1}, \bigtriangleup_{2}, \ldots, \bigtriangleup_{k}) \mathrel{\land} \bigwedge\limits_{i=1}^{k} \textbf{CornerP}(\bigtriangleup_{i,1}, \bigtriangleup_{i,2}, \bigtriangleup_{i,3}, \bigtriangleup_{i})). $$

    The definition of CornerP is:

    $$ \begin{array}{@{}rcl@{}} \textbf{CornerP}(\bigtriangleup_{1}, \bigtriangleup_{2}, \bigtriangleup_{3}, \bigtriangleup):= \forall \bigtriangleup_{4} ((\textbf{Point}({\bigtriangleup_{4}}) \land \textbf{PartOf}({\bigtriangleup_{4}},{\bigtriangleup})\\ \rightarrow \text{Intriangle}_{\vartriangle}(\bigtriangleup_{4}, \bigtriangleup_{1}, \bigtriangleup_{2}, \bigtriangleup_{3})). \end{array} $$

    The predicate \(\textbf {InTriangle}_{\vartriangle }\) is the translation of the predicate InTriangle of the language FO{Between} as described in the proof of Lemma 4.2, into FO({PartOF}). The FO{Between} formula expressing InTriangle only uses Between. In the previous item of this proof, we already showed how this can be translated into FO({PartOF}).

    Given a (3k)-tuple of points (p1,1, p1,2, p1,3, p2,1, p2,2, p2,3,…,pa,1, pk,2, pk,3) in \(\mathbb {R}^{2}\). There will be 6k k-tuples of triangles (T1, T2,…,Tk) such that, for each of the Ti, 1 ≤ ik, the condition CornerP(Ti, 1,Ti, 2,Ti, 3,Ti) is true. However, there will only be one tuple of triangles that is the image of the 3k-tuple of points (p1,1, p1,2, p1,3, p2,1, p2,2, p2,3,…,pa,1, pk,2, pk,3) under the inverse of the canonical bijection cantr. This shows that the simulation is correct.

Fig. 10
figure 10

Illustration of the translation of the predicate Between. The (degenerated) triangle Tq (in blue) lies between the (degenerated) triangles Tp and Tr if and only if all triangles (illustrated by the orange, red and brown triangles) that contain both Tp and Tr, also contain Tq

The translation of composed formulas.

Now suppose that we already simulated the FO{Between}, \(\dot {\sigma }\) formulas \(\dot {\varphi }(p_{1}, p_{2}, \ldots , p_{k_{\varphi }})\) and \(\dot {\psi }(p_{1}, p_{2}, \ldots , p_{k_{\psi }})\) into formulas \(\hat {\varphi }\) and \(\hat {\psi }\) in FO({PartOf}, \(\hat {\sigma })\) with free variables △1, △2, …, \(\bigtriangleup _{{k_{\varphi }}}\) and \(\bigtriangleup _{{1}}^{\prime }\), \(\bigtriangleup _{{2}}^{\prime }\), …, \(\bigtriangleup _{{k_{\psi }}}^{\prime }\), respectively. Hence, we can assume that, for each triangle database \(\hat {\mathcal {D}}\) over \(\hat {\sigma }\) and for each kφ-tuple of triangles (T1, T2, …, Tkφ) = \((({\mathsf {p}}_{1}, {\mathsf {p}}_{1}, {\mathsf {p}}_{1}), ({\mathsf {p}}_{2}, {\mathsf {p}}_{2}, {\mathsf {p}}_{2}), \ldots , ({\mathsf {p}}_{k_{\varphi }}, {\mathsf {p}}_{k_{\varphi }}, {\mathsf {p}}_{k_{\varphi }}))\), which are required to be degenerated into points, that

$$ \hat{\mathcal{D}} \models \hat{\varphi}[\mathsf{T}_{1}, \mathsf{T}_{2}, \ldots, \mathsf{T}{k_{\varphi}}] iff. \dot{\mathcal{D}}\models \dot{\varphi}[{\mathsf{p}}_{1}, {\mathsf{p}}_{2}, \ldots, {\mathsf{p}}_{k_{\psi}}]. $$

For \(\hat {\psi }\) we have analogue conditions.

The composed formulas \(\dot {\varphi } \land \dot {\psi }\), \(\dot {\varphi } \lor \dot {\psi }\), \(\neg \dot {\varphi }\) and \(\exists p \dot {\varphi }\), are translated into \(\hat {\varphi } \land \hat {\psi }\), \(\hat {\varphi } \lor \hat {\psi }\), \(\neg \hat {\varphi }\) and \(\exists \bigtriangleup (\hat {\varphi })\), respectively if we assume that p is translated into △. The correctness proofs for these translations are similar to the proofs in Lemma 4.2. Therefore, we do not repeat them here. This concludes the proof of Lemma 4.3.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Haesevoets, S., Kuijpers, B. & Revesz, P.Z. Affine-invariant querying of spatial data using a triangle-based logic. Geoinformatica 24, 849–879 (2020). https://doi.org/10.1007/s10707-020-00402-1

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10707-020-00402-1

Keywords

Navigation