[GRASS-user] grass wiki on RST troubleshooting

this wiki has been quite helpful, as well as the link in it for working with contours. http://grass.osgeo.org/wiki/RST_Spline_Surfaces#Troubleshooting

I’m not sure I understand where this is to make the change for MAXPOINTS?

“In the v.surf.rst/v.vol.rst, there is a MAXPOINTS value defined (surf.h). MAXPOINTS simply says how many input points are allowed to be computed without segmentation. I had to increase the value of MAXPOINTS in surf.h to 1346 (or a bit more) and then to use segmax=1346 to avoid segmentation.”

(sidenote) : Something else I found cool, was using some contour lines from a USGS map, and patching in the spot elevations (I’m working on projects in central/south florida where its quite flat, so any supplemental elevation data helps). It seems that, since they are both on layer 1, that the module incorporates the use of the points from the contour lines as well as the spot elevations that were patched in. Nice! In that other software you cant have different geometries in the same file. I never understood why this would be practical. In GRASS, this is a refreshing flexibility!

Thanks, and happy GRASS-ing!

Mark

On Fri, February 27, 2009 20:43, M S wrote:

this wiki has been quite helpful, as well as the link in it for working
with
contours. http://grass.osgeo.org/wiki/RST_Spline_Surfaces#Troubleshooting

I'm not sure I understand where this is to make the change for MAXPOINTS?

"In the v.surf.rst/v.vol.rst, there is a MAXPOINTS value defined
(surf.h).
MAXPOINTS simply says how many input points are allowed to be computed
without segmentation. I had to increase the value of MAXPOINTS in surf.h
to
1346 (or a bit more) and then to use segmax=1346 to avoid segmentation."

This is in the source code and you have to recompile v.surf.rst.

Moritz

Sorry for interuption, but I could not find place where in v.surf.rst
MAXPOINTS is used for anything else than printing a warning. URL to
line in SVN? If I'm correct, no need to recompile anything.

Maris.

2009/2/27, Moritz Lennert <mlennert@club.worldonline.be>:

without segmentation. I had to increase the value of MAXPOINTS in surf.h

This is in the source code and you have to recompile v.surf.rst.

Moritz

On Fri, Feb 27, 2009 at 9:17 PM, Maris Nartiss <maris.gis@gmail.com> wrote:

Sorry for interuption, but I could not find place where in v.surf.rst
MAXPOINTS is used for anything else than printing a warning. URL to
line in SVN? If I'm correct, no need to recompile anything.

[neteler@localhost vector]$ grep MAXPOINTS v.*rst/* | grep define
v.surf.rst/surf.h:#define MAXPOINTS 400
v.vol.rst/surf.h:#define MAXPOINTS 700

grep MAXPOINTS v.*rst/* | grep '='
v.surf.rst/main.c: KMAX2 = 2 * npmin; /* was: KMAX2 =
MAXPOINTS; fixed by JH in 12/01 */
v.surf.rst/main.c: KMAX2 = MAXPOINTS;
v.vol.rst/main.c: KMAX2 = MAXPOINTS;
v.vol.rst/user1.c: if (NPOINT > MAXPOINTS && KMIN <= KMAX) {
v.vol.rst/user1.c: if (NPOINT < MAXPOINTS && KMAX != MAXPOINTS)

You see that MAXPOINTS is assigned to KMAX2 and
then used.

Here at Trento, we are currently trying to see how to
- either dynamically define MAXPOINTS/KMAX2
- or minimize the overhead while maximising MAXPOINTS.

The problem is:
grep malloc v.*rst/* | grep KMAX2
v.vol.rst/user2.c: /* if(!(point=(struct
point_3d*)G_malloc(sizeof(struct point_3d)*(KMAX2+1))))
v.vol.rst/user2.c: if (!(b = (double
*)G_malloc(sizeof(double) * (KMAX2 + 2)))) {
v.vol.rst/user2.c: if (!(w = (double
*)G_malloc(sizeof(double) * (KMAX2 + 1)))) {
v.vol.rst/user3.c: if (!(w2 = (double *)G_malloc(sizeof(double) *
(KMAX2 + 1))))
v.vol.rst/user3.c: if (!(wz2 = (double *)G_malloc(sizeof(double)
* (KMAX2 + 1))))
v.vol.rst/user3.c: if (!(wz1 = (double *)G_malloc(sizeof(double)
* (KMAX2 + 1))))

The KMAX2 is directly linked to G_malloc() so that can cannot easily
set it to a high number.

More to be studied here...

Markus

Mark wrote:

http://grass.osgeo.org/wiki/RST_Spline_Surfaces#Troubleshooting
>
> I'm not sure I understand where this is to make the change for
> MAXPOINTS?

Moritz:

This is in the source code and you have to recompile v.surf.rst.

wiki updated.

Hamish

Maris wrote:

> Sorry for interuption, but I could not find place where in v.surf.rst
> MAXPOINTS is used for anything else than printing a warning. URL to
> line in SVN? If I'm correct, no need to recompile anything.

I think you are right for v.surf.rst.
but v.vol.rst seems to use it.

Markus:

You see that MAXPOINTS is assigned to KMAX2 and then used.

.... but that part of the source is commented out and the KMAX2 setting
is the same on both sides of the if/else.

Here at Trento, we are currently trying to see how to
- either dynamically define MAXPOINTS/KMAX2
- or minimize the overhead while maximising MAXPOINTS.

great!

Hamish

On Fri, Feb 27, 2009 at 9:43 PM, M S <mseibel@gmail.com> wrote:

this wiki has been quite helpful, as well as the link in it for working with
contours. http://grass.osgeo.org/wiki/RST_Spline_Surfaces#Troubleshooting

I'm not sure I understand where this is to make the change for MAXPOINTS?

Followup:

In GRASS >= 6.5 there is now a "npmax" parameter to control the previously
hardcoded MAXPOINTS, kindly implemented by Antonio Galea.

If there are no objections, I'll backport it to GRASS 6.4 (have tested it so
far with 11000 MODIS maps). No severe change...
http://trac.osgeo.org/grass/changeset/36679

Markus