Global Mapper v25.0

Screen Refresh Extremely Slow At Any Zoom Level While Rectifying Large DXF File

BrianZ111
BrianZ111 Global Mapper UserTrusted User
edited October 2014 in Vector Data
I have large DXF files (similar to this one that I posted in an earlier thread http://www.zagerdesign.com/temp/becc_dxf.zip) that I want to rectify to an image. In the main view when I adjust the view (zoom in/out or move) the refresh is slow to load more zoomed out but gets pretty snappy the tighter the zoom gets. However while in the rectify dialog box the refresh when adjusting the DXF view is painfully slow no matter what the zoom level. It seems like it is re-rendering the entire DXF even if I'm only zoomed in on a small part. Is there anything that can be done about this or any way around it? One work around I tried was exporting the DXF as a raster image just to use to create my control points and saving a control point file to load on the actual DXF. This didn't work though because the origin of the DXF came in as the lower left and the origin of the raster image came in as the upper left so the control points were flipped vertically. Any other ideas? Thanks.

Comments

  • Jasmine_BMG
    Jasmine_BMG BMG Staff
    edited June 2014
    Hi Brian,

    I exported your DXF to a raster format and the image was orientated the same way as the original vector file. What version of Global Mapper are you using, and what raster format did you export to?

    Regards,

    Jasmine
  • BrianZ111
    BrianZ111 Global Mapper User Trusted User
    edited June 2014
    I exported as PNG. To be clear, when I load the PNG it looks correct and matches the DXF but when placing control points the upper left corner is 0,0 where as when rectifying the DXF the lower left corner is 0,0. So loading a saved control point file from one to the other doesn't translate properly. Is there a different format that will preserve the origin of the original? Thanks.
  • Jasmine_BMG
    Jasmine_BMG BMG Staff
    edited June 2014
    Hi Brian,

    You can try rotating the DXF by 90 degrees and then exporting it to a raster format (Select all with Digitizer and right-click, then go to Move/Reshape Features and then the ROTATE/SCALE option).

    Regards,

    Jasmine
  • BrianZ111
    BrianZ111 Global Mapper User Trusted User
    edited June 2014
    I will try this later when I get a chance however I think I already tried something similar to this and it didn't work. This was because not only are the origins different but the direction of the y-axis is flipped. That is on the DXF the numbers get larger as you move up vs. on the raster image the numbers get larger as you move down.
  • Geo
    Geo Global Mapper User Trusted User
    edited June 2014
    hello Jasmine and BrianZ111,

    to my knowledge, it is not possible to directly apply a transformation that has been used with an image on a vector file.
    unless the processing is helmert type, because in this case, a translation, a rotation and a scale factor can be applied to overlay the vector file on the rectified image ; the other types of transformation require the use of control points.

    nevertheless it is possible to apply the same transformations by using an indirect means.

    this is what happens:
    • make an image of your dxf -> dxf.png
    • Rectify dxf.png and save GCP file (x pixel, y pixel, X projected, Y projected, error) to dxf.png.gcp
    • get dxf.png image height and modify dxf.png.gcp by subtracting image height to y pixel, save this new gcp file as new.dxf.png.gcp
    • make a world file for dxf.png containing:
      1
      0
      0
      -1
      0
      0
      
    • open dxf.png in Global Mapper using this world file
    • open your dxf and translate, rotate and scale it to overlay the dxf.png image
    • export to local.dxf
    • export all points and all points from lines and areas to a csv file -> local.dxf.csv (export nothing else than X, Y)
    • remove duplicate points in local.dxf.csv
    • add image height to Y column in local.dxf.csv and save
    • import as ascii file local.dxf.csv in Global Mapper
    • Rectify local.dxf.csv, load new.dxf.png.gcp and choose the same rectification method you used for rectifying dxf.png
    • export local.dxf.csv to rectified.dxf.csv
    • replace each row of coordinates in local.dxf.csv found in local.dxf with the same row of coordinates in rectified.dxf.csv
      MiniTrue can be helpfull for this task
      see JRS - PC Links Reference - J R Stockton for description
      Binaries are available at Garbo and +
    • save the result to rectified.dxf
    • done!
    tricky rectification method?
    a simplier way is welcome :)
  • BrianZ111
    BrianZ111 Global Mapper User Trusted User
    edited June 2014
    Wow yeah I think at that point I might be better off just working directly with the DXF and putting up with the slow refresh rates. :D Thanks though, I will give it a try and see how it goes.
  • Geo
    Geo Global Mapper User Trusted User
    edited June 2014
    you can skip all the points extract and replace stuff,
    i had to work with points to preserve xdata embedded in the dxf file
    • [strike]export all points and all points from lines and areas to a csv file -> local.dxf.csv (export nothing else than X, Y)[/strike]
    • [strike]remove duplicate points in local.dxf.csv[/strike]
    • [strike]add image height to Y column in local.dxf.csv and save[/strike]
    • [strike]mport as ascii file local.dxf.csv in Global Mapper[/strike]

    and just shift local.dxf by image height, then
    • Rectify local.dxf, load new.dxf.png.gcp and choose the same rectification method you used for rectifying dxf.png
    • and export local.dxf to rectified.dxf
    • done!
  • BrianZ111
    BrianZ111 Global Mapper User Trusted User
    edited June 2014
    Did some more testing with this. I saved a raster with a resolution of 1 in the same units as the projection of the DXF and created a control point file with the raster. Then I loaded the control point file into Excel as a CSV. I created a second sheet in Excel setting everything to equal the first sheet except the first Y coordinate where I subtract it from the total height. Save that sheet back out as a CSV and load it as a control point file on the DXF. The subtraction of height inverts it so that it shows up correct on the DXF. You have to be careful about projection though. It seems like the display projection always needs to stay the same through the whole process and the loaded projection of the DXF and the Raster need to be the same, otherwise control points get thrown off again.

    I've also noticed a couple of things that seem to help the refresh rate when just rectifying the DXF. Closing all other layers out except what's needed – leaving only the DXF and the reference image (just hiding them isn't enough). Also, making sure to set a projection when loading the DXF that is at least somewhat close to the reference image.
  • BrianZ111
    BrianZ111 Global Mapper User Trusted User
    edited October 2014
    I was playing around with rectifying DXF files again and I accidentally found the solution to this problem. Thought I'd post it in case anyone is curious or has a similar problem.

    So what I figured out was if the source projection set for the DXF when it's loaded is exactly the same as what is set for the display projection in the configuration settings, view refresh rates while rectifying are really snappy, pretty much as good as when rectifying raster images. That means identical projection, zone, datum, planar units, and parameters. If anything is off, rectify view refresh rates slow to a crawl. I don't know if this is a bug or a product of a lot more math involved in converting between projections on the fly. In any case I know the work around now and I can always change display projections to match a source I need to rectify and when finished change it back to how I want it to display and export.