Get values from ShapeFile dbf

2 posts, 0 answers
  1. CD
    CD avatar
    14 posts
    Member since:
    Mar 2011

    Posted 22 Apr 2011 Link to this post

    Hello
    I have my shape file loaded and displaying over a Bing base map.
    I would like to get the values from the dbf file when the shapes are added, and if possible add additional data to the shapes.

    My code:
    List<FrameworkElement> shapes = ShapeFileReader.Read(shapeInfo.Stream, dbfInfo.Stream);
    foreach (var shape in shapes)
    {
        this.informationLayer.Items.Add(shape);
          
        //how can I read the values from the dbf?
        ExtendedDataConverter converter = new ExtendedDataConverter();
    }

    sample of my dbf:
    STATEFP COUNTYFP    COUNTYNS    CNTYIDFP    NAME    NAMELSAD    LSAD    CLASSFP MTFCC   CSAFP   CBSAFP  METDIVFP    FUNCSTAT
    06  057 01682927    06057   Nevada  Nevada County   06  H1  G4020   472 46020       A
    06  099 00277314    06099   Stanislaus  Stanislaus County   06  H1  G4020       33700       A
    06  055 00277292    06055   Napa    Napa County 06  H1  G4020   488 34900       A
    06  105 00277317    06105   Trinity Trinity County  06  H1  G4020               A
    06  087 00277308    06087   Santa Cruz  Santa Cruz County   06  H1  G4020   488 42100       A
    06  045 00277287    06045   Mendocino   Mendocino County    06  H1  G4020       46380       A

    Thank you.
  2. CD
    CD avatar
    14 posts
    Member since:
    Mar 2011

    Posted 22 Apr 2011 Link to this post

    Figured it out - needed to cast the objects returned from the ShapeFileReader as a MapShape.
  3. DevCraft banner
Back to Top