+ Reply to Thread
Results 1 to 6 of 6

Thread: Adding attributes to features from a text file

  1. #1
    mirlz is offline Global Mapper User
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Adding attributes to features from a text file

    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?

  2. #2
    global_mapper is offline Administrator
    Join Date
    Jun 2007
    Posts
    7,236
    Thanks
    2
    Thanked 611 Times in 594 Posts

    Default

    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

  3. #3
    mirlz is offline Global Mapper User
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    global_mapper is offline Administrator
    Join Date
    Jun 2007
    Posts
    7,236
    Thanks
    2
    Thanked 611 Times in 594 Posts

    Default

    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

  5. The Following User Says Thank You to global_mapper For This Useful Post:

    mirlz (03-09-2010)

  6. #5
    mirlz is offline Global Mapper User
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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

  7. #6
    mirlz is offline Global Mapper User
    Join Date
    Mar 2010
    Posts
    10
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I've found the solution to my problem already.

    Thanks a lot!

    Regards
    Eugenia

+ Reply to Thread

Similar Threads

  1. Replies: 1
    Last Post: 01-13-2010, 04:55 PM
  2. Replies: 2
    Last Post: 09-14-2009, 01:37 PM
  3. Adding custom PRJ- file
    By STH in forum Suggestion Box
    Replies: 1
    Last Post: 03-13-2009, 01:01 AM
  4. Import Dgn file with attributes
    By kalli in forum Vector Data
    Replies: 1
    Last Post: 03-11-2008, 06:44 PM
  5. Catalog File not seeing hydro attributes?
    By Roger Edrinn in forum Technical Support
    Replies: 3
    Last Post: 12-13-2007, 08:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts