[SOLVED] Good day! 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:
- Use gdal_translate to first geo reference the original raster in lambert conformal
- Use gdalwarp to reproject the resulting raster image to spherical mercator
- Use gdal_translate to create a PNG at a reduced size. Becomes an Image Layer in OpenLayers.
- 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. Thanks for any help!
[SOLVED] 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.
-co WORLDFILE=YES in step 3 above created a .wld file for the resulting PNG image. Then used gdal_contour creating a shapefile and also gml, brought both into QGIS to view, and they're now rightside up! Thanks all who viewed and Matthew who commented!