and

tjhbtjhb Global Mapper UserPosts: 454Trusted User
edited October 2010 in Technical Support
I can't find a reference saying what fields (if present) will be used for either of these categories, in the "Split Features on Export" feature in the GUI, or in scripting.

Is there a list of such field names?

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2010
    Those are special field names that will use either the display label associated with a feature (for <Feature Name>) or the description (for <Feature Desc>), which is normally the type name for the feature, but can be different if pulled in from a format that has explicit descriptions. These are note necessarily based on any attribute values.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • tjhbtjhb Global Mapper User Posts: 454Trusted User
    edited October 2010
    I should say what I am currently trying to do, rather than ask such a broad question without context.

    I'm currently trying to split a shapefile into 48 separate shapefiles, based on the value in an existing (numeric) field. It seems the easiest way to do this is to rename the field to have a name recognised by GM as a <Feature Desc>.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2010
    It might be easiest to use the SPLIT_BY_ATTR parameter of the EXPORT_VECTOR script command (see http://globalmapper.com/helpv12/ScriptReference.html#cmd_export_vector) to split on an arbitrary attribute rather than renaming an attribute.

    That being said, you can find a list of the attribute names that will be automatically used for the display label or description at http://globalmapper.com/helpv12/GenericASCIIFormat_FieldOptions.doc.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • tjhbtjhb Global Mapper User Posts: 454Trusted User
    edited October 2010
    Great! Two ways to do it. I'll try both. I like the option to rename an existing field to (say) DESC, since it enables a quick split-by-attribute using the GUI.*

    The reference document is very helpful, today and in general. I see it is available from the manual, but hadn't thought to look there. Gives a lot of insight.

    *It's tempting to ask for a new feature here: in the "Split Export Based on" drop-down box, a third option, something like "Choose attribute..." which would bring up a child dialog to select a custom field to split the export by. (I suppose the field would have to have a text or integer data type.) This would add more of the current scripting functionality into the GUI.

    Anyway, thanks for giving me more than I need to do the job.
  • tjhbtjhb Global Mapper User Posts: 454Trusted User
    edited October 2010
    I just quickly tried the GUI method:

    Open shapefile
    Select all features with the digitizer tool
    Digitizer: Edit selected features: Feature attributes: rename feature to "DESC"
    Export areas to shp, splitting on <Feature Desc>
    [In the result, the field name is changed to DESC, but splitting is not effective: I think because GM is reading from the source shapefile(s), whose schema is only now being changed; the one output file has the suffix _unknown_area_type.]
    Unload original data, and reopen the exported result
    Export areas to shp again, splitting on <Feature Desc>
    [Splitting by the new DESC is now effective: there is one file for each value, appended as suffix to the name]
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2010
    That is expected, the special attribute names are only read when you load the file. If you already have the file loaded and you set a DESC attribute that doesn't override the existing description of the feature. The attribute-based assignment of description, label, and drawing style will only happen at load time.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • tjhbtjhb Global Mapper User Posts: 454Trusted User
    edited October 2010
    Thanks for confirming that Mike, it makes good sense. Here the scripting interface is more convenient, especially for a very large file, because it requires only one pass, but a perfectly good result is available in the GUI as well, using two passes.
Sign In or Register to comment.