comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » fast search
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: fast search [message #50890 is a reply to message #50819] Thu, 19 October 2006 03:51 Go to previous message
m.goullant@gmail.com is currently offline  m.goullant@gmail.com
Messages: 10
Registered: July 2006
Junior Member
Just a little correction in the code: the dist is the mask :):

> This is more and less What I want to do:
>
> have this geographic data (could be 100000, 2 million, 4 million
> depends):
>
>
> PRO example
>
>
> points = myData()
>
> ;data structure of an irregular point cloud
> x = points.x ;X coord
> y = points.y ;Y coord
> z = points.z ; Elevation
>
>
> n = 5 ; number of iterations
> mask = 4.0 ; diameter. in meters. Like your dist
> maskType = 0 ; 0 a circle, 1 square
>
> FOR i=0L,n-1 DO BEGIN
> newZ = erosion(x,y,z,mask,maskType)
> ;(...)
> mask = mask + 2
> ENDFOR
>
> END
>
> FUNCTION erosion,x,y,z,mask,maskType ; Apply erosion to the data
>
> newZ=z
> radio = mask /2
> FOR i=0L,N_ELEMENTS(z)-1 DO BEGIN
> kernel = applyKernel(x,y,z,i,radio,maskType)
> ;center the kernel in the data(i) and get neighbours there are inside
> of the mask
> newZ[i]=MAX(z[kernel])
> ENDFOR
> RETURN,newZ
>
> END
>
> FUNCTION applyKernel,x,y,z,i,dist,maskType
>
> square = WHERE(x LE x[i] + dist AND x GE x[i] - dist AND y LE y[i]
> + dist AND y GE y[i] - dist)
>
> IF (maskType EQ 0) THEN BEGIN
> sqDistance = sqrt((x[square] - x[i])^2 + (y[square] -
> y[i])^2)
> neighbors = WHERE(sqDistance LE dist)
> circle = square[neighbors]
> RETURN,circle
> ENDIF
>
> RETURN,square
> END
>
> Because this is an iterative process with a "dist" variable, it's
> posible implement your code?
>
>
> Thank's in advance,
> Marie
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: a slip of the fingers
Next Topic: Re: resolving specific pro, functions inside of a file

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 14:53:51 PDT 2025

Total time taken to generate the page: 0.29788 seconds