Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why don ST_Interects and ST_Intersection return consistent results?

consistent results Return
0
Posted

Why don ST_Interects and ST_Intersection return consistent results?

0

Commonly, if you intersect two lines to get a point using ST_Intersection you will find that the point does not ST_Intersect either of the originating lines. This seems very inconsistent! However, you must bear in mind that numbers in a computer are not the “real numbers” of mathematics, but double-precision numbers with 64-bit storage. So the derived point may not fall exactly on the line connecting the vertices of the original line, but slightly to one side or the other, to fix into the grid of real numbers that are representable in double precision. Less commonly, you may find two features that return true for ST_Intersects, but return an EMPTY geometry for ST_Intersection. This is because ST_Intersects is slightly more precise than ST_Intersection, so ST_Intersects is detecting an interaction, but ST_Intersection is unable to compute the intersection point.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123