TransWikia.com

Huge processing time for gdalwarp command extracting ROI by extents

Geographic Information Systems Asked by Rossoe on December 19, 2020

I’m running the below gdalwarp command to extract a 1024 x 1024 ROI from a large raster which has Dimensions X: 34396 Y: 36707 Bands: 4

Input raster has previously been pan-sharpened and orthorectified from original World View source, admitedly it’s a fairly large file at 19GB, but initial steps did not take too long, however the below is taking nearly 36 hours to complete within an OSGeo4W shell?

gdalwarp -t_srs EPSG:32630 -r cubic -wo SOURCE_EXTRA=1000 -tr 0.5 0.5 -r cubic -of GTiff -te 419175.301303 5577359.141256 421223.301303 5579407.141256 F:/GIS/orthorectified.tif F:/GIS/extract_sat_WV_5.tif

The output is a 16mb tif

This is longer than I’ve ever waited to process a raster, I tested a similar process within Global Mapper (GIS application) and it took 2 minutes to cut using a shapefile and export to tif within the interface.

One Answer

You are on the money with the -wo SOURCE_EXTRA=1000 being too high

I changed it to 10 and it completed in 30 seconds.

I started adding SOURCE_EXTRA after reading this post by Robert Simmon. to aid some anomolies and corruption I was getting preprojecting tif heightmaps, but maybe I don't need to be using so often!

Robert noted:

-wo SOURCE_EXTRA=1000 is an example of a warp option—advanced parameters that determine how the reprojection is calculated. SOURCE_EXTRA adds a buffer of pixels around the map as it is reprojected, which helps prevent gaps in the output. Not all reprojections require it, but it doesn’t hurt to add the option to be on the safe side.

For reference gdalinfo showed:

