[GRASS5] "Illegal latitude for South" again

Sören Gebbert soerengebbert at gmx.de
Mon Jan 16 19:04:59 EST 2006


On Monday 16 January 2006 21:08, Markus Neteler wrote:
> Hi,
> 
> I think that we should find a solution for problems
> like this one:
> 
> g.region n=90N s=90N w=180W e=180E res=0:20
> r.in.onearth -b out=bluemarble_global_mosaic
> ...
> ************* DATA CHECK OK ***************
> ************** IMPORT DATA ****************
> Driver: GTiff/GeoTIFF
> Size is 1080, 540
> Coordinate System is:
> GEOGCS["WGS 84",
>     DATUM["WGS_1984",
>         SPHEROID["WGS 84",6378137,298.2572235629972,
>             AUTHORITY["EPSG","7030"]],
>         AUTHORITY["EPSG","6326"]],
>     PRIMEM["Greenwich",0],
>     UNIT["degree",0.0174532925199433],
>     AUTHORITY["EPSG","4326"]]
> Origin = (-180.000000,90.000000)
> Pixel Size = (0.33333334,-0.33333334)
> Metadata:
>   AREA_OR_POINT=Area
>   TIFFTAG_SOFTWARE=SGI's Image Format Library/1.2
> Corner Coordinates:
> Upper Left  (-180.0000000,  90.0000000) (180d 0'0.00"W, 90d 0'0.00"N)
> Lower Left  (-180.0000000, -90.0000054) (180d 0'0.00"W, 90d 0'0.02"S)
> Upper Right ( 180.0000107,  90.0000000) (180d 0'0.04"E, 90d 0'0.00"N)
> Lower Right ( 180.0000107, -90.0000054) (180d 0'0.04"E, 90d 0'0.02"S)
> Center      (   0.0000054,  -0.0000027) (  0d 0'0.02"E,  0d 0'0.01"S)
> Band 1 Block=1080x2 Type=Byte, ColorInterp=Red
> Band 2 Block=1080x2 Type=Byte, ColorInterp=Green
> Band 3 Block=1080x2 Type=Byte, ColorInterp=Blue
> A datum name wgs84 (WGS_1984) was specified without transformation parameters.
> Note that the GRASS default for wgs84 is towgs84=0.000,0.000,0.000.
> Projection of input dataset and current location appear to match.
> Proceeding with import...
> WARNUNG:G_set_window(): Illegal latitude for South
> 
> (It's even an error btw., import fails).
> 
> Apparently the NASA WMS delivers maps slightly larger.
> Instead of leaving the user alone with that problem which
> also appears with other world data sets I suggest to
> have a GRASS environment variable to optionally cut
> the map or whatever is appropriate in the underlying code.
> 
> Any ideas?

The problem disappears if i set the resolution to 0:15 or 0:30,
but thats only a workaround.

Maybe this little code helps a bit?:

-->line 262 in r.in.onearth

  #We have LatLong projection, no warp is needed!
  USEGDALWARP=1
  #There is a bug in nasa WMS service, it provides images which are lager then
  #the world :(, we have to crop the images
  if [ "$n" == "90" -a "$s" == "-90" -a "$w" == "-180" -a "$e" == "180" ] ; then

  # check if we have bc
  if [ ! -x "`which bc`" ] ; then
    echo "bc required, please install first" 2>&1
    exit 1
  fi
   n=`echo "$n - 0.001" | bc`
   s=`echo "$s + 0.001" | bc`
   e=`echo "$e - 0.001" | bc`
   w=`echo "$w + 0.001" | bc`
  fi

  
Its not nice, but it works for me. I tried dgalwarp -et but i didnt work. :(

New version of r.in.onearth available:
http://www-pool.math.tu-berlin.de/~soeren/grass/modules/r.in.onearth.tar.gz

Soeren
> 
> Markus
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5
> 
> 




More information about the grass-dev mailing list