0

QGIS version 3.2.1

Windows 10

Project File on GitHub

Shape files on Github


I am trying to create shapefile from coffee cup image.

The actual coffee should be the shapefile.

However I would like the background of shapefile to be original coffeecup.

Here is original coffee image

enter image description here

Here is how I'd wish shapefile to look like (the green polygon has shape properties). Remaining shapefile should have coffee cup and saucer as original image instead of additional polygon.

enter image description here

Both coffee image and created shapefile are the layers. When I unselect coffee image I get this

enter image description here

Perhaps there is a way to merge the image into the shapefile?

6
  • Please clarify what you mean by "background of shapefile to be original coffeecup." Do you want to add the coffee cup to the shapefile as an additional polygon?
    – csk
    Commented Aug 14, 2018 at 16:29
  • @csk Remaining coffee cup should be original image, not additional polygon, Commented Aug 14, 2018 at 17:23
  • shape-file is as you know a vector-format (poly or line or point), you can "merge" it with a raster (=picture), raster only can be a seperate layer in the background. why not put the (green) poly-shapefile on top of the background-raster?
    – Kurt
    Commented Aug 14, 2018 at 17:40
  • @Kurt Silly question but how would I "merge" it. I created the raster, selected it along with shape file, saved as new shapefile, but only the polygon appears. Here is updated shapefile, github.com/ArtieLadie/Coffee/tree/master/coffee_merge. Please assist. Commented Aug 14, 2018 at 17:45
  • @Kurt I see option for Raster > Conversion > Rasterize (Vector to Raster), but it doesn't convert to shapefile Commented Aug 14, 2018 at 18:02

1 Answer 1

3

Please read up on the difference between raster and vector data:

What are Raster and Vector data in GIS and when to use?

The image is raster data. The shapefile is vector data. To combine them, first convert them to the same type. Either rasterize the polygon, or polygonize the image.

Once the two files are the same data type, you can combine them. Please refer to the appropriate section of the QGIS manual for further instructions:

2

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