[GRASS-user] Re: /usr/lib/grass/scripts/r.in.wms: line 439: /usr/lib/grass/etc/r.in.wms/r.in.gdalwarp: Argument list too long

Seb spluque at gmail.com
Fri May 29 14:16:43 EDT 2009


On Fri, 29 May 2009 05:30:25 -0700 (PDT),
Hamish <hamish_b at yahoo.com> wrote:

> Seb wrote:
>> I should have mentioned that before trying with 'gdalwarp', I tried
>> what 'r.in.wms' does with 'r.in.gdalwarp', but it also failed with:

>> ---<--------------------cut
here---------------start-------------------> ---
>> $ /usr/lib/grass64/etc/r.in.wms/r.in.gdalwarp
>> in='wms_global_mosaic_nc__0.geotiff,wms_global_mosaic_nc__1.geotiff'
>> out=test s_srs='EPSG:4326' Creating output file that is 1054P x
>> 1056L.  Processing input file wms_global_mosaic_nc__0.geotiff.
>> 0...10...20...30...40...50...60...70...80...90...100 - done.  ERROR:
>> Projection of dataset does not appear to match current location.

>> Location PROJ_INFO is: name: Albers Equal Area datum: wgs84 towgs84:
>> 0.000,0.000,0.000 proj: aea ellps: wgs84 a: 6378137.0000000000 es:
>> 0.0066943800 f: 298.2572235630 lat_0: 58.2500000000 lat_1:
>> 57.0000000000 lat_2: 59.5000000000 lon_0: -63.0000000000 x_0:
>> 0.0000000000 y_0: 0.0000000000

>> Dataset PROJ_INFO is: name: Albers Equal Area proj: aea datum: wgs84
>> ellps: wgs84 lat_1: 57 lat_2: 59.5 lat_0: 58.25 lon_0: -63 x_0: 0
>> y_0: 0 no_defs: defined

>> ERROR: units

>> You can use the -o flag to r.in.gdal to override this check and use
>> the location definition for the dataset.  Consider generating a new
>> location from the input dataset using the 'location' parameter.
>> ERROR: r.in.gdalwarp: r.in.gdal failure.  ---<--------------------cut
here---------------end---------------------> ---


> if you are confident that projections match you could edit the script
> to add the '-o' flag to r.in.gdal.

>> ERROR: units
> ??

> what does 'g.proj -p' say?

The output is:

---<--------------------cut here---------------start------------------->---
-PROJ_INFO-------------------------------------------------
name       : Albers Equal Area
datum      : wgs84
towgs84    : 0.000,0.000,0.000
proj       : aea
ellps      : wgs84
a          : 6378137.0000000000
es         : 0.0066943800
f          : 298.2572235630
lat_0      : 58.2500000000
lat_1      : 57.0000000000
lat_2      : 59.5000000000
lon_0      : -63.0000000000
x_0        : 0.0000000000
y_0        : 0.0000000000
-PROJ_UNITS------------------------------------------------
unit       : km
units      : kilometers
meters     : 1000.0000000000
---<--------------------cut here---------------end--------------------->---

However, I see that gdalwarp loses the units information too when called
as in my previous message (removing -te as per your suggestion):

---<--------------------cut here---------------start------------------->---
$ gdalwarp -s_srs 'EPSG:4326' -t_srs="$(g.proj -wf)" \
    $GISDBASE/wms_download/wms_global_mosaic_nc__0.geotiff test.tif
$ gdalinfo test.tif 
Driver: GTiff/GeoTIFF
Files: test.tif
Size is 1054, 1056
Coordinate System is:
PROJCS["Albers Equal Area",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.2572235630016,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Albers_Conic_Equal_Area"],
    PARAMETER["standard_parallel_1",57],
    PARAMETER["standard_parallel_2",59.5],
    PARAMETER["latitude_of_center",58.25],
    PARAMETER["longitude_of_center",-63],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["unknown",1]]
Origin = (-245.125242962135900,-239.629671881403425)
Pixel Size = (0.014979742284917,-0.014979742284917)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    -245.125,    -239.630) ( 63d 0'15.03"W, 58d14'52.26"N)
Lower Left  (    -245.125,    -255.448) ( 63d 0'15.03"W, 58d14'51.75"N)
Upper Right (    -229.337,    -239.630) ( 63d 0'14.06"W, 58d14'52.26"N)
Lower Right (    -229.337,    -255.448) ( 63d 0'14.06"W, 58d14'51.75"N)
Center      (    -237.231,    -247.539) ( 63d 0'14.55"W, 58d14'52.00"N)
Band 1 Block=1054x1 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA 
Band 2 Block=1054x1 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA 
Band 3 Block=1054x1 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA 
Band 4 Block=1054x1 Type=Byte, ColorInterp=Alpha
---<--------------------cut here---------------end--------------------->---


-- 
Seb



More information about the grass-user mailing list