Remove Duplicate features

nickgoodliffnickgoodliff Global Mapper UserPosts: 45Trusted User
edited August 2014 in SDK
Any easy way to remove duplicate features (caused by loading neighbouring shp tiles that have same feature included in them)?

Cheers
Nick

Comments

  • GeoGeo Global Mapper User Posts: 92Trusted User
    edited July 2014
    it is possible with a Global Mapper script.


    EDIT_VECTOR
    - Edit Loaded Vector Features that Match a Type/Name/Attribute Query
    • Duplicate Feature Finding
      • DELETE_DUPLICATES - specifies whether or not to mark matching features that are duplicates (i.e. same coordinates, label, attributes, type, and style) as deleted. Use DELETE_DUPLICATES=YES to enable. Note that this only removes duplicate features that are within the same layer. Duplicates in different layers will not be deleted.
  • nickgoodliffnickgoodliff Global Mapper User Posts: 45Trusted User
    edited July 2014
    Looking for an SDK function rather than a script. I can code something into my app if need be, but hoped there might be a flag or something that the SDK exposes to do it instead.

    Nick
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,038
    edited July 2014
    Hi Nick,

    I have added item #14060 to our task list for potential inclusion of an API to delete duplicate features in a future version of the Global Mapper SDK. In the meantime, you can accomplish the same thing by writing a script using the EDIT_VECTOR command with the DELETE_DUPLICATES parameter, and executing it using the GM_RunScript() API. The script can be passed in as text or loaded from a file.

    Cheers,

    Bob
  • nickgoodliffnickgoodliff Global Mapper User Posts: 45Trusted User
    edited July 2014
    Brilliant, thanks Bob.
    Nick
  • nickgoodliffnickgoodliff Global Mapper User Posts: 45Trusted User
    edited August 2014
    Hi

    So DELETE_DUPLICATES "only removes duplicate features that are within the same layer. Duplicates in different layers will not be deleted."
    Any straightforward way to delete duplicates from multiple layers?

    Nick
  • bmg_bobbmg_bob Global Mapper Programmer Posts: 2,038
    edited August 2014
    Hi Nick,

    After removing the duplicate features from within each layer, you could use the MOVE_TO_NEW_LAYER parameter to combine the layers into one, and use DELETE_DUPLICATES on the resulting layer.

    Cheers,

    Bob
Sign In or Register to comment.