[GRASSLIST:5958] v.surf.idw (point in region!!!)

Hi,
I see that in this new improved version (grass 6beta2) the interpolation consider only the vector points that falls into the current region, if i remember corrctly in the older version it was possible set a flag to choose if consider all points or just the sites in region.
I'm now dealing with meteorological stations that are limited in number, but all important and to be considered into my thiessen generation...
So I wander if it is possible to include a flag (as in older version) for decide if include/exclude points out of region.....
Or if is there an alternative way to go trough.....
What you think about?

Thanks,
Massimiliano

--
_____________________________________________________

Ing. Massimiliano Cannata

SUPSI - Istituto Scienze della Terra
C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
Tel +41 (0)91 935 12 25 - Fax +41 (0)91 935 12 09
mailto:massimiliano.cannata@supsi.ch
http://www.ist.supsi.ch

So, I've applied the change and things seems to work now.
In attachment i post the modified main.c file.
Hope it can be usefull.....

Maxi

Massimiliano Cannata wrote:

I see that in function new point (line 372) the author exclude points outside the region due to segmentation fault cased from new cell index solution.
My idea is to set a flag (-a interpolate trough all the points) that automatically select the old interpolation method to avoid any segmentation fault.......
so it should looks:
-n means use old interpolation method
-a means use old interpolation method over all the sites
else use new method over points in region

Impression and comments are welcome....
Maxi

Massimiliano Cannata wrote:

Hi,
I see that in this new improved version (grass 6beta2) the interpolation consider only the vector points that falls into the current region, if i remember corrctly in the older version it was possible set a flag to choose if consider all points or just the sites in region.
I'm now dealing with meteorological stations that are limited in number, but all important and to be considered into my thiessen generation...
So I wander if it is possible to include a flag (as in older version) for decide if include/exclude points out of region.....
Or if is there an alternative way to go trough.....
What you think about?

Thanks,
Massimiliano

--
_____________________________________________________

Ing. Massimiliano Cannata

SUPSI - Istituto Scienze della Terra
C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
Tel +41 (0)91 935 12 25 - Fax +41 (0)91 935 12 09
mailto:massimiliano.cannata@supsi.ch
http://www.ist.supsi.ch

--
_____________________________________________________

Ing. Massimiliano Cannata

SUPSI - Istituto Scienze della Terra
C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
Tel +41 (0)91 935 12 25 - Fax +41 (0)91 935 12 09
mailto:massimiliano.cannata@supsi.ch
http://www.ist.supsi.ch

--
_____________________________________________________

Ing. Massimiliano Cannata

SUPSI - Istituto Scienze della Terra
C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
Tel +41 (0)91 935 12 25 - Fax +41 (0)91 935 12 09
mailto:massimiliano.cannata@supsi.ch
http://www.ist.supsi.ch

(attachments)

main.c (17 KB)

On Wed, 2 Mar 2005, Massimiliano Cannata wrote:

Hi,
I see that in this new improved version (grass 6beta2) the interpolation consider only the vector points that falls into the current region, if i remember corrctly in the older version it was possible set a flag to choose if consider all points or just the sites in region.

The disable indexing -n flag is still there. And performs this purpose if you haven't got too many points. You will lose the feature though that if more than one point falls into a raster cell they are averaged; with the -n flag it will just be the point closest to the centre of the cell that is used for the interpolated value. But if your points are far apart this is unlikely to be a problem.

I have updated the descriptions to be a bit clearer.

The alternative way is of course as the man page says---enlarge the region to encompass all the points and use a mask to define where you want the interpolation to be done.

Paul

On Wed, 2 Mar 2005, Massimiliano Cannata wrote:

So, I've applied the change and things seems to work now.
In attachment i post the modified main.c file.
Hope it can be usefull.....

Maxi

Massimiliano Cannata wrote:

I see that in function new point (line 372) the author exclude points outside the region due to segmentation fault cased from new cell index solution.

Not sure what you mean here---in the new method the points are indexed according to which cell they fall into. It is not possible to index points that are outside the current region in this way (because they don't fall inside any cells) and so they are not included.

The -n flag doesn't index the points at all; it just uses all the points in the vector/sites file.

My idea is to set a flag (-a interpolate trough all the points) that automatically select the old interpolation method to avoid any segmentation fault.......

Please explain what you mean about the segmentation fault.

so it should looks:
-n means use old interpolation method
-a means use old interpolation method over all the sites

Yes but this is actually what -n does.

else use new method over points in region

Impression and comments are welcome....
Maxi

I'm not sure I understand what the improvement does. If you could explain better what the problem is with the existing version, it might help.

Paul

Hi Paul,
I try to better explain me.
In the grass version I have (grass-6.0.0beta2) when I interpolate a vector point file by using v.surf.idw (with or wothout the -n flags) the points that are not in the current region are not considered.
What I want is to consider also the points outside the region to generate the interpolated map.

I understand that it is not possible to consider them (poin out of region) by using the index point because they doesn't fall in any cell (otherwise segmentation fault happens!) but with the old method (not index cell) it is possible to consider also point out of region.

What I simply modify in the code is to add a -a flag that causes the use of old method (not index cell) with all the points in surface computation. All the rest is still the same.....

I'm I in wrong?
Let me know.
Ciao,
Maxi

Paul Kelly wrote:

On Wed, 2 Mar 2005, Massimiliano Cannata wrote:

So, I've applied the change and things seems to work now.
In attachment i post the modified main.c file.
Hope it can be usefull.....

Maxi

Massimiliano Cannata wrote:

I see that in function new point (line 372) the author exclude points outside the region due to segmentation fault cased from new cell index solution.

Not sure what you mean here---in the new method the points are indexed according to which cell they fall into. It is not possible to index points that are outside the current region in this way (because they don't fall inside any cells) and so they are not included.

The -n flag doesn't index the points at all; it just uses all the points in the vector/sites file.

My idea is to set a flag (-a interpolate trough all the points) that automatically select the old interpolation method to avoid any segmentation fault.......

Please explain what you mean about the segmentation fault.

so it should looks:
-n means use old interpolation method
-a means use old interpolation method over all the sites

Yes but this is actually what -n does.

else use new method over points in region

Impression and comments are welcome....
Maxi

I'm not sure I understand what the improvement does. If you could explain better what the problem is with the existing version, it might help.

Paul

--
_____________________________________________________

Ing. Massimiliano Cannata

SUPSI - Istituto Scienze della Terra
C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
Tel +41 (0)91 935 12 25 - Fax +41 (0)91 935 12 09
mailto:massimiliano.cannata@supsi.ch
http://www.ist.supsi.ch

On Wed, 2 Mar 2005, Massimiliano Cannata wrote:

Hi Paul,
I try to better explain me.
In the grass version I have (grass-6.0.0beta2) when I interpolate a vector point file by using v.surf.idw (with or wothout the -n flags) the points that are not in the current region are not considered.

Yes you are right. I thought it worked differently and this is a bug so I have changed it in CVS. I hope that will be all right even though it's near the 6.0 release. When indexing wasn't used it should have used all the points just like the old algorithm did. (This is what I have documented).

Hopefully it should work for you now and thanks for the bug report,

Paul