[postgis-users] 3D filtering?

Decarlo, Thomas R. (LARC-B702)[NCI INFORMATION SYSTEMS] thom.decarlo at nasa.gov
Fri May 9 06:27:24 PDT 2008


Paul,
Thanks! I was hoping for some more robust 3D support in the st_*
functions, but didn't hold out much hope.

Thom
--
Thom DeCarlo
-------------------------------------------------------
Evolution: Taking care of those too stupid to take care of themselves.

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Paul
Ramsey
Sent: Thursday, May 08, 2008 2:12 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] 3D filtering?

Because you are working with points, the answer is "yes", barely...

create or replace function d3d(geometry, geometry) returns float as
'select sqrt((st_x($1)-st_x($2))^2 + (st_y($1)-st_y($2))^2 +
(st_z($1)-st_z($2))^2)' language sql;

select b.* from a join b on (st_dwithin(a.geom, b.geom, [distance])
and d3d(a.geom, b.geom) < [distance]);

if st_dwithin worked in 3d the second clause would not be necessary,
but it doesn't. neither to the indices, so it could be slow, if you
have a lot of variation in z.

P.

On Thu, May 8, 2008 at 10:56 AM, Decarlo,  Thomas R. (LARC-B702)[NCI
INFORMATION SYSTEMS] <thom.decarlo at nasa.gov> wrote:
> I've got a question about processing 3D geometry data and I'm not sure
> if the query functions in PostGIS can help me.
>
> I have two tables (A and B) of 3D point features in a Euclidean space.
> I want to select all the points in B that are NOT within some distance
> (S) of any of the points in A.
>
> Can I do this query using PostGIS? If yes, what would the query look
> like?
>
> Thanks!
> Thom
> --
> Thom DeCarlo
> -------------------------------------
>     That Which Does Not Kill Me
>     Can Still Hurt Really Bad.
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
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