APOLLO & ECW/JP2 Discussions

Wondering how others have configured their ERDAS APOLLO server or what data they are crawling? The ERDAS APOLLO Discussion board is a place to find information, share ideas and more. Join the community, connect, contribute and share.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Occasional Contributor
Posts: 9
Registered: ‎01-21-2019

Update - jp2 header info from world file.

Hi - I have been provided data in jp2k format that has an associated world file, spot6/7 data. this was provided without the xml info, and no projection or location info in the header.

 

For me to mosaic I need to go throught a lengthy process.

 

I have been able to use ECW header editor to add projection info, however trying to add the location info from the world file, I have not been able to add from command line ?  is this possible.

 

geotifcp has the ability to read world files and add to tiff header in a simple -e command ? is this availabe in the ECWHeaderupdaterCLI.exe 

 

I would prefer not to have to read then export a second data set, doubling up on space.

 

Any suggestions welcome.

 

Regards

 

Craig

Highlighted
Moderator
Moderator
Posts: 382
Registered: ‎11-16-2015

Re: Update - jp2 header info from world file.

Hi Craig,

 

The only available commands of ECWHeaderEditorCLI.exe are:

 

C:\Program Files\Hexagon\ERDAS APOLLO Utilities 2018\lib\bin\x64URelease>ECWHeaderEditorCLI.exe
Usage: ECWHeaderEditorCLI.exe file [-proj PROJECTION] [-datum DATUM] [-originx ORIGINX]
  [-originy ORIGINY] [-cellx CELLX] [-celly CELLY]
  [-updateers] [-updateecwwithuncompressedindextable] [-updatewithincorrectdatumprojectionpair ] [-updatewithinvalidcoordspace]

As you can see, there is no way to add all the world file parameters and no direct command for using world files.

But are you sure you need that? I mean are the JP2 files georeferenced? In other words, do you know the coordinate system of the images?

If yes, you don't need to world file and you can just update all the files with the proper CRS:

C:\Program Files\Hexagon\ERDAS APOLLO Utilities 2018\lib\bin\x64URelease>ECWHeaderEditorCLI.exe D:\img.ecw -proj EPSG:32632 -datum EPSG:32632

 

Highlighted
Occasional Contributor
Posts: 9
Registered: ‎01-21-2019

Re: Update - jp2 header info from world file.

Hi Flo

 

Thanks for your responce.

 

The Problem - we were delivered the raw airbus jp2 files which are divided into the multiple images. 20k + images in the one folder.

the data did not come with the normal xml file's to bring each image all together.

 

I have been able to already add the CRS data (batching with the editor) which helps in part but the jp2 files do not have the location info.

 

I was hoping to be able to batch and add the data from the world files without having to create new files ie double the data/disk space required.

 

If given the xml you can import/export to new jp2 files bringing together the tiled images, this reduces the number of images going into the mosaic and also provides and output with correct locational info.

 

Guess ill need to increace my disk space.

 

Regards

 

Craig

 

 

Highlighted
Moderator
Moderator
Posts: 382
Registered: ‎11-16-2015

Re: Update - jp2 header info from world file.

Editing the Pixel origins X & Y won't do the job? If the projection is already set, I guess there is no rotation parameters in the world file (2nd an 3rd parameters), so it should be enough in my opinion (+ maybe pix size). You could imagine writing a script to extract those parameters from the world file and writing them in the JP2 header using the Header Editor.

 

Another possibility, could be to use the "Edit image metadata" tool of ERDAS Imagine (you can also use it in batch) or create a spatial model. But then, I would suggest to ask that on the Imagine or Spatial Model discussion boards.

Highlighted
Staff
Posts: 33
Registered: ‎11-16-2015

Re: Update - jp2 header info from world file.

Hi all,

just a tip for Florent answer - to process all the folder if you got multiple .ecw files:

for %%f in (*.ecw) do (
"C:\Program Files\Hexagon\ERDAS APOLLO Utilities 2018\lib\bin\x64URelease\ECWHeaderEditorCLI.exe" %%f -proj EPSG:32632 -datum EPSG:32632
)
echo done

you can put it int bach file and run.

Tomasz