Global Mapper Pro

Remove Attributes - Shape File export

Alex404
Alex404 Global Mapper UserTrusted User
edited March 2014 in GM Script Language
Hi,

what would be the best approach to solve my current issue? I am processing large datasets in the shape format. The respective *.dbf file often grows larger than 2 GB, causing errors in the subsequent programs.

This amount of data is mainly caused by additional, but not needed attributes. How should I approach it? Is there a filter on "wanted" attributes in the EXPORT_VECTOR command, or should I use EDIT_VECTOR before exporting? Is there something like "delete all attributes appart from Name and Type"?

Any ideas appreciated..

Thanks and best regards,
Alex

Comments

  • global_mapper
    global_mapper Administrator
    edited May 2011
    Alex,

    You would need to use the EDIT_VECTOR command to strip out the unwanted attributes prior to exporting.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • RobertR
    RobertR GlobalMapper Fan! Trusted User
    edited March 2013
    Hello all,

    I found this topic and decided to post here as my question is related.

    In the exported_vector file, I would like to keep only one attribute column (as the loaded files have a lot of them). How can I achieve this? Please keep in mind that I do not want to delete attribute values, but the entire column(s).

    Thank you,
  • global_mapper
    global_mapper Administrator
    edited March 2013
    If you use the EDIT_VECTOR command with one or more ATTR_TO_DELETE parameters specifying the attribute to remove from all matching features, you can use that to remove all but the one that you want.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/
  • RobertR
    RobertR GlobalMapper Fan! Trusted User
    edited March 2013
    Oh, ok. I look up this option but from the description I understood that it is dealing with the attributes in a column and not with the entire column.

    Thanks,
  • jdh5259
    jdh5259 Global Mapper User Trusted User
    edited March 2014
    Hello,

    I have a quick question related to this topic. I am currently attempting to export a subset of attributes when exporting a shapefile. I have attempted to use the EDIT_VECTOR command with ATTR_TO_DELETE and also with the newer ATTR_TO_KEEP. However, each time, my export included every attribute that was present in my data.

    I believe this has to do with the fact that I am importing a catalog file (.gmc) and no data has actually been loaded in whenever the EDIT_VECTOR command is run. I have attempted to load in a small section from the catalog file and run the EDIT_VECTOR command and it appeared to work as intended.

    Is there any way to export a subset of attributes when using a catalog file?
  • global_mapper
    global_mapper Administrator
    edited March 2014
    The EDIT_VECTOR command would fail to maintain any changes to files in a map catalog in that a map catalog is special and doesn't keep any edits to layers. What you could do instead is use DIR_LOOP_START...DIR_LOOP_END to loop over the actual files that are in the catalog and edit them then export to a new file, then perhaps as part of that loop also build a new map catalog of the exported modified files.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • jdh5259
    jdh5259 Global Mapper User Trusted User
    edited March 2014
    As always, thanks for the quick response. You confirmed my suspicions and as much as I was hoping to avoid the intermediary files, it appears that is the way to go.

    Thanks again.
Sign In or Register to comment.