[postgis-users] distance and intersection with 3d geometries

strk at refractions.net strk at refractions.net
Mon Sep 12 08:40:56 PDT 2005


distance() is a 2d only function
--strk;

On Mon, Sep 12, 2005 at 04:37:36PM +0200, Joaquin Jose del Cerro Murciano wrote:
> 
> Hi all,
> 
> I am having some trouble getting distance to work correctly with 3d 
> geometries.
> 
> I have tried with a "select" simple to see as it worked.
> The results are not those that hoped.
> I do not understand it.
> 
> $
> $ uname -a
> FreeBSD Silvanesti 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Mon May 23 12:17:48 
> CEST 2005     root at Silvanesti:/usr/obj/usr/src/sys/MYKERNEL  i386
> $
> $ psql -d dister05
> Welcome to psql 7.4.7, the PostgreSQL interactive terminal.
> 
> Type:  \copyright for distribution terms
>        \h for help with SQL commands
>        \? for help on internal slash commands
>        \g or terminate with semicolon to execute query
>        \q to quit
> 
> dister05=# select postgis_full_version();
>                                     postgis_full_version
> --------------------------------------------------------------------------------------------
>  POSTGIS="1.0.0RC3" PROJ="Rel. 4.4.9, 29 Oct 2004" USE_STATS DBPROC="0.2.0" 
> RELPROC="0.2.0"
> (1 row)
> 
> ister05=# select
> dister05-#   distance(
> dister05(#     MakeLine(MakePoint(200,200), MakePoint(400,200)),
> dister05(#     MakeLine(MakePoint(300,100), MakePoint(300,300))
> dister05(#   )::int as A_Expected0, -- expected 0, ok
> dister05-#   distance(
> dister05(#     MakeLine(MakePoint(200,200,10), MakePoint(400,200,10)),
> dister05(#     MakeLine(MakePoint(300,100,10), MakePoint(300,300,10))
> dister05(#   )::int as B_Expected0, -- expected 0, ????
> dister05-#   distance(
> dister05(#     MakeLine(MakePoint(200,200,  0), MakePoint(400,200,  0)),
> dister05(#     MakeLine(MakePoint(300,100,100), MakePoint(300,300,100))
> dister05(#   )::int as C_Expected100, -- expected 100, ????
> dister05-#   distance(
> dister05(#     MakeLine(MakePoint(200,200,0), MakePoint(400,200,100)),
> dister05(#     MakeLine(MakePoint(300,100,0), MakePoint(300,300,100))
> dister05(#   )::int as D_Expected50 -- expected 50 aprox., ????
> dister05-# ;
>  a_expected0 | b_expected0 | c_expected100 | d_expected50
> -------------------+------------------+----------------------+--------------
>                      0 |                   26 |                         0 | 28
> (1 row)
> 
> dister05=#
> 
> The second column is the same that first but with an elevation of 10 (z=10).
> Because it is not zero?
> 
> In the third column the lines are not crossed in the space.
> The lines are in different planes (z=0, z=100).
> 
> That I can be making bad?
> 
> Best regards,
> Joaquin
> 
> P.S. Sorry for my terrible English.
> 
> 		
> ______________________________________________ 
> Renovamos el Correo Yahoo! 
> Nuevos servicios, más seguridad 
> http://correo.yahoo.es
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list