Mon 13 Apr 2015 03:32:59 PM UTC, comment #2:
Hi Pieter,
Thanks for your response. I tried creating a username but never got the email to confirm--I will try that again. Sorry for my lack of information. After using -v 1 it's become clear that I am doing something wrong with the bounding box coords and/or projection.
Hopefully it will help if I try and explain a little more in depth exactly what it is I'm trying to do. The info you requested is at the bottom.
I have several images (as many as 20-30, but for now am just troubleshooting with 6 of them), each of which is smaller than the bounding box I supplied and in a different projection than I wish the output to be in. Each image overlaps a little bit with at least one other image. I would like to mosaic (or composite) them together, with the output being put into the supplied projection (EPSG:102001 a.k.a. Albers equal area) and have whatever is hanging outside of the bb be cropped out. Each input is 8-bit 30m resolution, which is what I want the output to be as well.
I was able to do this very thing using gdalwarp, by supplying the desired output projection with the desired extent, which were specified in the output proj units (the same exact coordinates which I tried to use with pkcomposite). Gdalwarp successfully combined the images, set the output projection to Albers, and cropped any excess that was outside of the bounding box. Here is the gdalwarp command I used:
'gdalwarp -t_srs EPSG:102001 -te (xmin, ymin, xmax, ymax) -tr 30 30 -srcnodata 0 input output'
where:
xmin, ymin, xmax, ymax = -1240020, 1400000, -160020, 2480000
input = string of paths to input images and output = path to output image
The only problem with gdalwarp is, I really need the result of any pixels that overlap to come from the maximum value of the inputs, not the last image, hence why I need to use pkcomposite.
I hope this is not too confusing and helps you understand what I'm trying to do.
Thanks so much!
-----------------------------------------------------------
**gdalinfo on one of the images reveals the following:
Driver: GTiff/GeoTIFF
Files: /att/nobackup/mwooten3/Processing_v3/SceneTotals_v3/043017/043017_2000_LandTotal_v3.tif
Size is 8621, 8441
Coordinate System is:
PROJCS["UTM Zone 12, Northern Hemisphere",
GEOGCS["Unknown datum based upon the WGS 84 ellipsoid",
DATUM["Not_specified_based_on_WGS_84_spheroid",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-111],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]]]
Origin = (428685.000000000000000,6953415.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 428685.000, 6953415.000) (112d23'38.13"W, 62d42'15.49"N)
Lower Left ( 428685.000, 6700185.000) (112d17'43.90"W, 60d25'53.91"N)
Upper Right ( 687315.000, 6953415.000) (107d20'33.15"W, 62d39'48.70"N)
Lower Right ( 687315.000, 6700185.000) (107d36' 0.67"W, 60d23'40.33"N)
Center ( 558000.000, 6826800.000) (109d54'28.66"W, 61d34'13.12"N)
Band 1 Block=8621x1 Type=Byte, ColorInterp=Gray
**-v 1 on the same pkcomposite command gives me this info:
resampling: nearest neighbor
possible output data types: Unknown Byte UInt16 Int16 UInt32 Int32 Float32 Float64 CInt16 CInt32 CFloat32 CFloat64
Output pixel type: Byte
/att/nobackup/mwooten3/Processing_v3/SceneTotals_v3/043017/043017_2000_LandTotal_v3.tif not within bounding box, skipping...
/att/nobackup/mwooten3/Processing_v3/SceneTotals_v3/043018/043018_2000_LandTotal_v3.tif not within bounding box, skipping...
/att/nobackup/mwooten3/Processing_v3/SceneTotals_v3/043019/043019_2000_LandTotal_v3.tif not within bounding box, skipping...
/att/nobackup/mwooten3/Processing_v3/SceneTotals_v3/043020/043020_2000_LandTotal_v3.tif not within bounding box, skipping...
/att/nobackup/mwooten3/Processing_v3/SceneTotals_v3/031022/031022_2000_LandTotal_v3.tif not within bounding box, skipping...
/att/nobackup/mwooten3/Processing_v3/SceneTotals_v3/031023/031023_2000_LandTotal_v3.tif not within bounding box, skipping...
bounding box input images (ULX ULY LRX LRY): 0.000000 0.000000 0.000000 0.000000
bounding box composite image (ULX ULY LRX LRY): -1240020.000000 2480000.000000 -160020.000000 1400000.000000
initializing composite image...
composite image dim (nrow x ncol): -2147483648 x -2147483648
weight: 1 1 1 1 1 1
open output image /att/nobackup/mwooten3/Processing_v3/pk_TileIterations_v3/h02v02/h02v02_2_2000_Land_v3_pkComp.tif with 0 bands
FileOpenError ()
projection: EPSG:102001
pkcomposite: ImgWriterGdal.cc:314: std::string ImgWriterGdal::setProjectionProj4(const string&): Assertion `m_gds' failed.
Aborted
|