DEM Elevation data

William E Reid wer at CSTONE.NET
Wed Jun 15 16:47:33 EDT 2005


It is a great tool.  Your problem is coordinates then.

You can actually build a tab file (I think)


This is all that belongs in the corresponding tab file.  So if you know 
or have the meta data for the file, you can put in the corners and that 
should get you there.  The corners are by coords/pixel resolution (which 
gdalinfo at least reports pixels)

Call it foo.tab

Place in it:

Definition Table
   File "<foo>.tif"
   Type "RASTER"
   (-79.492792,37.61519) (0,0) Label "",
   (-79.49158,37.28661) (0,1200) Label "",
   (-78.937352,37.61519) (1600,0) Label "",
   (-78.938564,37.28661) (1600,1200) Label ""
   CoordSys Earth Projection 1, 104
   Units "degree"




Then run gdalinfo again... to make sure it worked.  this is untested.

You need to check out all the gdal/shapelib/ogr family to make full use 
of the tools.  Understanding their abilities will help in making maps 
with mapscript or whatever way better.

Me being a beginner to all this 6 months ago, shapelib, has your friends 
gdalinfo, gdal_translate, ogr2ogr (very powerful for creating your 
datasets the way you wish), and gdaltindex for indexing.


Of course this is all just my simple way of looking at things. 
Hopefully no one minds me commenting here.

Best wishes,

-=Bill



