[gdal-dev] Converting contour lines (Shape files) into DEM

Kishore Reddy enigma2006.kishore at gmail.com
Mon Apr 5 14:30:59 EDT 2010


Hi,

I tried the above procedure. Its working. I am giving input as Shapefile and
taking geotiff file as output. But the output file is loosing many details
as it has been converted at high resolution. Is there any way  that I can
convert Shapefles into tiles at appropriate resolution so that I can produce
many geotiff files for the same Shapefile?

--
Kishore


On Sun, Mar 28, 2010 at 3:37 AM, Even Rouault
<even.rouault at mines-paris.org>wrote:

> Kishore,
>
> Here is a process you could try:
>
> 1) Prepare an output GDAL file for gdal_rasterize.
>
> You can take care inspiration of
>
> http://trac.osgeo.org/gdal/wiki/FAQRaster#HowcanIcreateablankrasterbasedonavectorfilesextentsforusewithgdal_rasterizeGDAL1.8.0
>
> Modify it to create 1 band (instead of 4) and for step 3) to work, you
> should
> take care of setting a nodata value on the output file and initialize the
> raster with it:
>
> dst_ds.GetRasterBand(1).SetRasterNoDataValue(0)
> dst_ds.GetRasterBand(1).Fill(0)
>
> (if you can compile GDAL from source, you can avoid this step by grabbing
> the
> latest sources that have an enhanced version of gdal_rasterize, directly
> able
> to create the output file . See http://trac.osgeo.org/gdal/ticket/3505)
>
> 2) Use gdal_rasterize to burn the contour lines.
>
> See http://gdal.org/gdal_rasterize.html
>
> 3) Fill the holes (the nodata values) with gdal_fillnodata.py.
>
> See http://gdal.org/gdal_fillnodata.html
>
> Now, the result should be usable with gdaldem.
>
> Best regards,
>
> Even
>
> Le Saturday 27 March 2010 19:09:06 Kishore Reddy, vous avez écrit :
> > Hi everyone,
> >
> > I am planing to use gdaldem to create relief shaded maps. But the
> > problem is gdaldem takes only DEM files as input. Unfortunately I have
> > contour lines (in the form of Shape files). So is there any way
> > (command line) to convert these shape files into DEM files?
> >
> > --
> > Kishore
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100406/0ff6f1d5/attachment.html


More information about the gdal-dev mailing list