I want to combine a raster and a vector file. After combining, can I query on the resulting map to obtain a specific area? How?

  • No, I don't think you can or should combine raster and vector files. That defeats half the purpose of GIS
    – dassouki
    Jan 29, 2011 at 9:52
  • 3
    Combine for what purpose? Just a combined visualisation can be accomplished in any ol' GIS program - pick your weapon from a wide range of free and open source to expensive proprietary packages. I like QGis myself. If you want to do more than just visualisation, then you will need to elaborate on your intent a bit more before anyone could provide a useful answer.
    – mvexel
    Jan 29, 2011 at 11:55
  • I am using: v.db.select map=PHL_adm1 where=NAME_1='Bulacan' My vector map is over the raster map. I want to select the part of the raster map under the polygon(NAME_1='Bulacan') of a vector. Is it possible to do?
    – teamAngat
    Jan 29, 2011 at 15:19
  • 1
    To transfer raster values to a vector map, use for example grass.osgeo.org/grass64/manuals/html64_user/v.what.rast.html . Then use v.report to get statistics.
    – markusN
    Jan 29, 2011 at 19:10
  • 1
    So this is basically a duplicate of gis.stackexchange.com/questions/5620/… ?
    – underdark
    Jan 29, 2011 at 23:03

1 Answer 1


If you want to identify a common area that exists on both the vector and the raster, I suggest you convert the vector to raster. There are a few things to consider when you do this;

  • make the spatial extents of the new raster the same as the original one
  • use the same raster cell size.

Then you can identify a common area between the two rasters using a few different techniques. One method is to assign certain values to cells within the new raster. For example you could make your new raster have a value of 1 where the vector object exists, and 0 elsewhere. Then you could multiply the rasters by each other, and the product (a third raster) will give you the intersection.

  • I used v.to.rast to convert my vector map to raster map. How can I "assign certain values to cells within the new raster"? What is the script for it?
    – teamAngat
    Jan 30, 2011 at 13:44
  • What values are the raster cells? You could reclassify them using r.reclass See grass.osgeo.org/gdp/html_grass64/r.reclass.html
    – djq
    Jan 30, 2011 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.