convert positioned jpgs to jpgs+worldfile or hgr with batch convert

Hi.

I`m having a serious problem when converting raster files with the raster manager's "batch convert" tool.

 I´ve a number of .jpg images possitioned in the model space, the number varis betwen dgn files, is about 5 to 75 raster files per dgn.

 Once georeferenced,  I need to export them to .cot or preferably to .jpg with .hgr file.

 When saving each file individually;  doing file>save as> imagename.cot or imagename.jpg+hgr file, it exports the file correctly. In the case of the .cot, it adds the position, scale and rotation in the header an in the case of teh jpg writes correctly the hgr file.

 BUT, heres comes my problem, after a batch convert processing,  when importing back the generated files to the raster manager, they appear in an incorrect position, VERY far from where they should be.

Even stranger is the fact that some times it has worked during the testing process.  

 I'm getting crazy with this problem, and soon I'll get quite  in a hurry seeing drafters lose time saving files individually.

 Please, give me a hand with this.

 Bye.

 

Parents
  • I have a Macro that can save all the images attached to a design file using "Save As" key-ins. I will attach it to this message and you can see if it does what you are looking for. Right now, it saves the raster attachments of a design file to JPG format. You will probably need to edit the output directory in the Macro (currently set to D:\Temp\Output\), ask me if you need help.

     

    Also, before you use the Macro, you will have to do the following steps to ensure that the sister files are created properly during the export.

     1) Go to MicroStation's "Workspace" menu and click on "Preferences...".  In the "Category" list, choose "Raster Manager" and then go to the "Georeference" tab.  Make sure that "Save Location Info in Sister File if Required" is checked.

    2)  Go to MicroStation's "Workspace" menu and click on "Configuration...".  Fing the configuration named "MS_RASTER_DEFAULTSISTER", set its value to 0 or 1 if you want HGR or to 2 if you want WorlFiles.

    3) Restart MicroStation and try the Macro.

     

    Another "trick" to work around this problem would be to do the 3 steps mentioned above. Then, open the Raster Manager dialog box and set the "Read-Only" toggle of all attached rasters OFF and back ON. This will create sister files for all the attached raster files.  Once the sister files are created, the Raster Convert should work as you expect it too. 


     This is a test

    RasterSaveAs.mvba
  • Hi Pascal, can you please give the key-in to save in GEOTIFF format? That way I could change your macro to convert jpg to geotiif. Thanks in advance

    Rogério Oliveira


    Microstation Connect | OpenRoads Designer  | OpenBridge Designer 

  • Hi Rogério,

    To output rasters in Geotiff format, you need to replace "JPG" by "GEOTIFF" in the following line:

    • CadInputQueue.SendCommand "RASTER SAVEAS SETOUTPUTSETTING JPG 24BITCOLOR"

    HTH,

    Pascal


     This is a test

  • Thank you Pascal. That did work jsut fine, but I tried to change the BITCOLOR to 8 and didn't work. Because the size of the *.tif is 75mb each with RGB, but with 256 colors it drops to 18mb. Can you help with this?  

    Rogério Oliveira


    Microstation Connect | OpenRoads Designer  | OpenBridge Designer 

Reply Children
No Data