Jerl Simpson wrote:
> Bill,
> 
> gdalinfo is REALLY awesome.  I found that you can run it on a geotiff
> from one of my searches.  I get pretty much the same info, except I
> have nothing for coordinate system.
> 
> Driver: GTiff/GeoTIFF
> Size is 3528, 4282
> Coordinate System is `'
> Origin = (230371.000000,1370761.000000)
> Pixel Size = (1000.00000000,-999.96746800)
> Metadata:
>   TIFFTAG_SOFTWARE=IMAGINE TIFF Support
> Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved
> @(#)$RCSfile: etif.c $ $Revision: 1.9.1.3 $ $Date: 2002/07/29 15:39:06EDT $
>   TIFFTAG_XRESOLUTION=1
>   TIFFTAG_YRESOLUTION=1
>   TIFFTAG_RESOLUTIONUNIT=1 (unitless)
> Corner Coordinates:
> Upper Left  (  230371.000, 1370761.000) 
> Lower Left  (  230371.000,-2911099.698) 
> Upper Right ( 3758371.000, 1370761.000) 
> Lower Right ( 3758371.000,-2911099.698) 
> Center      ( 1994371.000, -770169.349) 
> Band 1 Block=3528x2 Type=Byte, ColorInterp=Red
> Band 2 Block=3528x2 Type=Byte, ColorInterp=Green
> Band 3 Block=3528x2 Type=Byte, ColorInterp=Blue
> 
> That's pretty much the way may layer looks.  I've played around with
> the projection a bit, but no luck.
> 
> This is what my map looks like on a globabl scale with that layer on:
> 
> http://mapserver1.rkiq.com/workshop/World11188387357318.gif
> 
> I'm sure there's a way to scale it, but just haven't been able to work
> it out yet.
> My layer looks like:
> 
> LAYER
>     NAME "US_Relief"
>     TRANSFORM FALSE
>     DATA "89014205.tif"
>     TYPE RASTER
>     STATUS DEFAULT
>     PROJECTION
>       "init:epsg=9820"
>       "proj=laea"
>       "lat_0=-100"
>       "lon_0=45"
>       "x_0=0"
>       "y_0=0"
>       "units=m"
>     END
>   END
> 
> Thanks,
> 
> jerl
> 
> 
> On 6/15/05, William E Reid <wer at cstone.net> wrote:
> 
>>Jerl,
>>
>>
>>
>>        I have only used geotiffs that I have made.  They are geotiff/TAB
>>format.  But your LAYER should be very simple as far as  I know.  This
>>worked for me....
>>
>>         LAYER
>>           NAME "geotiff"
>>           TYPE RASTER
>>           STATUS ON
>>           DATA "geotiff/65729931.tif"
>>         END
>>
>>
>>All the magic (aside from the wonderful things mapsserver does for
>>us...) is stored in the TIF or TAB depending on what type of geotiff you
>>have.
>>
>>You should be able to run 'gdalinfo <file.tif>' on the tif file and it
>>should reveal coordinates stored in the tif (or accompanying tab file).
>>
>>Be sure to read the man page on gdalinfo.....
>>
>>gdalinfo --formats
>>
>>will show you what formats are supported (ie. did I forget to compile in
>>geotiff support....?)
>>
>>Make sure your extents are set to display what is in the tiff ( are you
>>looking at it on the currently displayed map, or are you looking at a
>>peiece of farm equipment?  You extents need to encompass the tiff or
>>part of it...)
>>
>>$ gdalinfo 65729931.tif
>>Driver: GTiff/GeoTIFF
>>Size is 300, 3300
>>Coordinate System is:
>>GEOGCS["NAD83",
>>     DATUM["North_American_Datum_1983",
>>         SPHEROID["GRS 1980",6378137,298.2572221010042,
>>             AUTHORITY["EPSG","7019"]],
>>         AUTHORITY["EPSG","6269"]],
>>     PRIMEM["Greenwich",0],
>>     UNIT["degree",0.0174532925199433],
>>     AUTHORITY["EPSG","4269"]]
>>Origin = (-78.083333,37.000000)
>>Pixel Size = (0.00027778,-0.00027778)
>>Metadata:
>>   TIFFTAG_SOFTWARE=IMAGINE TIFF Support
>>Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved
>>@(#)$RCSfile: etif.c $ $Revision: 1.9.1.3 $ $Date: 2002/07/29 15:39:06EDT $
>>   TIFFTAG_XRESOLUTION=1
>>   TIFFTAG_YRESOLUTION=1
>>   TIFFTAG_RESOLUTIONUNIT=1 (unitless)
>>Corner Coordinates:
>>Upper Left  ( -78.0833333,  37.0000000) ( 78d 5'0.00"W, 37d 0'0.00"N)
>>Lower Left  ( -78.0833333,  36.0833333) ( 78d 5'0.00"W, 36d 5'0.00"N)
>>Upper Right ( -78.0000000,  37.0000000) ( 78d 0'0.00"W, 37d 0'0.00"N)
>>Lower Right ( -78.0000000,  36.0833333) ( 78d 0'0.00"W, 36d 5'0.00"N)
>>Center      ( -78.0416667,  36.5416667) ( 78d 2'30.00"W, 36d32'30.00"N)
>>Band 1 Block=300x6 Type=Float32, ColorInterp=Gray
>>
>>
>>Hope that helps.
>>
>>-=Bill
>>
>>
>>Jerl Simpson wrote:
>>
>>>Would you mind sharing your LAYER definition?  I have the file, but
>>>can't seem to get it to display properly.  It's scale is wrong or
>>>something and I can't get it worked out.  I see the layer, but can't
>>>really tell what I'm looking at.
>>>
>>>I appreciate it.
>>>
>>>jerl
>>>
>>>On 6/14/05, William E Reid <wer at cstone.net> wrote:
>>>
>>>
>>>>Just My 2 cents on the Subject.
>>>>
>>>>DEMs are no longer readily available from places like usgs.  I am not
>>>>really sure why.  They are the easiest to work with (ie convert).
>>>>
>>>>If you are in the States....
>>>>
>>>>at http://seamless.usgs.org you can download 3arc and 1arc second
>>>>terrain data.  It comes in ArcGrid Format.  Though I have not seen a way
>>>>to do this, I will be looking to convert them to geotiffs and shape
>>>>files and dems with less granularity.
>>>>
>>>>A geotiff loads quickly and gives the best performance in mapserver
>>>>(from my experience anyway) if you are just looking to make things look
>>>>more interesting.
>>>>
>>>>Actually, you can download the data in Geotiff format, which is what I
>>>>would recommend....  These might be more then what you want for
>>>>granularity, I only dealt with 3arc and above data.
>>>>
>>>>National Elevation Dataset.  I love em.
>>>>
>>>>Your Tiff? Make sure it is a geotiff.  It needs to know where it is on
>>>>the map.  If you disable TRANFORM (set it to false) in your layer it
>>>>will probably show up.  But it needs to be a geotiff to show up properly.
>>>>
>>>>Hope that helps.
>>>>
>>>>-=Bill
>>>>
>>>>
>>>>Jerl Simpson wrote:
>>>>
>>>>
>>>>>Hi guys,
>>>>>
>>>>>I am wanting to add DEMs or some elevation/contour maps to my maps.
>>>>>But I am curious what works best with Mapserver.  I have found several
>>>>>different resource, but am at a loss as to which one I need.
>>>>>
>>>>>The first one I tried, which was to download JPEG images and convert
>>>>>them to TIFF images, never actually show up as a layer.  This may be a
>>>>>format issue on my part.  I haven't dug into that yet.
>>>>>
>>>>>I found one that is a ETOPO2 Global 2-Minute Gridded Elevation Data.
>>>>>But I don't know what that is and not sure if it can be used.  If
>>>>>someone knows a trick, I'd be please to find out.
>>>>>
>>>>>Similar issue with GLOBE files from NOAA.  Not sure if I can convert
>>>>>them to a format that's useful to use with Mapserver.
>>>>>
>>>>>I'm sure there are other options, I just haven't found them.
>>>>>
>>>>>I appreciate any help anyone might be able to give.
>>>>>
>>>>>Thank you,
>>>>>
>>>>>Jerl
>>>>>
>>>>
>>>>
>>
> 



More information about the mapserver-users mailing list