I'm working on gdal-based orthorectification workflow/procedure for WorldView2 images. For my particular application, WorldView2 images will always cover somewhere in CONUS. Here is a rough outline of this workflow:
- Get WorldView2 imagery for AOI (area of interest)
- Get 1/9 arc second (~10m) elevation data for AOI from USGS National Map
- Convert elevation data to ellipsoidal heights (from NADV88 to WGS84).
- Run gdalwarp on WorldView2 imagery for aoi with -rpc flag set, and -to (transformer option) flag set with RPC_DEM=dem_ellipsodial.tif (dem created in previous step)
Step 3 above is achieved using gdalwarp as shown below:
gdalwarp -s_srs "+proj=longlat +datum=WGS84 +no_defs +geoidgrids=g2012a_conus.gtx" -t_srs "+proj=longlat +datum=WGS84 +no_def" dem.tif dem_ellipsoid.tif
I start running into issues at Step 4. I initially tried calling gdalwarp like this:
gdalwarp -rpc -to RPC_DEM=dem_ellipsoid.tif wv2.TIF wv2_rectified.TIF
This usage of gdalwarp fails with the error:
Creating output file that is -2147483648P x -2147483648L. ERROR 1: Attempt to create -2147483648x-2147483648 dataset is illegal,sizes must be larger than zero.
Some further investigation of this error suggests to specify -s_srs and -t_srs flags. In the particular area of I have been working in, the WorldView imagery and elevation data are in UTM Zone 17N. So:
gdalwarp -s_srs EPSG:32617 -t_srs EPSG:32617 -rpc -to RPC_DEM=dem_ellipsoid.tif wv2.TIF wv2_rectified.TIF
The above usage of gdalwarp completes without issue. However, when I add the wv2_rectified.TIF into QGIS - it does not display where it should. When I look at QGIS information of the wv2_rectified.TIF layer - I see:
Notice the extent coordinates. It seems problematic to me that these coordinates are still in lat/lng even though the CRS shows as UTM Zone 17N. What I am doing wrong here?
FWIW... For the time being, I do have ESRI products available. I have successfully used the "Create Ortho Corrected Raster Dataset" tool with the wv2.tif and dem_ellipsoidal.tif I am using in the gdalwarp command. The output of this tool is good - so feel good about my conversion of dem data to ellipsoidal heights from NADV88. I dont have access to ESRI for much longer, hence trying to figure out a gdal based alternative.