C:>gdalinfo F:/GIS/orthorectified.tif Driver: GTiff/GeoTIFF Files: F:/GIS/orthorectified.tif Size is 34396, 36707 Coordinate System is: PROJCS["WGS 84 / UTM zone 30N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.257223563,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-3],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","32630"]] Origin = (408939.562500000000000,5591771.000000000000000) Pixel Size = (0.500627815723419,-0.500627815723419) Metadata:   AREA_OR_POINT=Area  ESRI_MD_ACQUISITION_DATE=20120802114451   ESRI_MD_ANGLE_TO_NORTH=270   ESRI_MD_CE=016   ESRI_MD_DATA_TYPE=Generic   ESRI_MD_ISCLOUDCOVER=false   ESRI_MD_LE=016   ESRI_MD_PRODUCT_NAME=P2  ESRI_MD_RASTER_FORMAT=NITF   ESRI_MD_SENSOR_NAME=WV02   ESRI_MD_SUN_AZIMUTH=163.437   ESRI_MD_SUN_ELEVATION=+56.517   NITF_ABPP=11   NITF_CCS_COLUMN=0   NITF_CCS_ROW=0   NITF_CLEVEL=06   NITF_CSDIDA_DAY=02   NITF_CSDIDA_MONTH=AUG   NITF_CSDIDA_OPERATION=000 NITF_CSDIDA_PASS=08   NITF_CSDIDA_PLATFORM_CODE=WV   NITF_CSDIDA_PROCESS_TIME=20120802123318   NITF_CSDIDA_PRODUCT_ID=P2   NITF_CSDIDA_RESERVED_0=0000   NITF_CSDIDA_RESERVED_1=00   NITF_CSDIDA_RESERVED_2=01   NITF_CSDIDA_RESERVED_3=N   NITF_CSDIDA_RESERVED_4=N   NITF_CSDIDA_SENSOR_ID=GA   NITF_CSDIDA_SOFTWARE_VERSION_NUMBER=4.15   NITF_CSDIDA_TIME=20120802114451   NITF_CSDIDA_VEHICLE_ID=02   NITF_CSDIDA_YEAR=2012   NITF_CSEXRA_ALONG_SCAN_GSD=079.2   NITF_CSEXRA_ANGLE_TO_NORTH=270.000   NITF_CSEXRA_AZ_OF_OBLIQUITY=144.771   NITF_CSEXRA_A_S_VERT_GSD=N/A   NITF_CSEXRA_CIRCL_ERR=016   NITF_CSEXRA_CROSS_SCAN_GSD=078.9   NITF_CSEXRA_C_S_VERT_GSD=N/A   NITF_CSEXRA_DYNAMIC_RANGE=02027   NITF_CSEXRA_GEO_MEAN_GSD=079.1   NITF_CSEXRA_GEO_MEAN_VERT_GSD=N/A   NITF_CSEXRA_GRD_COVER=9   NITF_CSEXRA_GSD_BETA_ANGLE=089.5   NITF_CSEXRA_LINEAR_ERR=016   NITF_CSEXRA_MAX_GSD=079.2   NITF_CSEXRA_NUM_LINES=0009216   NITF_CSEXRA_NUM_SAMPLES=09216   NITF_CSEXRA_OBLIQUITY_ANGLE=07.329   NITF_CSEXRA_PREDICTED_NIIRS=3.0   NITF_CSEXRA_SENSOR=MS   NITF_CSEXRA_SNOW_DEPTH_CAT=9   NITF_CSEXRA_SUN_AZIMUTH=163.437   NITF_CSEXRA_SUN_ELEVATION=+56.517   NITF_CSEXRA_TIME_FIRST_LINE_IMAGE=42291.718656   NITF_CSEXRA_TIME_IMAGE_DURATION=00001.852000   NITF_ENCRYP=0   NITF_FBKGC=126,126,126   NITF_FDT=20120802123318   NITF_FHDR=NITF02.10 NITF_FSCLAS=U   NITF_FSCLSY=US   NITF_FSCOP=00000   NITF_FSCPYS=00000  NITF_FSCTLH=0   NITF_FTITLE=12AUG02114451-M1BS-052766399070_01_P001.NTF   NITF_IALVL=0 NITF_IC=C8   NITF_ICAT=MS   NITF_ICORDS=G   NITF_IDATIM=20120802114451 NITF_IDLVL=1   NITF_IGEOLO=502815N0041646W502808N0040238W501842N0040241W501848N0041645W NITF_IID1=M11A760A00   NITF_IID2=02AUG12WV020800012AUG02114451-M1BS-052766399070_01_P001   NITF_ILOC_COLUMN=0   NITF_ILOC_ROW=0   NITF_IMAG=1.0   NITF_IMAGE_COMMENTS=The imagery and metadata data on this media is the property of                  DigitalGlobe and is licensed for use only. All use must be in                   accordance with the terms of the license that accompanies the media.            If the license is purchased under contract NMA 301 99 D003, use is              in accordance with the license therein   NITF_IMODE=B   NITF_IREP=MULTI   NITF_ISCLAS=U   NITF_ISCLSY=US   NITF_ISCTLH=0   NITF_ISORCE=DigitalGlobe   NITF_ONAME=DigitalGlobe   NITF_OPHONE=+1(800)496-1225   NITF_OSTAID=DG   NITF_PIAIMC_CLOUDCVR=999   NITF_PIAIMC_COMGEN=00   NITF_PIAIMC_ESD=Y   NITF_PIAIMC_GENERATION=1   NITF_PIAIMC_IDATUM=WGE   NITF_PIAIMC_MEANGSD=00079.1   NITF_PIAIMC_PREPROC=1R   NITF_PIAIMC_SATTRACK=00000000   NITF_PIAIMC_SENSMODE=PUSHBROOM   NITF_PIAIMC_SENSNAME=WV02   NITF_PIAIMC_SOURCE=DigitalGlobe Acquired Image   NITF_PIAIMC_SRP=Y   NITF_PJUST=R   NITF_PVTYPE=INT   NITF_STDIDC_ACQUISITION_DATE=20120802114451   NITF_STDIDC_COUNTRY=UK   NITF_STDIDC_END_COLUMN=009   NITF_STDIDC_END_ROW=00009   NITF_STDIDC_END_SEGMENT=AA   NITF_STDIDC_LOCATION=5028N00410W   NITF_STDIDC_MISSION=WV02   NITF_STDIDC_OP_NUM=000   NITF_STDIDC_PASS=08   NITF_STDIDC_REPLAY_REGEN=000   NITF_STDIDC_REPRO_NUM=00   NITF_STDIDC_START_COLUMN=001   NITF_STDIDC_START_ROW=00001   NITF_STDIDC_START_SEGMENT=AA   NITF_STYPE=BF01   NITF_USE00A_ANGLE_TO_NORTH=270   NITF_USE00A_DYNAMIC_RANGE=02046   NITF_USE00A_MAX_LP_SEG=008746   NITF_USE00A_MEAN_GSD=079.1   NITF_USE00A_N_REF=00   NITF_USE00A_N_SEG=001   NITF_USE00A_OBL_ANG=07.33   NITF_USE00A_REV_NUM=14777   NITF_USE00A_ROLL_ANG=-04.40   NITF_USE00A_SUN_AZ=163.4   NITF_USE00A_SUN_EL=+56.5 Image Structure Metadata:   INTERLEAVE=PIXEL Corner Coordinates: Upper Left  ( 
408939.563, 5591771.000) (  4d16'59.52"W, 50d28'15.07"N) Lower Left  (  408939.563, 5573394.455) (  4d16'43.49"W, 50d18'20.25"N) Upper Right (  426159.157, 5591771.000) (  4d 2'26.14"W, 50d28'23.79"N) Lower Right (  426159.157, 5573394.455) (  4d 2'13.14"W, 50d18'28.92"N) Center      (  417549.360, 5582582.727) (  4d 9'35.57"W, 50d23'22.24"N) Band 1 Block=34396x1 Type=Float32, ColorInterp=Gray   NoData Value=0 Band 2 Block=34396x1 Type=Float32, ColorInterp=Undefined   NoData Value=0 Band 3 Block=34396x1 Type=Float32, ColorInterp=Undefined   NoData Value=0 Band 4 Block=34396x1 Type=Float32, ColorInterp=Undefined   NoData Value=0

Answered by Rossoe on December 19, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP