[GRASS-user] r.in.wms issues

I am trying to use r.in.wms to get elevation data from wms.jpl.nasa.gov, but I have been running into two different problems. I have been using the gui on a mac with 6.3, although I also tried 6.4 RC2 and got similar results. The files do download but then I can't seem to work with them properly. I have tried geotiff and png. I have tried a bunch of other combinations as well.

The first problem seems to be with how temporary files are being named so that patching is not working properly. Here is the command that is being generated by the gui:

r.in.wms output=elev_us_ned2 mapserver=wms.jpl.nasa.gov/wms.cgi layers=us_ned format=png wmsquery=version=1.1.1 maxcols=1024 maxrows=1024 {wgetoptions=-c -t 5 -nv} {curloptions=-C - --retry 5 -s -S} method=cubic v=1

This is followed by this long list of errors:
Calculating tiles
Requesting 2 tiles.
Downloading tiles
Tile already downloaded
All tiles downloaded successfully
Creating output file that is 972P x 558L.
Processing input file /Users/dersh/grass/wms_download/elev_us_ned2__0.png.
Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 - done.
Invalid map <elev_us_ned2_tile_0_tmp.alpha>
Parse error
Raster map <elev_us_ned2_tile_0.1> not found
Invalid map <elev_us_ned2_tile_0_tmp.alpha>
Parse error
Raster map <elev_us_ned2_tile_0.2> not found
Illegal filename. Character <
> not allowed.
Illegal filename. Character <
> not allowed.
Illegal filename. Character <
> not allowed.
Raster map <elev_us_ned2_tile_0_tmp.1
elev_us_ned2_tile_0_tmp.2> not found
Illegal filename. Character <
> not allowed.
raster: couldn't be removed
Illegal filename. Character <
> not allowed.
header: couldn't be removed
Illegal filename. Character <
> not allowed.
category: couldn't be removed
Illegal filename. Character <
> not allowed.
color: couldn't be removed
Illegal filename. Character <
> not allowed.
history: couldn't be removed
Illegal filename. Character <
> not allowed.
misc: couldn't be removed
Illegal filename. Character <
> not allowed.
fcell: couldn't be removed
Illegal filename. Character <
> not allowed.
g3dcell: couldn't be removed
Illegal filename. Character <
> not allowed.
colr2/PERMANENT: couldn't be removed
<elev_us_ned2_tile_0_tmp.1
elev_us_ned2_tile_0_tmp.2> nothing removed
Creating output file that is 971P x 560L.
Processing input file /Users/dersh/grass/wms_download/elev_us_ned2__1.png.
Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 - done.
Invalid map <elev_us_ned2_tile_1_tmp.alpha>
Parse error
Raster map <elev_us_ned2_tile_1.1> not found
Invalid map <elev_us_ned2_tile_1_tmp.alpha>
Parse error
Raster map <elev_us_ned2_tile_1.2> not found
Illegal filename. Character <
> not allowed.
Illegal filename. Character <
> not allowed.
Illegal filename. Character <
> not allowed.
Raster map <elev_us_ned2_tile_1_tmp.1
elev_us_ned2_tile_1_tmp.2> not found
Illegal filename. Character <
> not allowed.
raster: couldn't be removed
Illegal filename. Character <
> not allowed.
header: couldn't be removed
Illegal filename. Character <
> not allowed.
category: couldn't be removed
Illegal filename. Character <
> not allowed.
color: couldn't be removed
Illegal filename. Character <
> not allowed.
history: couldn't be removed
Illegal filename. Character <
> not allowed.
misc: couldn't be removed
Illegal filename. Character <
> not allowed.
fcell: couldn't be removed
Illegal filename. Character <
> not allowed.
g3dcell: couldn't be removed
Illegal filename. Character <
> not allowed.
colr2/PERMANENT: couldn't be removed
<elev_us_ned2_tile_1_tmp.1
elev_us_ned2_tile_1_tmp.2> nothing removed
Patching [.1] channel
r.patch - elev_us_ned2_tile_0.1 not found
r.patch - elev_us_ned2_tile_1.1 not found
One or more input maps not found
Raster map <elev_us_ned2_tile_0.1> not found
<elev_us_ned2_tile_0.1> nothing removed
Raster map <elev_us_ned2_tile_1.1> not found
<elev_us_ned2_tile_1.1> nothing removed
Patching [.2] channel
r.patch - elev_us_ned2_tile_0.2 not found
r.patch - elev_us_ned2_tile_1.2 not found
One or more input maps not found
Raster map <elev_us_ned2_tile_0.2> not found
<elev_us_ned2_tile_0.2> nothing removed
Raster map <elev_us_ned2_tile_1.2> not found
<elev_us_ned2_tile_1.2> nothing removed
Raster map <elev_us_ned2> not found in current mapset

