[GRASS-user] importing dem files: projection details?

Markus Neteler neteler at osgeo.org
Sun Mar 21 19:23:48 EDT 2010


On Mon, Mar 15, 2010 at 7:38 PM, Tyler Smith <tyler.smith at eku.edu> wrote:
> On 03/15/2010 09:38 AM, Markus Neteler wrote:
>> On Mon, Mar 15, 2010 at 1:35 PM, Tyler Smith<tyler.smith at eku.edu>  wrote:
>>> On 03/15/2010 03:42 AM, Markus Neteler wrote:
>>>
>>> Trying the auto route:
>>>
>>> grass64 -gui
>>> select define new location with georeferenced file
>>> select the dem file: k42.dem
>>> select the TN transformation, as probably better than the default for
>>> adjacent Kentucky
>>> enter GRASS with the newly created location and the PERMANENT mapset
>>>
>>> Results in this error:
>>>
>>> "g.proj or projection error: ERROR: default region is invalid
>>>    line 3:<north: 1080:43:46N>"
>>>
>>> So GRASS has automatically set up the location using degrees, and then
>>> get
>>> confused when the raster co-ordinates are provided in meters. Which
>>> appears
>>> to be fairly close to the sort of problem I ran into when setting this up
>>> manually. What am I missing?
>>>
>>
>> Please post the output of gdalinfo on that file. GRASS uses GDAL to detect
>> projections from metadata.
>>
>> Markus
>>
>
> Thanks for help! Here it is:
>
> gdalinfo k42.dem
> Driver: USGSDEM/USGS Optional ASCII DEM (and CDED)
> Files: k42.dem
> Size is 1222, 1535
> Coordinate System is:
> GEOGCS["NAD83",
>    DATUM["North_American_Datum_1983",
>        SPHEROID["GRS 1980",6378137,298.257222101,
...
> Metadata:
>  AREA_OR_POINT=Point
> Corner Coordinates:
>
> Upper Left  (    1467.054,    1080.729)
> Lower Left  (    1467.054,    1067.938)
> Upper Right (    1477.237,    1080.729)
> Lower Right (    1477.237,    1067.938)
> Center      (    1472.146,    1074.334)
...

I get actually a somewhat different result (GDAL trunk):

gdalinfo m40.dem
Driver: USGSDEM/USGS Optional ASCII DEM (and CDED)
Files: m40.dem
...
Corner Coordinates:
Upper Left  (    1447.317,    1055.177) (Invalid angle,Invalid angle)
Lower Left  (    1447.317,    1042.411) (Invalid angle,Invalid angle)
Upper Right (    1457.509,    1055.177) (Invalid angle,Invalid angle)
Lower Right (    1457.509,    1042.411) (Invalid angle,Invalid angle)
Center      (    1452.413,    1048.794) (Invalid angle,Invalid angle)
Band 1 Block=1223x1532 Type=Float32, ColorInterp=Undefined
  NoData Value=-32767
  Unit Type: ft

You may want to signal this as GDAL bug in the GDAL butracker:
http://trac.osgeo.org/gdal/

Unless GDAL doesn't read it correctly, it won't be understood by GRASS.
I tested with
ftp://ftp.kymartian.ky.gov/dems_usgs/m39.dem.zip

Markus


More information about the grass-user mailing list