PDA

View Full Version : resample.exe "source.inf" file preparation tool


=Hollywood=
08 Jan 2007, 11:10
I'm trying to find a way through my own research a way to start a batch process that will:


Scan a directory
List the directory contents to a text file
Append the data into a source.inf file ready to compile with resample.exe

Basically I have a few hundred source geotiffs that I don't want to have to hand compile the resample.exe based .inf files for...

Example:


(Source)
Type = MultiSource
NumberOfSources = 49

(Source1)
Type = GeoTIFF
SourceDir = "Source"
SourceFile = "Z_59_17.TIF"
Layer = Elevation
Scale = 1
MaxValidData = 5000
MinValidData = -5000

(Source2)
Type = GeoTIFF
SourceDir = "Source"
SourceFile = "Z_59_18.TIF"
Layer = Elevation
Scale = 1
MaxValidData = 5000
MinValidData = -5000

(Source3)
Type = GeoTIFF
SourceDir = "Source"
SourceFile = "Z_59_19.TIF"
Layer = Elevation
Scale = 1
MaxValidData = 5000
MinValidData = -5000



so basically my folder has:

Z_59_17.TIF
Z_59_18.TIF
Z_59_19.TIF

etc etc etc with 49 files named similar to this...

Now if I can run a batch file that will list those files and plug them in to each

(Source3)
Type = GeoTIFF
SourceDir = "Source"
SourceFile = "Z_59_19.TIF"
Layer = Elevation
Scale = 1
MaxValidData = 5000
MinValidData = -5000

the line listed in red above, while also appending a source number in green and then counting the number of sources altogether and adding the number to the line in blue below:

(Source)
Type = MultiSource
NumberOfSources = 49

Then I'll be able to do a lot of quick rendering for DEM and photoscenery etc, and would be a very useful tool for all of us....

Anyone have any ideas?

arno
09 Jan 2007, 15:09
Hi,

If I had to do this, I would probably write a little tool to do this work for me. Just a quick tool with an ugly GUI to create the file I want. But usually I don't release such tools in the end :).