Global Mapper v25.0

Exporting attributes in shapefile as integer, double or float instead of string

Is it possible to export shapefiles where the attributes are numbers instead of strings? I have contours derived from LiDAR data I want to manipulate in other programs and scripts, but because the Elevation attribute (for example) is a string, I have to preform a work around instead of a simple function. Perhaps I missed a button?

Answers

  • bmg_bob
    bmg_bob Global Mapper Programmer
    Answer ✓
    Hello,

    There are a couple of things you can do.  First, when you create contours, be sure to remove the check mark from the option to append unit labels to elevation values.  Then, when exporting the shapefile, look at the Attribute Setup tab on the Shapefile Export Options window.  The type for the ELEVATION column should now be a numeric type (integer or float).

    Cheers,
    Bob
  • Thank you Bob! I did miss a button. 
  • acgardiner
    acgardiner Global Mapper User Trusted User
    You're way beyond me.  Sorry I don't know what you mean.  Can I upload the files for you to look at?

  • gghiggini
    gghiggini Global Mapper User
    I have the same problem, Global Mapper seem to automatically calculate the field type based on the content (i.e. if it reconize an integer then it creates a numeric field).
    How can I set up my fields types in a shapefile while exporting it with a script ? I know this could be done while manually exporting a shapefile, but what about using a script?
  • bmg_bob
    bmg_bob Global Mapper Programmer
    Hello,

    We have an open feature request to add this functionality, but it is not currently scheduled for implementation. I have added your information to the ticket (GM-5194). Thank you.

    Cheers,
    Bob