Global Mapper Pro

Sorting GM Line Vectors

Roger Edrinn
Roger Edrinn Global Mapper UserTrusted User
edited March 2010 in Vector Data
I'm trying to merge two datasets and not totally sure how GM can help me.

My plan is to create the line vectors with names in GM. Export those vectors as a shapefile, open the dbf file in Excel, merge the data, save as a dbf and import the shapefile with all the merged data.

First is their a better way? If not, can GM export the line vectors in name order? My first test suggest the order they were made.

All suggestions gratefully accepted.

Comments

  • global_mapper
    global_mapper Administrator
    edited March 2010
    Roger,

    What you are describing won't work as you would be re-ordering the attributes in the DBF file, so they then wouldn't match up to the proper features in the SHP file as the order of the features in the DBF and SHP file have to match up.

    For merging the data sets, could you just load the two SHP files into Global Mapper, then export them out as a single SHP file? If you want to sort the merged DBF results just for analysis and are ok with severing the ties to the SHP file, you could then load that merged DBF into Excel and sort on whatever you want.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Roger Edrinn
    Roger Edrinn Global Mapper User Trusted User
    edited March 2010
    What you are describing won't work as you would be re-ordering the attributes in the DBF file, so they then wouldn't match up to the proper features in the SHP file as the order of the features in the DBF and SHP file have to match up.
    I was aware of this vector to data correspondence, hence my post.
    For merging the data sets, could you just load the two SHP files into Global Mapper, then export them out as a single SHP file? If you want to sort the merged DBF results just for analysis and are ok with severing the ties to the SHP file, you could then load that merged DBF into Excel and sort on whatever you want.
    I don't have two shapefiles, rather GM vector data (lines) and an Excel spreadsheet (line data). So I'm looking for a way to match the lines name to the data to be added, by using the 1-to-1 data/vector correspondence.

    If GM could sort the lines alphabetically before exporting the shapefile, that would be a big help. Apparently not?
  • global_mapper
    global_mapper Administrator
    edited March 2010
    While there isn't a direct way to sort the lines by name, what I think you can do is use the Search Vector dialog to sort the features by name, then select to copy them to the clipboard, then paste those lines in a new instance of Global Mapper and I think they will be sorted by name. Then when you export they should come out in that order. I'm not 100% sure on this, but off the top of my head I think it would work.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Roger Edrinn
    Roger Edrinn Global Mapper User Trusted User
    edited March 2010
    Excellent idea. A test is in order.

    Thanks
  • Roger Edrinn
    Roger Edrinn Global Mapper User Trusted User
    edited March 2010
    Nope, same order, bummer.

    Thanks for the prompt reply.
  • global_mapper
    global_mapper Administrator
    edited March 2010
    I took a look and was able to update this process to maintain the original order from the search dialog. I have placed a new build at http://www.globalmapper.com/global_mapper11.zip with the change for you to try. Simply download that file and extract the contents into your existing v11.xx installation folder to give it a try. If you are using the 64-bit version, there is a new build available at http://www.globalmapper.com/global_mapper11_64bit.zip .

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • tjhb
    tjhb Global Mapper User Trusted User
    edited March 2010
    Roger, could you consider adding a Manifold licence to your kit? (Starts at $US245 for a 32-bit version. Better to buy a 64-bit licence for slightly more if you can use it.)

    What you want to do is best done with an SQL join (as you may well know).

    Manifold has a spatially-enabled SQL built in. If you take a plunge in there you won't regret it.

    I hope you don't mind my suggesting this. Manifold and Global Mapper are complementary in many ways. (I don't know if Mike has a copy but I hope so.)
  • Roger Edrinn
    Roger Edrinn Global Mapper User Trusted User
    edited March 2010
    I took a look and was able to update this process to maintain the original order from the search dialog. I have placed a new build at http://www.globalmapper.com/global_mapper11.zip with the change for you to try. Simply download that file and extract the contents into your existing v11.xx installation folder to give it a try. If you are using the 64-bit version, there is a new build available at http://www.globalmapper.com/global_mapper11_64bit.zip .
    Wow, wasn't expecting that . . . Thanks.

    I have a side question related to this process.

    I created my new lines with the default GM attributes and saved those lines to a shapefile. Then I opened the dbf file in Excel, deleted some columns, added others and saved to dbf.

    When I opened the shapefile in GM, the new columns of data weren't recognized. Is their a column count in another file which tells the number of data columns to expect? If so, can I reset the number? Suggestions?
  • global_mapper
    global_mapper Administrator
    edited March 2010
    So long as you didn't add or delete any rows of data from the DBF I would expect the new columns to be picked up. There isn't any kind of column count or anything like that outside the DBF. If you want to provide the DBF after you've edited and let me know which columns were added I can take a look.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Roger Edrinn
    Roger Edrinn Global Mapper User Trusted User
    edited March 2010
    I definitely added columns of data, but neither added nor subtracted rows.

    Doing a simple test, I added the needed attributes in GM before exporting the shapefile. Then opened it in Excel and added data, the saved dbf opened fine. Learning.

    Thanks
  • global_mapper
    global_mapper Administrator
    edited March 2010
    It sounds like something wasn't saved right from Excel. You might try adding the column and saving out the DBF file, then closing the file and re-opening it in Excel to see if the column is actually there in the DBF file.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Roger Edrinn
    Roger Edrinn Global Mapper User Trusted User
    edited March 2010
    It sounds like something wasn't saved right from Excel.
    Correct. I get three consecutive dialogs from Excel when I save over the old dbf file, and I must have made the wrong choice in one. Working fine now.

    Thanks again for the alphabetic line sort.
  • Roger Edrinn
    Roger Edrinn Global Mapper User Trusted User
    edited March 2010
    I took a look and was able to update this process to maintain the original order from the search dialog. I have placed a new build at http://www.globalmapper.com/global_mapper11.zip with the change for you to try. Simply download that file and extract the contents into your existing v11.xx installation folder to give it a try.
    Turns out this cool tool has a minor kink in its execution.

    If you add some line features to a an existing line set, those new lines will not be added, in the layer manager, to the renamed feature layer, rather to a new layer: "User Created Features". Now if you sort all the line objects, they will sort correctly, alphabetically, regardless of the layer. Select All > Copy to Clipboard > Paste in a new session of GM. Those newly added objects are NOT in alphabetic order anymore, rather the new objects are in order created. Bummer.

    This is not a pressing need, just thought you'd like to know.

    Thanks
  • global_mapper
    global_mapper Administrator
    edited March 2010
    Ah that actually makes sense. I forgot that the clipboard file still maintains the original layers, so when you paste them they should be separated into layers as they were originally. They should however be sorted alphabetically within each layer if that is how you copied them.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Roger Edrinn
    Roger Edrinn Global Mapper User Trusted User
    edited March 2010
    Assuming that isn't what I want, it isn't. How would I merge the layers?
  • global_mapper
    global_mapper Administrator
    edited March 2010
    Just select all of the features and edit them and move them to the save layer prior to doing the copy and paste from the search dialog.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • Roger Edrinn
    Roger Edrinn Global Mapper User Trusted User
    edited March 2010
    That must be a new feature, never done that before. Most useful.

    Thanks
Sign In or Register to comment.