1

I am using QGIS v 3.2.1 to convert Raster image to Shapefile

Unfortunately the resulting shapefile is upside down.

How to keep resulting shapefile right side up

Here is animated gif (link on GitHub)

  • It should not happen if your raster file is georeferenced. – user30184 Aug 15 '18 at 18:46
  • @user30184 In other words, I'd have to georeference a coffee cup? – Artie Ladie Aug 15 '18 at 19:05
3

If you want to show a camera picture of a coffee cup on a QGIS map you need to know some rules of the play. Images viewed by QGIS are usually georeferenced and if they are not then the default GeoTransform of GDAL is applied https://www.gdal.org/classGDALDataset.html#a5101119705f5fa2bc1344ab26f66fd1d.

The default transform is (0,1,0,0,0,1) which means that the Y coordinate is increasing line by line. Because QGIS is made to show maps the value of Y-axis is growing from bottom to top (because the equator has north coordinate of zero). This means that after the first line is drawn the next line will be drawn with y-coordinate increased by 1, so it goes above the first line and the image will be flipped.

As a workaround write a world file https://en.wikipedia.org/wiki/World_file for you coffee cup.

coffee_cup.wld
==============
1
0
0
-1
0
0

Value of -1 as the y-pixel size should turn your coffee cup so that it does not spill.

  • +1 for coffee not spilling! – Artie Ladie Aug 15 '18 at 22:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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