Re: vector layer comparison in IDL [message #42751] |
Fri, 25 February 2005 15:16  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
yp wrote:
> Thanks for your suggestion. I did think of the same; to bring both
> layers to same grid. But I am stuck here... How should I go about
> interpolating the (x,y) pairs (No attributes are taken into account at
> the moment)? Here I have to interpolate the co-ordinate rather than
> data. If I go like interpolating all y's f(x) and all x's f(y) I'll end
> up with wrong interpolated data when there are more than one parallel
> lines.
So it's a problem of interpolating from one spatially irregular grid to
another, or perhaps of interpolating from both to a common grid. I have
posted on this in the past (to everybody's confusion) & will have a
think about it over the rest of the weekend. But first...
What is the shape of the grid elements in your vector layers? Triangles,
polygons? Or do your vector layers even have "grid elements". Are they
just lists of (x,y,data) with no implied spatial organization of x and
y? In this case it is normal to use Delaunay triangulation to create a
triagular grid linking the points.
Generally, the key to interpolating from one grid to another (say grid A
to grid B) is to locate the points in grid B relative to those in grid
A. In doing so you want to take advantage of regularity in the geometry
of the grids.
I *think* I understand your last point about parallel lines. Generally,
unless the grids are very simple, you'll have to consider x and y at the
same time.
IDL does have several functions, the most general one being GRIDDATA,
for interpolating from scattered data values. You may want to look at
the documentation.
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|