Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appending images to existing files #192

Closed
tfwittwer opened this issue Dec 21, 2022 · 4 comments
Closed

Appending images to existing files #192

tfwittwer opened this issue Dec 21, 2022 · 4 comments

Comments

@tfwittwer
Copy link

Hi,

I've written a program for tiling existing E57 files. Ideally I'd want to close the resulting tiles and only reopen the ones that are required for a new input file, instead of keeping all tiles open until the end. Unfortunately, I don't see how I can tell the writer to append to the end of the file, it now appears as if existing images are overwritten once an existing file is opened for writing. I'm using the WriteImage2DData() method of the SimpleWriter class.

@asmaloney
Copy link
Owner

asmaloney commented Dec 21, 2022

Can you explain a bit more what you mean by "tiling" in this context? I'm not clear on what you are trying to do.

Because of the format itself (binary data followed by layout in XML - with checksums throughout), you can't append to an E57 file - the writer writes a complete file each time. You would have to read the file in, modify the data, and write it out.

Edit: For an example of reading a file and writing it out again check out the ReadWrite test in test_SimpleData.cpp.

@tfwittwer
Copy link
Author

We acquire data by Mobile Mapping. The data is originally organized in tracks, where multiple tracks may overlap. For further processing we reorganize the data into geographic tiles of e.g. 50 by 50m meters, with all overlapping tracks that fall into this tile being merged. This makes further processing much easier.
What you say does not come as a surprise to me. In that case it would probably better to first store the individual images and meta information in a folder per tile and then build the E57 tiles in one go.

@asmaloney
Copy link
Owner

Ah, cool!

It sounds like you might be dealing with hundreds or thousands of files, so I think what you suggest here makes sense so you aren't constantly reading & writing them.

I notice that the internal CheckedFile class has a WriteExisting mode. I'm not sure what the original authors intended with it, but it's not used anywhere (and I don't think what's there would work).

@tfwittwer
Copy link
Author

That's correct, my test project resulted in more than 600 tiles that I now had to keep opened simultaneously (which worked). I'll modify the program to first write multiple files for the same tile and then merge them in a second step. Thanks a lot for your help and suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants