[postgis-users] Is there any way to find and select parallel lines in 3D?

Marcin Mionskowski mionskowskimarcin at gmail.com
Fri Feb 25 03:39:15 PST 2022

```*Have a look at
https://postgis.net/docs/PostGIS_Special_Functions_Index.html#PostGIS_3D_Functions
<https://postgis.net/docs/PostGIS_Special_Functions_Index.html#PostGIS_3D_Functions>*

*especially ST_3DDWithin and ST_3DDFullyWithin.*
*ST_Intersects(geomA,ST_Buffer(geomB,tolerance)) is basically the same as
ST_DWithin(geomA,geomB,tolerance).*
*And for segments, I can't explain it better than first hit of duckduckgo
search for 3d lines parallel
https://socratic.org/questions/how-do-i-know-if-two-lines-are-parallel-in-three-dimensional-space
<https://socratic.org/questions/how-do-i-know-if-two-lines-are-parallel-in-three-dimensional-space>*

pt., 25 lut 2022 o 11:36 Shaozhong SHI <shishaozhong at gmail.com> napisał(a):

> Is there any example of implementation for segments to have a look at?
>
> For 2D lines, it is possible to ST_buffer to detect potentially parallel
> lines.  That is useful since natural lines do not necessarily in parallel
> exactly.
>
> Is there any equivalent to ST_Buffer for dealing with 3D objects?
>
> Regards,
>
> David
>
> On Fri, 25 Feb 2022 at 09:30, Marcin Mionskowski <
> mionskowskimarcin at gmail.com> wrote:
>
>> It's easy for segments. Just use general math approach (for example first
>> hit with duckduckgo search for line equation 3d -
>> https://www.geeksforgeeks.org/equation-of-a-line-in-3d/).
>> This is not so simple for linestrings composed from multiple segments.
>> For exapmle, are the following lines parallel?
>> select ST_GeomFromText('LINESTRING(0 0 0,0 0 4)') geomA
>> ,ST_GeomFromText('LINESTRING(0 -1 0,1 0 1,0 1 2,-1 0 3,0 -1 4)') geomB
>>
>> czw., 24 lut 2022 o 10:53 Shaozhong SHI <shishaozhong at gmail.com>
>> napisał(a):
>>
>>> The following is interesting.
>>>
>>> How to select parallel lines in postgis - Geographic Information Systems
>>> Stack Exchange
>>> <https://gis.stackexchange.com/questions/224937/how-to-select-parallel-lines-in-postgis>
>>>
>>> However, it appears to be full 2D lines.
>>>
>>> Are there any solutions to find and select parallel lines in 3D?
>>>
>>> Regards,
>>>
>>> David
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-users
>>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20220225/08699c10/attachment.html>
```

More information about the postgis-users mailing list