<div dir="ltr"><br><br>On Mon, Jul 16, 2018 at 6:50 PM, Rich Shepard <<a href="mailto:rshepard@appl-ecosys.com">rshepard@appl-ecosys.com</a>> wrote:<br>><br>> On Mon, 16 Jul 2018, Markus Metz wrote:<br>><br>>> If you use the -o flag, you are potentially corrupting the data. The<br>>> safest is to create a new location directly from the data to be imported,<br>>> unless there is a good reason to assume that the srs info in the data as<br>>> reported by gdalinfo is wrong.<br>><br>><br>> Markus,<br>><br>> I understand this. However, when I use the proj.4 string returned by<br>> 'gdalinfo -proj4' I am shown two different projections. I want to learn how<br><div>> to do this correctly.</div><div><br></div><div>The proj4 string can not contain all the information present in WKT. As I mentioned before, 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.</div><div><br></div><div>Markus M<br></div><div><br></div><div>> Here's an example:</div>><br>> $ gdalinfo 45122c3307.tif -proj4 -nomd<br>> Driver: GTiff/GeoTIFF<br>> Files: 45122c3307.tif<br>> 45122c3307.aux<br>> Size is 2215, 3088<br>> Coordinate System is:<br>> PROJCS["NAD83(HARN) / Oregon North",<br>> GEOGCS["NAD83(HARN)",<br>> DATUM["NAD83_High_Accuracy_Reference_Network",<br>> SPHEROID["GRS 1980",6378137,298.257222101,<br>> AUTHORITY["EPSG","7019"]],<br>> TOWGS84[0,0,0,0,0,0,0],<br>> AUTHORITY["EPSG","6152"]],<br>> PRIMEM["Greenwich",0,<br>> AUTHORITY["EPSG","8901"]],<br>> UNIT["degree",0.0174532925199433,<br>> AUTHORITY["EPSG","9122"]],<br>> AUTHORITY["EPSG","4152"]],<br>> PROJECTION["Lambert_Conformal_Conic_2SP"],<br>> PARAMETER["standard_parallel_1",46],<br>> PARAMETER["standard_parallel_2",44.33333333333334],<br>> PARAMETER["latitude_of_origin",43.66666666666666],<br>> PARAMETER["central_meridian",-120.5],<br>> PARAMETER["false_easting",8202099.737532808],<br>> PARAMETER["false_northing",0],<br>> UNIT["international_feet",0.3048],<br>> AXIS["X",EAST],<br>> AXIS["Y",NORTH]]<br>> PROJ.4 string is:<br>> '+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 '<br>> Origin = (7722808.500000000000000,600993.000000000000000)<br>> Pixel Size = (1.500000000000000,-1.500000000000000)<br>> Corner Coordinates:<br>> Upper Left ( 7722808.500, 600993.000) (122d21'46.47"W, 45d17'59.99"N)<br>> Lower Left ( 7722808.500, 596361.000) (122d21'44.98"W, 45d17'14.27"N)<br>> Upper Right ( 7726131.000, 600993.000) (122d21' 0.00"W, 45d18' 0.75"N)<br>> Lower Right ( 7726131.000, 596361.000) (122d20'58.51"W, 45d17'15.02"N)<br>> Center ( 7724469.750, 598677.000) (122d21'22.49"W, 45d17'37.51"N)<br>> Band 1 Block=2215x1 Type=Byte, ColorInterp=Red<br>> Description = Band_1<br>><br>> Band 2 Block=2215x1 Type=Byte, ColorInterp=Green<br>> Description = Band_2<br>><br>> Band 3 Block=2215x1 Type=Byte, ColorInterp=Blue<br>> Description = Band_3<br>><br>> #------------<br>> $ grass75 -gtext<br>> # defind new location, LDQ, using above proj.4 string. Start grass and run:<br>> r.in.gdal in=$HOME/path/to/data/45122c3307.tif out=south_area<br>> ERROR: Projection of dataset does not appear to match current location.<br>><br>> Location PROJ_INFO is:<br>> name: unnamed<br>> ellps: grs80<br>> proj: lcc<br>> lat_1: 46<br>> lat_2: 44.33333333333334<br>> lat_0: 43.66666666666666<br>> lon_0: -120.5<br>> x_0: 2500000<br>> y_0: 0<br>> towgs84: 0,0,0,0,0,0,0<br>> no_defs: defined<br>><br>> Dataset PROJ_INFO is:<br>> name: NAD83(HARN) / Oregon North<br>> datum: nad83harn<br>> ellps: grs80<br>> proj: lcc<br>> lat_1: 46<br>> lat_2: 44.33333333333334<br>> lat_0: 43.66666666666666<br>> lon_0: -120.5<br>> x_0: 2500000<br>> y_0: 0<br>> towgs84: 0,0,0,0,0,0,0<br>> no_defs: defined<br>><br>> ERROR: datum<br>><br>> In case of no significant differences in the projection definitions,<br>> use the -o flag to ignore them and use current location definition.<br>> Consider generating a new location from the input dataset using the<br>> 'location' parameter.<br>><br>><br>>>> Can I display this DLQ in color? (I think the last time I used aerial<br>>>> photographs or satellite imagery was with grass-4.1 or -5.x.)<br>>><br>>><br>>> Try d.rgb<br>><br>><br>> Okay. Thanks.<br>><br>><br>> Rich<br>> _______________________________________________<br>> grass-user mailing list<br>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br><br></div>