Sorting GM Line Vectors
Roger Edrinn
Global Mapper UserTrusted User
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.
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
-
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 -
global_mapper wrote: »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.
If GM could sort the lines alphabetically before exporting the shapefile, that would be a big help. Apparently not? -
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 -
Excellent idea. A test is in order.
Thanks -
Nope, same order, bummer.
Thanks for the prompt reply. -
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 -
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.) -
global_mapper wrote: »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 .
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? -
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 -
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 -
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 -
global_mapper wrote: »It sounds like something wasn't saved right from Excel.
Thanks again for the alphabetic line sort. -
global_mapper wrote: »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 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 -
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 -
Assuming that isn't what I want, it isn't. How would I merge the layers?
-
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 -
That must be a new feature, never done that before. Most useful.
Thanks
Howdy, Stranger!
Categories
- 12.2K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 788 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 520 Other Discussion
- 125 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 99 Global Mapper Forum Website