Adding attributes to features from a text file
mirlz
Global Mapper User
Hi,
I have this shp file which consists of more than 40000 features, I have a text file which contains all the attributes that I need to add in to each and every one of the feature (attributes are different for every feature).
How do I go about adding the attributes in through the text file?
I have this shp file which consists of more than 40000 features, I have a text file which contains all the attributes that I need to add in to each and every one of the feature (attributes are different for every feature).
How do I go about adding the attributes in through the text file?
Comments
-
While you can't add attributes directly from a text file, if your text file has attributes for each feature in order, you can load the text file into Excel and then save it as a DBF file in the same folder and with the same name as the SHP file, then the attributes will be picked up from the DBF file when you load the SHP file.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Hm, so let's say I want to add ID to each feature, I'll do it like this?
There is specific attributes that needs to be added to the specific feature though, how should I do it so that the correct attributes are added to the correct feature?
Thanks so much for your prompt reply
Regards
Eugenia -
Eugenia,
It wouldn't be quite like that, the column header would be ID, with the values below it. Each attribute name would only exist once at the top of the file. For this to work with the features from the SHP file there would have to be a record in your DBF file for each feature in the SHP file, and they would both have to be in the same order (i.e. the attributes for the first feature in the SHP file would be the first line of data in the DBF file).
If that isn't possible there really isn't any way to automatically match the attributes to features, you would have to manually assign them by editing the features.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Oh~ so you mean its something like this instead right?
Okay, because the shp file was passed to me from another person, he did gave me a txt file which contains all the attributes in order but I'm not sure whether or not the first line of attributes is the first feature in the shp file.
Is there any way for me to know which is the first feature made in shp file? If not, I guess I could try this method first.
Thanks
Regards
Eugenia -
I've found the solution to my problem already.
Thanks a lot!
Regards
Eugenia
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