This is a migrated thread and some comments may be shown as answers.

Get values from ShapeFile dbf

1 Answer 60 Views
Map
This is a migrated thread and some comments may be shown as answers.
CD
Top achievements
Rank 1
CD asked on 22 Apr 2011, 06:35 PM
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.

1 Answer, 1 is accepted

Sort by
0
CD
Top achievements
Rank 1
answered on 22 Apr 2011, 09:05 PM
Figured it out - needed to cast the objects returned from the ShapeFileReader as a MapShape.
Tags
Map
Asked by
CD
Top achievements
Rank 1
Answers by
CD
Top achievements
Rank 1
Share this question
or