Welcome to our new forum platform. We realize there is still some work to do and we appreciate your patience. Please let us know if you have any ideas or suggestions: paul@globalmapperforum.com

Trouble importing archives of DNCs

jdh5259jdh5259 Global Mapper UserPosts: 30Trusted User ✭✭
edited May 2012 in GM Script Language
Hi guys,

I am new to this and have been having a bit of trouble getting my script to work and was hoping you might be able to help.

Currently I am trying to import DNCs from multiple archives without prompting for coverage information. Now I know my IMPORT_ARCHIVE command is wrong but after a lot of attempts, it was the most progress that I was able to make. The main problem I am having is being unable to reference each library in the archive so that LOAD_FLAGS will work which is why I tried putting a wildcard in there but it doesn't look like the LOAD_FLAGS accepts wildcards. I also wasn't sure about the FILENAME command but decided to try to recreate the pattern I saw in the workspace file.

GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL

DIR_LOOP_START DIRECTORY="C:\test\" FILENAME_MASKS="*.ZIP"

IMPORT_ARCHIVE ARCHIVE_FILENAME="%FNAME_W_DIR%" FILENAME="*\DHT" LOAD_FLAGS="*?COVERAGES=*"

DIR_LOOP_END

Any help would be greatly appreciated.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff
    edited May 2012
    I think you just want to use the IMPORT command rather than IMPORT_ARCHIVE. That will recognize it is a .zip and find and load the 'dht' file in it automatically. The IMPORT_ARCHIVE command is only if you just want to load a particular file from the .zip and not just everything in the .zip.

    So something like IMPORT FILENAME="%FNAME_W_DIR%" LOAD_FLAGS="*?COVERAGES=*"

    inside your loop.

    Thanks,

    Mike
  • jdh5259jdh5259 Global Mapper User Posts: 30Trusted User ✭✭
    edited May 2012
    Mike,

    Thanks for the quick reply. However, your answer didn't seem to work. I have just one archive to try and test this out right now named louisiana.zip with five individual libraries inside and the results of running the script are as follows:

    Removed all loaded overlays.
    Starting loop over all files in directory...
    Importing file C:\test\louisiana.zip...
    WARNING: Unable to load overlay louisiana.zip
    VPFOverlay.cpp - 1332
    Version: v13.1.3 (32-bit)
    Build Time: Mar 28 2012 20:16:10
    Use Ctrl+V to Paste Error
    WARNING: Unable to load overlay louisiana.zip
    VPFOverlay.cpp - 1332
    Version: v13.1.3 (32-bit)
    Build Time: Mar 28 2012 20:16:10
    Use Ctrl+V to Paste Error
    WARNING: Unable to load overlay louisiana.zip
    VPFOverlay.cpp - 1332
    Version: v13.1.3 (32-bit)
    Build Time: Mar 28 2012 20:16:10
    Use Ctrl+V to Paste Error
    WARNING: Unable to load overlay louisiana.zip
    VPFOverlay.cpp - 1332
    Version: v13.1.3 (32-bit)
    Build Time: Mar 28 2012 20:16:10
    Use Ctrl+V to Paste Error
    WARNING: Unable to load overlay louisiana.zip
    VPFOverlay.cpp - 1332
    Version: v13.1.3 (32-bit)
    Build Time: Mar 28 2012 20:16:10
    Use Ctrl+V to Paste Error
    WARNING: No overlays could be loaded from file <C:\test\louisiana.zip>.
    Loop over files in directory completed.
    Script processing COMPLETED.
  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff
    edited May 2012
    What does your IMPORT command look like? Make sure NOT to add the TYPE parameter and let the file be recognized as a .zip and loaded appropriately. If you specify the type it will not auto-detect that it's an archive file.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • jdh5259jdh5259 Global Mapper User Posts: 30Trusted User ✭✭
    edited May 2012
    I used the IMPORT command that you posted previously. So it would be:

    IMPORT FILENAME="%FNAME_W_DIR%" LOAD_FLAGS="*?COVERAGES=*"

    Is it because the files inside the root archive are also .zip? Although I don't understand why that would be the problem when importing this archive manually and clicking OK on the coverage prompts works fine.

    Thanks again.
  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff
    edited May 2012
    Oh do you have zip files within the .zip files you are trying to load? That is a special case. There is actually now support for wildcards in the FILENAME parameter of an IMPORT_ARCHIVE command, so if you have the latest release of Global Mapper the following might work:

    IMPORT_ARCHIVE ARCHIVE_FILENAME="%FNAME_W_DIR%" FILENAME="*.zip" LOAD_FLAGS="*?COVERAGES=*"

    That should import any .zip files within the main archive .zip and pass in those load flags.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • jdh5259jdh5259 Global Mapper User Posts: 30Trusted User ✭✭
    edited May 2012
    It looks like it is getting closer. It has started recognizing the filenames of the archived DNCs inside the main archive. However, it is still giving me problems. Here is the output trimmed a little bit because the errors are all the same:

    Removed all loaded overlays.
    Starting loop over all files in directory...
    Importing file *.zip from archive C:\test\louisiana.zip...
    WARNING: Unable to load overlay A1508800.zip
    VPFOverlay.cpp - 1332
    Version: v13.1.3 (32-bit)
    Build Time: Mar 28 2012 20:16:10
    Use Ctrl+V to Paste Error
    ...
    WARNING: No overlays could be loaded from file <*.zip>.
    Loop over files in directory completed.
    Script processing COMPLETED.

    This is still using the same script as before but with the IMPORT_ARCHIVE command modified to the one is your previous post.

    Also, I am not sure if this is the same problem or not but while testing this out I changed the COVERAGES=* to COVERAGES=''HYDROGRAPHY'' (with two single quotes) to see what would happen and got a slightly different error:

    Removed all loaded overlays.
    Starting loop over all files in directory...
    Importing file *.zip from archive C:\test\louisiana.zip...
    WARNING: Error loading VPF library data.
    No library with the name * found.
    VPFOverlay.cpp - 318
    Version: v13.1.3 (32-bit)
    Build Time: Mar 28 2012 20:16:10
    Use Ctrl+V to Paste Error
    ...

    Could the problem be with the *? at the beginning of the LOAD_FLAGS command?

    Thanks for all of the quick responses and being patient with me. I have spent the last day and a half trying to get this to work properly...
  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff
    edited May 2012
    Try just using LOAD_FLAGS="COVERAGES=*". This should just load all of the coverages without a prompt I believe.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • global_mapperglobal_mapper Administrator Posts: 17,238BMG Staff
    edited May 2012
    Actually sorry, try LOAD_FLAGS="COVERAGES=''*''", where what is around the * is the double single quotes.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • jdh5259jdh5259 Global Mapper User Posts: 30Trusted User ✭✭
    edited May 2012
    THANK YOU!! I know I tried the COVERAGES=* before and it didn't work but it works perfectly with the double single quotes! You have saved me from a lot more frustration.
Sign In or Register to comment.