Automatic JP2 Processor [code attached] (jp2 to tif, including tmc and tfw creation)

  • Disclaimer{this is not a complete application it has some place holders and hard coded elements}

    All written in Python using GDAL open source

    This application reads in an input folder containing jp2 downloaded from usgs

    It converts the jp2 to tiff

    it projects the tif into a latitude/longitude projection system

    it extracts the corner coordinates NW/SE

    it writes a TMC file

    it writes the TFW

    it writes the Bat in runs the command line geoconvert as subprocess

    Current Bug: GDAL is moving the blue channel into the alpha channel for some reason making lakes and water transparent. I'm sure its a config problem, i should have it sorted by tomorrow or thereabouts

    just had to specify 3 bands and it seems better

    Still working on refining it and packaging into a tool but the guts are mostly there

    I want to add a GUI

    I want to add a usgs ftp downloader

    I want to make the application run the bat file for us done

    I want to clean up all extra data after each run so i dont fill up the harddrives done

    I want to package it up into an exe if i can.. might require installing os4geo

    Looking for any feedback.. if anyone wants to try it as it stands i can get you pointed at the software prequisites at this early stage

    One Question

    Is there a way to make the geoconvert window just close itself when it is done?


    Attached python file as .txt

  • This is a fantastic workflow,

    taking a massive manual editing away. And avoids typing errors.

    A perfect tool for the USGS imagery.

    I have 2 questions:

    Does it work for both the 1m and 1feet imagery?

    How can I use it? Is it necessary to install Python?

    I have a big list of USGS JP2 at my disk, but have shied away from the effort to create manually TFWs.

    This will be scenery fun in the future.:D

    Rodeo

  • Does it work for both the 1m and 1feet imagery?

    How can I use it? Is it necessary to install Python?

    Thanks for the feeback on the workflow. :)

    I wouldn't use the code i posted yesterday! I have made some changes and its better now. let me know if you want to play with it ill get you a proper copy

    1 foot imagery should work exactly like the 1m imagery, since all calculations are based off the source image it should be fine... I will test when my swatch of the front range of the rockies is done processing out

    for right now you need Python 2.7.13 installed and osgeo4w installed, im working on turning it into a more usable application.. but it might always require that we install osgeo4w.

    once you have those items installed you can run the script from idle (python IDE). just change the paths to match where your data is coming from and going to.