The odd thing is that I am left with four temporary maps in the mapset: elev_us_ned2_tile_0_tmp.1 elev_us_ned2_tile_0_tmp.2 elev_us_ned2_tile_1_tmp.1 elev_us_ned2_tile_1_tmp.1 so it seems that the script can't find these maps for some reasons.

The second problem, that might or might not be related, is that if I open the temporary files, there is a "slot" between them. It appears as though they just don't line up properly. Instead they are at an angle to each other. The tiles that are being selected are a top and bottom tile. They join at the right edge, but at the left edge there is a gap. So I am ending up with a black triangle through the middle of the image. Perhaps I have done something wrong so that the tile selection code is not working correctly.
I am using a UTM projection with an nad83 datum.
Perhaps this second problem is something that should be taken care of by the patching that is not happening because of the first problem?

Anyway, help would be greatly appreciated.

Thanks,

--Adam

On Tue, Jan 27, 2009 at 10:50 PM, Adam Dershowitz
<adershowitz@exponent.com> wrote:

I am trying to use r.in.wms to get elevation data from wms.jpl.nasa.gov, but
I have been running into two different problems. I have been using the gui
on a mac with 6.3, although I also tried 6.4 RC2 and got similar results.
The files do download but then I can't seem to work with them properly. I
have tried geotiff and png. I have tried a bunch of other combinations as
well.

The first problem seems to be with how temporary files are being named so
that patching is not working properly. Here is the command that is being
generated by the gui:

r.in.wms output=elev_us_ned2 mapserver=wms.jpl.nasa.gov/wms.cgi
layers=us_ned format=png wmsquery=version=1.1.1 maxcols=1024 maxrows=1024
{wgetoptions=-c -t 5 -nv} {curloptions=-C - --retry 5 -s -S} method=cubic
v=1

This is followed by this long list of errors:
Calculating tiles
Requesting 2 tiles.
Downloading tiles
Tile already downloaded
Tile already downloaded
All tiles downloaded successfully
Creating output file that is 972P x 558L.
Processing input file /Users/dersh/grass/wms_download/elev_us_ned2__0.png.
Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 - done.
Invalid map <elev_us_ned2_tile_0_tmp.alpha>
Parse error
Raster map <elev_us_ned2_tile_0.1> not found
Invalid map <elev_us_ned2_tile_0_tmp.alpha>

...

I tried in 6.4 and got (copying your command line):

r.in.wms output=elev_us_ned2 mapserver="wms.jpl.nasa.gov/wms.cgi" \
   layers=us_ned format=png wmsquery=version=1.1.1 maxcols=1024 \
   maxrows=1024 "wgetoptions=-c -t 5 -nv" curloptions="-C - --retry 5 -s -S" \
   method=cubic v=1
Calculating tiles
Requesting 1 tiles.
Downloading tiles
Downloading data
2009-01-27 22:53:36 URL:http://wms.jpl.nasa.gov/wms.cgi [53504] ->
"/home/neteler/grassdata/wms_download/elev_us_ned2__0.png" [1]
All tiles downloaded successfully
Creating output file that is 650P x 488L.
Processing input file /home/neteler/grassdata/wms_download/elev_us_ned2__0.png.
Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 - done.
Rename raster <elev_us_ned2_tile_0.1> to <elev_us_ned2.1>
Rename raster <elev_us_ned2_tile_0.2> to <elev_us_ned2.2>
ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset

Slightly better/different but eventually failing, too. :frowning:

Markus

On Jan 27, 2009, at 1:50 PM, Adam Dershowitz wrote:

I am trying to use r.in.wms to get elevation data from wms.jpl.nasa.gov, but I have been running into two different problems. I have been using the gui on a mac with 6.3, although I also tried 6.4 RC2 and got similar results. The files do download but then I can't seem to work with them properly. I have tried geotiff and png. I have tried a bunch of other combinations as well.

The first problem seems to be with how temporary files are being named so that patching is not working properly. Here is the command that is being generated by the gui:

r.in.wms output=elev_us_ned2 mapserver=wms.jpl.nasa.gov/wms.cgi layers=us_ned format=png wmsquery=version=1.1.1 maxcols=1024 maxrows=1024 {wgetoptions=-c -t 5 -nv} {curloptions=-C - --retry 5 -s -S} method=cubic v=1

This is followed by this long list of errors:
Calculating tiles
Requesting 2 tiles.
Downloading tiles
Tile already downloaded
All tiles downloaded successfully
Creating output file that is 972P x 558L.
Processing input file /Users/dersh/grass/wms_download/elev_us_ned2__0.png.
Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 - done.
Invalid map <elev_us_ned2_tile_0_tmp.alpha>
Parse error
Raster map <elev_us_ned2_tile_0.1> not found
Invalid map <elev_us_ned2_tile_0_tmp.alpha>
Parse error
Raster map <elev_us_ned2_tile_0.2> not found
Illegal filename. Character <
> not allowed.
Illegal filename. Character <
> not allowed.
Illegal filename. Character <
> not allowed.
Raster map <elev_us_ned2_tile_0_tmp.1
elev_us_ned2_tile_0_tmp.2> not found
Illegal filename. Character <
> not allowed.
raster: couldn't be removed
Illegal filename. Character <
> not allowed.
header: couldn't be removed
Illegal filename. Character <
> not allowed.
category: couldn't be removed
Illegal filename. Character <
> not allowed.
color: couldn't be removed
Illegal filename. Character <
> not allowed.
history: couldn't be removed
Illegal filename. Character <
> not allowed.
misc: couldn't be removed
Illegal filename. Character <
> not allowed.
fcell: couldn't be removed
Illegal filename. Character <
> not allowed.
g3dcell: couldn't be removed
Illegal filename. Character <
> not allowed.
colr2/PERMANENT: couldn't be removed
<elev_us_ned2_tile_0_tmp.1
elev_us_ned2_tile_0_tmp.2> nothing removed
Creating output file that is 971P x 560L.
Processing input file /Users/dersh/grass/wms_download/elev_us_ned2__1.png.
Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 - done.
Invalid map <elev_us_ned2_tile_1_tmp.alpha>
Parse error
Raster map <elev_us_ned2_tile_1.1> not found
Invalid map <elev_us_ned2_tile_1_tmp.alpha>
Parse error
Raster map <elev_us_ned2_tile_1.2> not found
Illegal filename. Character <
> not allowed.
Illegal filename. Character <
> not allowed.
Illegal filename. Character <
> not allowed.
Raster map <elev_us_ned2_tile_1_tmp.1
elev_us_ned2_tile_1_tmp.2> not found
Illegal filename. Character <
> not allowed.
raster: couldn't be removed
Illegal filename. Character <
> not allowed.
header: couldn't be removed
Illegal filename. Character <
> not allowed.
category: couldn't be removed
Illegal filename. Character <
> not allowed.
color: couldn't be removed
Illegal filename. Character <
> not allowed.
history: couldn't be removed
Illegal filename. Character <
> not allowed.
misc: couldn't be removed
Illegal filename. Character <
> not allowed.
fcell: couldn't be removed
Illegal filename. Character <
> not allowed.
g3dcell: couldn't be removed
Illegal filename. Character <
> not allowed.
colr2/PERMANENT: couldn't be removed
<elev_us_ned2_tile_1_tmp.1
elev_us_ned2_tile_1_tmp.2> nothing removed
Patching [.1] channel
r.patch - elev_us_ned2_tile_0.1 not found
r.patch - elev_us_ned2_tile_1.1 not found
One or more input maps not found
Raster map <elev_us_ned2_tile_0.1> not found
<elev_us_ned2_tile_0.1> nothing removed
Raster map <elev_us_ned2_tile_1.1> not found
<elev_us_ned2_tile_1.1> nothing removed
Patching [.2] channel
r.patch - elev_us_ned2_tile_0.2 not found
r.patch - elev_us_ned2_tile_1.2 not found
One or more input maps not found
Raster map <elev_us_ned2_tile_0.2> not found
<elev_us_ned2_tile_0.2> nothing removed
Raster map <elev_us_ned2_tile_1.2> not found
<elev_us_ned2_tile_1.2> nothing removed
Raster map <elev_us_ned2> not found in current mapset

