Global Mapper v25.0

relative pathnames in gmw file

Yann DUPUY
Yann DUPUY Global Mapper UserTrusted User
edited September 2014 in SDK
Hi,
when saving a GMW file, is it possible to save filenames relativelly to that gmw file ?

If not, would that be added in future versions ? It is necessary to be able to move complete workspaces from disk part to another, or to send it to someone with different harddrive architecture.

Thanks,
Yann

Comments

  • bmg_bob
    bmg_bob Global Mapper Programmer
    edited September 2014
    Hello Yann,

    Thank you for using Global Mapper. I apologize for the delay in responding.

    Although Global Mapper does not store relative paths in the workspace file, if a file can not be found at the stored location, Global Mapper will attempt to find the file relative to the location of the workspace file. Are you having a specific problem where Global Mapper is not able to load some files when loading a workspace?

    Cheers,

    Bob
  • Yann DUPUY
    Yann DUPUY Global Mapper User Trusted User
    edited September 2014
    bmg_bob wrote: »
    Hello Yann,

    Thank you for using Global Mapper. I apologize for the delay in responding.

    No probs.
    Although Global Mapper does not store relative paths in the workspace file, if a file can not be found at the stored location, Global Mapper will attempt to find the file relative to the location of the workspace file. Are you having a specific problem where Global Mapper is not able to load some files when loading a workspace?

    For instance, we might separate the input data according to their origin:
    Data_Input / Orthophotography
    / Altimetry
    / Planimetry

    On my machine, this can be in D:/MyProjects/theDatabase

    I wish I could put the gmw file into Data_Input and it would reference for instance
    Orthophotography/thePhoto1.tif
    Orthophotography/thePhoto2.tif
    Altimetry/theAlti.dted
    Planimetry/theBuildings.shp
    Planimetry/theRoads.shp

    instead of
    D:/MyProjects/theDatabase/Orthophotography/thePhoto1.tif
    D:/MyProjects/theDatabase/Orthophotography/thePhoto2.tif
    D:/MyProjects/theDatabase/Altimetry/theAlti.dted
    D:/MyProjects/theDatabase/Planimetry/theBuildings.shp
    D:/MyProjects/theDatabase/Planimetry/theRoads.shp

    Then, if I move my database into let's say G:/Databases/theDatabase, the .gmw file would still reference the correct files.
    Am I making myself clearer ?
    Cheers,

    Bob

    Thanks Bob,
    Yann
  • bmg_bob
    bmg_bob Global Mapper Programmer
    edited September 2014
    Hello Yann,

    That does clarify what you are trying to do, and Global Mapper will allow you to do that even though it stores the full path for the file name in the workspace file. If an input file is not found at the location specified in the workspace file, Global Mapper will attempt to find the file relative to the director where the workspace file is located.

    I ran a simple test to illustrate this as follows:

    1. Create a directory called P:\Relative\MyData, and put a couple of shapefiles files in there.
    2. Load the files into Global Mapper, and save a workspace at P:\Relative\test.gmw. (Note that the workspace file contains the full path to the files at P:\Relative\MyData\...)
    3. Close Global Mapper.
    4. Rename the base directory to P:\Relative_xyz, so now the data files are in P:\Relative_xyz\MyData
    5. Start Global Mapper and load the workspace P:\Relative_xyz\test.gmw.
    6. The workspace file loads successfully because Global Mapper was able to find the data files relative to the current location of the workspace file.

    I used Global Mapper 16 for my test, but this should work in earlier versions as well.

    Cheers,

    Bob
  • Yann DUPUY
    Yann DUPUY Global Mapper User Trusted User
    edited September 2014
    You're right Bob.
    I might have done something wrong the first time, it seems to be working.

    Thanks,
    Yann