[gdal-dev] Is it possible?

Graeme B. Bell grb at skogoglandskap.no
Tue Jun 9 01:26:50 PDT 2015


Peter,

I think you are misunderstanding the question. You are interpreting the verb 'to map into a geotiff' to mean 'directly insert the original data structure into a incompatible data structure', which is an peculiarly narrow definition even in GIS. 

When he says 'to map' he probably meant either the common english & mathematical sense of the verb "to map A into B" (i.e. to transform), or perhaps the practical GIS sense of 'to go about  interpreting map A as it relates to map B'.


Edgar,

To transform, you can use gdal_rasterize (http://www.gdal.org/gdal_rasterize.html), or for extremely large shapefiles or DBs you can use rbuild (https://github.com/gbb/rbuild) which is a parallelising wrapper for gdal_rasterize.

Whereas if you are wondering how to relate data in a geotiff to data alongside a shapefile in a practical sense, well, there are several options.

1. gdal_rasterize the shapefile, then use e.g. gdal_calc.py to combine the resulting geotiff with your other geotiff.  (gdal_calc is a great little tool!)

2. Consider moving your data into e.g. postgis and postgis raster. Then you can do things like perform intersections and other calculations using both the raster data and the geometry directly. 

Hope this helps, also it's not a bad idea to read Peter's suggested book if you're new to GIS anyway.

Graeme Bell



> Message: 1
> Date: Mon, 8 Jun 2015 15:30:28 +0100
> From: Peter Halls <p.halls at york.ac.uk>
> To: "Ronquillo, Edgar Nahum" <eronquillo at lanl.gov>,	gdal dev
> 	<gdal-dev at lists.osgeo.org>
> Subject: Re: [gdal-dev] Is it possible?
> Message-ID:
> 	<CADEnnONYY4PLqwRpWqOGVdgV9uXehKV9RGxCBv6=RBqoNNatzg at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> Why would you want to map a Shapefile into a Geotiff file?  They are
> two fundamentally different types of spatial object.  Shapefiles are
> exclusively vector in nature, whilst Geotiffs are exclusively raster.
> I suggest reading a text, such as Burrough and McDonnell, Principles
> of Geographical Information Systems, published by Oxford University
> Press, gaining an understanding of the different properties and how to
> exploit them.  Then you will be able to choose a data format
> appropriate to your purposes.
> 
> Peter.


More information about the gdal-dev mailing list