The odd thing is that I am left with four temporary maps in the mapset: elev_us_ned2_tile_0_tmp.1 elev_us_ned2_tile_0_tmp.2 elev_us_ned2_tile_1_tmp.1 elev_us_ned2_tile_1_tmp.1 so it seems that the script can't find these maps for some reasons.

The second problem, that might or might not be related, is that if I open the temporary files, there is a "slot" between them. It appears as though they just don't line up properly. Instead they are at an angle to each other. The tiles that are being selected are a top and bottom tile. They join at the right edge, but at the left edge there is a gap. So I am ending up with a black triangle through the middle of the image. Perhaps I have done something wrong so that the tile selection code is not working correctly.
I am using a UTM projection with an nad83 datum.
Perhaps this second problem is something that should be taken care of by the patching that is not happening because of the first problem?

Anyway, help would be greatly appreciated.

Thanks,

--Adam

As a simple test I tried copying the following from the user manual page:
r.in.wms output=elevation_feet mapserver=http://wms.jpl.nasa.gov/wms.cgi layers=us_ned styles=feet_real
(http://grass.itc.it/grass63/manuals/html63_user/r.in.wms.html)
and I again got the same set of issues. A bunch of errors, 4 tmp files are created. Two of them seem like the correct data, while 2 are not. And they don't properly meet in the middle.

Adam Dershowitz wrote:
> I am trying to use r.in.wms to get elevation data from
> wms.jpl.nasa.gov, but I have been running into two different problems.
> I have been using the gui on a mac with 6.3, although I also tried 6.4
> RC2 and got similar results.

which/who's Mac binaries?
what version of gdal tools? ("gdalinfo --version" from the command prompt)

> The files do download but then I can't seem to work with them
> properly. I have tried geotiff and png. I have tried a bunch
> of other combinations as well.

....

> Here is the command that is being generated by the gui:
>
> r.in.wms output=elev_us_ned2 mapserver=wms.jpl.nasa.gov/wms.cgi \
> layers=us_ned format=png wmsquery=version=1.1.1 \
> maxcols=1024 maxrows=1024 {wgetoptions=-c -t 5 -nv} \
> {curloptions=-C - --retry 5 -s -S} method=cubic v=1

mapserver= usually starts with "http://". This appears to be optional for
wget; but I don't know about curl.

method=cubic is irrelevant if the location is WGS84 Lat/lon, you can omit it.

srs= is missing in above command?

> This is followed by this long list of errors:

....

> Invalid map <elev_us_ned2_tile_0_tmp.alpha>
> Parse error

?
perhaps a Mac/BSD vs GNU command line util using a non-portable command?

On linux(debian/etch) I get the same result/errors as Markus.

Markus:

I tried in 6.4 and got (copying your command line):

6.4.0rcX or develbranch6? Note in develbranch6 null values are broken:
trac #455, #392? http://trac.osgeo.org/grass/ticket/455

!!

GR65> r.info -r elev_us_ned65.1
min=-2147483648
max=53

#fix
GR65> r.null elev_us_ned65.1 setnull=-2147483648

strange, for <.2> min is given as -2147483648 but r.univar shows
zero null cells.

....

Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 -
done.
Rename raster <elev_us_ned2_tile_0.1> to <elev_us_ned2.1>
Rename raster <elev_us_ned2_tile_0.2> to <elev_us_ned2.2>

so far so good,

ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset
ERROR: Raster map <elev_us_ned2> not found in current mapset

Slightly better/different but eventually failing, too. :frowning:

fwiw, these "ERROR: Raster map <> not found in current mapset" are
from the 6 r.support calls in the r.in.wms script just after:

eval "r.in.gdalwarp $GDALWARP"
if [ $? -ne 0 ] ; then
   exit 1
fi

(I am not sure if that $? check really works: is it testing that eval
could run the command, not if the command exited successfully?)

the problem here is that the output is called <map.1> and <map.2> so the
raster map name passed to r.support are wrong. <map.2> is apparently
alpha layer (empty map), while <map.1> contains the data.

in a lat/lon WGS84 location:

grass640> g.region n=46:04N s=39:30N w=80:24W e=71:20W res=0:00:30

grass640> r.in.wms output=elev_us_ned64 \
   mapserver="wms.jpl.nasa.gov/wms.cgi" layers=us_ned format=png \
   wmsquery=version=1.1.1 maxcols=1024 maxrows=1024 \
   wgetoptions="-c -t 5 -nv" curloptions="-C - --retry 5 -s -S" \
   method=cubic v=1 --o --v

I get data in the <.1> file.

because the format is PNG & style is default, the values refer to color
and are in the range of 0-53. To see anything but mostly-black I needed
to do:
grass640> r.colors elev_us_ned64.1 col=bcyr

and you get a nice image.

'r.in.wms -l' says the "us_ned" layer is supposed to show:

LAYER: us_ned
  Title: United States elevation, 30m
  |
  | Continental United States elevation, produced from the USGS National Elevation.
  | The default style is scaled to 8 bit from the orginal floating point data.
  |
  STYLE: default
    Style title: Default Elevation
  STYLE: short_int
    Style title: short int signed elevation values when format is image/png or tiff
  STYLE: feet_short_int
    Style title: short int elevation values in feet when format is image/png or image/tiff
  STYLE: real
    Style title: DEM real numbers, in floating point format, meters, when used with image/tiff
  STYLE: feet_real
    Style title: DEM in real numbers, in floating point format, feet, when used with image/tiff

[how do they scale to "8 bit from the orginal floating point data" ?
what elevation is 255? Mount Whitney @ 4421m?]

anyway, if I add "style=real" to the r.in.wms command (according to the
above) you get the <.1> map in meters and the Catskills are not so flat :slight_smile:

sigh,
Hamish

On Jan 27, 2009, at 5:57 PM, Hamish wrote:

Adam Dershowitz wrote:

I am trying to use r.in.wms to get elevation data from
wms.jpl.nasa.gov, but I have been running into two different problems.
I have been using the gui on a mac with 6.3, although I also tried 6.4
RC2 and got similar results.

which/who's Mac binaries?

Kyngesburye

what version of gdal tools? ("gdalinfo --version" from the command prompt)

GDAL 1.5.4, released 2009/01/07
(I have also tried out the 1.6 release, and it reports GDAL 1.6.0, released 2008/12/04.)

The files do download but then I can't seem to work with them
properly. I have tried geotiff and png. I have tried a bunch
of other combinations as well.

....

Here is the command that is being generated by the gui:

r.in.wms output=elev_us_ned2 mapserver=wms.jpl.nasa.gov/wms.cgi \
  layers=us_ned format=png wmsquery=version=1.1.1 \
  maxcols=1024 maxrows=1024 {wgetoptions=-c -t 5 -nv} \
  {curloptions=-C - --retry 5 -s -S} method=cubic v=1

mapserver= usually starts with "http://". This appears to be optional for
wget; but I don't know about curl.

But the download seems to go fine. Although in my early testing I had it set for a higher resolution so it was getting a bunch of downloads and sometimes the server would complain that it was too busy. I only figured out that problem because in those cases the ".geotiff" files were much smaller. When I checked they contained the error message. But r.in.wms tried to use them anyway....

method=cubic is irrelevant if the location is WGS84 Lat/lon, you can omit it.

I am using UTM not Lat/Long. And that is why it is trying to do the conversion, I think.

srs= is missing in above command?

By default it was filling in src=EPSG:4326, which I believe is fine for UTM nad83 in the US. I tried it both with and without that with the same results.

This is followed by this long list of errors:

....

Invalid map <elev_us_ned2_tile_0_tmp.alpha>
Parse error

?
perhaps a Mac/BSD vs GNU command line util using a non-portable command?

On linux(debian/etch) I get the same result/errors as Markus.

Markus:

I tried in 6.4 and got (copying your command line):

I just tried that command again with 6.4RC2. I also get the identical results to Markus. (and adding style=feet_real make it reasonable units). However there are the two files created. If I try to view one of them there is still that "crack" across the middle, where it looks like one is rotated and the other is not. And if I try to view the other one it is just all zeros.

6.4.0rcX or develbranch6? Note in develbranch6 null values are broken:
trac #455, #392? http://trac.osgeo.org/grass/ticket/455

!!

GR65> r.info -r elev_us_ned65.1
min=-2147483648
max=53

#fix
GR65> r.null elev_us_ned65.1 setnull=-2147483648

strange, for <.2> min is given as -2147483648 but r.univar shows
zero null cells.

....

Using band 2 of source image as alpha.
0...10...20...30...40...50...60...70...80...90...100 -
done.
Rename raster <elev_us_ned2_tile_0.1> to <elev_us_ned2.1>
Rename raster <elev_us_ned2_tile_0.2> to <elev_us_ned2.2>

so far so good,

ERROR: Raster map <elev_us_ned2> not found in current mapset

Slightly better/different but eventually failing, too. :frowning:

fwiw, these "ERROR: Raster map <> not found in current mapset" are
from the 6 r.support calls in the r.in.wms script just after:

eval "r.in.gdalwarp $GDALWARP"
if [ $? -ne 0 ] ; then
  exit 1
fi

(I am not sure if that $? check really works: is it testing that eval
could run the command, not if the command exited successfully?)

the problem here is that the output is called <map.1> and <map.2> so the
raster map name passed to r.support are wrong. <map.2> is apparently
alpha layer (empty map), while <map.1> contains the data.

in a lat/lon WGS84 location:

grass640> g.region n=46:04N s=39:30N w=80:24W e=71:20W res=0:00:30

grass640> r.in.wms output=elev_us_ned64 \
  mapserver="wms.jpl.nasa.gov/wms.cgi" layers=us_ned format=png \
  wmsquery=version=1.1.1 maxcols=1024 maxrows=1024 \
  wgetoptions="-c -t 5 -nv" curloptions="-C - --retry 5 -s -S" \
  method=cubic v=1 --o --v

I get data in the <.1> file.

because the format is PNG & style is default, the values refer to color
and are in the range of 0-53. To see anything but mostly-black I needed
to do:
grass640> r.colors elev_us_ned64.1 col=bcyr

and you get a nice image.

'r.in.wms -l' says the "us_ned" layer is supposed to show:

LAYER: us_ned
Title: United States elevation, 30m
|
| Continental United States elevation, produced from the USGS National Elevation.
| The default style is scaled to 8 bit from the orginal floating point data.
|
STYLE: default
   Style title: Default Elevation
STYLE: short_int
   Style title: short int signed elevation values when format is image/png or tiff
STYLE: feet_short_int
   Style title: short int elevation values in feet when format is image/png or image/tiff
STYLE: real
   Style title: DEM real numbers, in floating point format, meters, when used with image/tiff
STYLE: feet_real
   Style title: DEM in real numbers, in floating point format, feet, when used with image/tiff

[how do they scale to "8 bit from the orginal floating point data" ?
what elevation is 255? Mount Whitney @ 4421m?]

anyway, if I add "style=real" to the r.in.wms command (according to the
above) you get the <.1> map in meters and the Catskills are not so flat :slight_smile:

sigh,
Hamish

Adam wrote:

But the download seems to go fine. Although in my early
testing I had it set for a higher resolution so it was
getting a bunch of downloads and sometimes the server would
complain that it was too busy. I only figured out that
problem because in those cases the ".geotiff"
files were much smaller. When I checked they contained the
error message. But r.in.wms tried to use them anyway....

yeah, we try to catch that but WMS servers act differently when they
fail so it is hard.. and apparently the "file" program is not very
portable to the Mac.

I just tried that command again with 6.4RC2. I also get
the identical results to Markus. (and adding
style=feet_real make it reasonable units).

ok, good. Those last 6 errors are just because setting the map title
and history fail because the map name is wrong (added ".1"). Nothing to
worry about too much. (in SVN I haven't fixed it but now you only see one
error)

> 6.4.0rcX or develbranch6? Note in develbranch6 null values are
> broken: trac #455, #392? http://trac.osgeo.org/grass/ticket/455
>
> !!
>
> GR65> r.info -r elev_us_ned65.1
> min=-2147483648
> max=53
>
> #fix
> GR65> r.null elev_us_ned65.1 setnull=-2147483648
>
> strange, for <.2> min is given as -2147483648 but r.univar shows
> zero null cells.

this is a separate bug apparently, stored range is also wrong in
grass 6.4.0rc2: (but "min=0" here)

# spearfish
g.region rasy=elevation.10m

r.in.wms output=elev_us_ned64gtif mapserver=wms.jpl.nasa.gov/wms.cgi \
  layers=us_ned style=real format=geotiff method=cubic

r.info -r elev_us_ned64gtif.1
min=0
max=1843.64624023438

r.univar -g elev_us_ned64gtif.1
min=1060.62268066406
max=1843.64624023438

I am using UTM not Lat/Long. And that is why it is trying
to do the conversion, I think.

ok, with the above spearfish example I see the tile lines too.

they are there because the reprojection is done before the patching?,
and the convergence angle* is not zero.

[*] grid north vs. true north ('g.region -n' in newer versions of grass)
using "d.grid -w 0:03 color=black" to overlay a lat/lon grid makes it obvious.

actually, I see that the sliver areas are 0.0 not null, so maybe the patch
is ok** but the nodata is set wrong. (so related to min=0 range error
above?)

[**] ie r.patch treats null as transparent but not 0s. so r.patch is
just following what the input data gives it.

much to do here,
Hamish

Hamish wrote:

this is a separate bug apparently, stored range is also
wrong in grass 6.4.0rc2: (but "min=0" here)

# spearfish
g.region rasy=elevation.10m

oops, to show that use "g.region -d": ie single tile, otherwise the
reprojection introduces real 0s in the slivers.

r.in.wms output=elev_us_ned64gtif mapserver=wms.jpl.nasa.gov/wms.cgi \
  layers=us_ned style=real format=geotiff method=cubic

r.info -r elev_us_ned64gtif.1
min=0
max=1843.64624023438

r.univar -g elev_us_ned64gtif.1
min=1060.62268066406
max=1843.64624023438

(and remember to remove cached tiles from $GISBASE/wms_download/ between
tests if you keep the map name the same)

Hamish

On Wed, Jan 28, 2009 at 3:44 AM, Adam Dershowitz, Ph.D., P.E.
<adershowitz@exponent.com> wrote:

Markus:

I tried in 6.4 and got (copying your command line):

I just tried that command again with 6.4RC2. I also get the identical
results to Markus.

I used instead the devel6_branch.

Hamish, do you plan to backport
http://trac.osgeo.org/grass/ticket/455
?

Markus