[GRASS-user] Importing .tif

Rich Shepard rshepard at appl-ecosys.com
Mon Jul 16 09:50:03 PDT 2018


On Mon, 16 Jul 2018, Markus Metz wrote:

> If you use the -o flag, you are potentially corrupting the data. The
> safest is to create a new location directly from the data to be imported,
> unless there is a good reason to assume that the srs info in the data as
> reported by gdalinfo is wrong.

Markus,

   I understand this. However, when I use the proj.4 string returned by
'gdalinfo -proj4' I am shown two different projections. I want to learn how
to do this correctly. Here's an example:

$ gdalinfo 45122c3307.tif -proj4 -nomd
Driver: GTiff/GeoTIFF
Files: 45122c3307.tif
        45122c3307.aux
Size is 2215, 3088
Coordinate System is:
PROJCS["NAD83(HARN) / Oregon North",
     GEOGCS["NAD83(HARN)",
         DATUM["NAD83_High_Accuracy_Reference_Network",
             SPHEROID["GRS 1980",6378137,298.257222101,
                 AUTHORITY["EPSG","7019"]],
             TOWGS84[0,0,0,0,0,0,0],
             AUTHORITY["EPSG","6152"]],
         PRIMEM["Greenwich",0,
             AUTHORITY["EPSG","8901"]],
         UNIT["degree",0.0174532925199433,
             AUTHORITY["EPSG","9122"]],
         AUTHORITY["EPSG","4152"]],
     PROJECTION["Lambert_Conformal_Conic_2SP"],
     PARAMETER["standard_parallel_1",46],
     PARAMETER["standard_parallel_2",44.33333333333334],
     PARAMETER["latitude_of_origin",43.66666666666666],
     PARAMETER["central_meridian",-120.5],
     PARAMETER["false_easting",8202099.737532808],
     PARAMETER["false_northing",0],
     UNIT["international_feet",0.3048],
     AXIS["X",EAST],
     AXIS["Y",NORTH]]
PROJ.4 string is:
'+proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs '
Origin = (7722808.500000000000000,600993.000000000000000)
Pixel Size = (1.500000000000000,-1.500000000000000)
Corner Coordinates:
Upper Left  ( 7722808.500,  600993.000) (122d21'46.47"W, 45d17'59.99"N)
Lower Left  ( 7722808.500,  596361.000) (122d21'44.98"W, 45d17'14.27"N)
Upper Right ( 7726131.000,  600993.000) (122d21' 0.00"W, 45d18' 0.75"N)
Lower Right ( 7726131.000,  596361.000) (122d20'58.51"W, 45d17'15.02"N)
Center      ( 7724469.750,  598677.000) (122d21'22.49"W, 45d17'37.51"N)
Band 1 Block=2215x1 Type=Byte, ColorInterp=Red
   Description = Band_1

Band 2 Block=2215x1 Type=Byte, ColorInterp=Green
   Description = Band_2

Band 3 Block=2215x1 Type=Byte, ColorInterp=Blue
   Description = Band_3

#------------
$ grass75 -gtext
# defind new location, LDQ, using above proj.4 string. Start grass and run:
r.in.gdal in=$HOME/path/to/data/45122c3307.tif out=south_area
ERROR: Projection of dataset does not appear to match current location.

        Location PROJ_INFO is:
        name: unnamed
        ellps: grs80
        proj: lcc
        lat_1: 46
        lat_2: 44.33333333333334
        lat_0: 43.66666666666666
        lon_0: -120.5
        x_0: 2500000
        y_0: 0
        towgs84: 0,0,0,0,0,0,0
        no_defs: defined

        Dataset PROJ_INFO is:
        name: NAD83(HARN) / Oregon North
        datum: nad83harn
        ellps: grs80
        proj: lcc
        lat_1: 46
        lat_2: 44.33333333333334
        lat_0: 43.66666666666666
        lon_0: -120.5
        x_0: 2500000
        y_0: 0
        towgs84: 0,0,0,0,0,0,0
        no_defs: defined

        ERROR: datum

        In case of no significant differences in the projection definitions,
        use the -o flag to ignore them and use current location definition.
        Consider generating a new location from the input dataset using the
        'location' parameter.


>> Can I display this DLQ in color? (I think the last time I used aerial
>> photographs or satellite imagery was with grass-4.1 or -5.x.)
>
> Try d.rgb

   Okay. Thanks.

Rich


More information about the grass-user mailing list