Adding data to an existing shapefile

124
0
01-15-2021 09:15 AM
Labels (2)
JamesRyseff1
New Contributor

I'm trying to visualize some data that has been calculated for each zip code in the United States using ArcGIS Pro. I've found a file published by the census bureau that has the outline of every zip code and I've been able to successfully use a ClassBreaksRenderer in conjunction with that shape file to visualize the data. The following code works for me:

Map theMap = new Map(Basemap.CreateLightGrayCanvas());
string zipBoundaryFilePath = @"C:\CensusData\cb_2017_us_zcta510_500k.shp";
ShapefileFeatureTable zipBoundaryShapeFile = await ShapefileFeatureTable.OpenAsync(zipBoundaryFilePath);
FeatureLayer zipBoundaryLayer = new FeatureLayer(zipBoundaryShapeFile);

SimpleLineSymbol outlineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, System.Drawing.Color.Black, 1);
List<ClassBreak> classBreakValues = new List<ClassBreak>
{
new ClassBreak("RED", "RED", 0, 200000, new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, System.Drawing.Color.Red, outlineSymbol)),
new ClassBreak("ORANGE", "ORANGE", 200000, 1000000, new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, System.Drawing.Color.Orange, outlineSymbol))
};

ClassBreaksRenderer theRenderer = new ClassBreaksRenderer("ALAND10", classBreakValues);

zipBoundaryLayer.Renderer = theRenderer;

theMap.OperationalLayers.Add(zipBoundaryLayer);

 

The problem I have is if I want to use data that wasn't included in the original shapefile. I've calculated a number of values for each zip code, but I can't seem to associate them with the data I've loaded from the shapefile. Is there any way to add additional attributes to a set of Features by joining with either a text file or a database table?

0 Kudos
0 Replies