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

Chaitanya kumar CH chaitanya.ch at gmail.com
Tue Apr 6 12:13:09 EDT 2010


Kishore,

You can adjust the geotiff's dimensions and extents from within the script.
Then use the -te option in gdal_rasterize to limit the extents of the vector
data.

Other way is to create parts of the shape file using ogr2ogr with the option
-clipsrc (http://gdal.org/ogr2ogr.html).

On Tue, Apr 6, 2010 at 12:00 AM, Kishore Reddy <enigma2006.kishore at gmail.com
> wrote:

> 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
>>
>>
>>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.
/tʃaɪθənjə/ /kʊmɑr/
+91-9848167848
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100406/363094fe/attachment.html


More information about the gdal-dev mailing list