ossimlabs / ossim

Core OSSIM (Open Source Software Image Map) package including C++ code for OSSIM library, command-line applications, tests, and build system
MIT License
295 stars 142 forks source link

Is it possible to convert a XML format rpc file to an OGEOM format file using OSSIM? #263

Open hanhao20190402 opened 3 years ago

oscarkramer commented 3 years ago

Not directly. You'll need to write code. Assuming you have an rpc file with ".XML" extension, there is a roundabout but simple way of accomplishing this.

In your converter app, do:

// Read XML into sensor model object:
ossimFilename rpcFilename ("my_image.XML");
ossimQuickbirdRpcModel rpcModel;
if (!rpcModel.parseRpcData(rpcFilename))
   cout<<"Error!"<<endl;

// Create geometry object and have it write ogeom:
ossimImageGeometry geom (nullptr, &rpcModel);
ossimKeywordlist geomKwl;
geom.saveState(geomKwl);
geom.Kwl.write("my_image.geom");

Not sure if this will work as advertised... Ignore the fact that it may not be QuickBird. The RPC XML format should be the same for all platforms, though I can't verify that.