3

I'm looking at either gdal_contour or gdal_polygonize.py to create a vector layer file from a raster file. I can create the vector file using either method, but it's upside down when I plot it using QGIS. Another list indicated this has to do with the world file.

I use gdal_translate and gdalwarp when transforming the orginal raster in lambert conformal to spherical mercator (for use in OpenLayers) and understand that the world file could be created using one of those utilities (probably when using gdalwarp). However, I'm really unsure after that about the next step using either of the raster to vector utilities where the world file comes into play. Do I have to also use ogr2ogr as well? I'd appreciate a detailed list of steps as the GDAL documentation is a bit fuzzy here.

Just to note my current steps are:

  1. Use gdal_translate to first geo reference the original raster in lambert conformal
  2. Use gdalwarp to reproject the resulting raster image to spherical mercator
  3. Use gdal_translate to create a PNG at a reduced size. Becomes an Image Layer in OpenLayers.
  4. Use either raster to vector utility on the raster produced in step 3.

I see where -co for the world file can be included in gdal_translate or gdalwarp. And like I said, I can create the vector file once the original raster has been warped to spherical mercator. Really just unclear here how the world file comes into play for the resulting vector file in step 4 so the image will be rightside up.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jul 25, 2011 at 12:58
0

1 Answer 1

1

As Matthew asked and then I commented on, I apparently was confused about the world file creation and in which step to do that in.

Adding -co WORLDFILE=YES in step 3 above created a .wld file for the resulting PNG image. I then used gdal_contour, brought into QGIS, and it worked!

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered Nov 16, 2012 at 14:38

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.