1

This question already has an answer here:

I have a building dataset that shows areas of different building types ie. educational, medical, and residential.

How do I assign each type of building a numerical value so if I have 7 buildings that are medical type then it would show a value of 1 so I would have 7 rows of "1" in ArcMap?

marked as duplicate by PolyGeo arcgis-desktop Sep 25 '18 at 8:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Welcome to GIS SE! As a new user be sure to take the Tour to learn about our focussed Q&A format. For this try Summary Statistics followed by Join Field. – PolyGeo Sep 25 '18 at 7:27
  • In Attribute Table create a new column with an integer data type. Then choose Field Calculator with Python parser, where apply following statement for a Pre-Logic Script Code def !Building_Types!(value): if value = 'medical': return '1' if value = 'educational': return 'any_other_number' ... else: return 'n/a'. Then in a field for a numerical value type Building_Types (!Numbers!) – Taras Sep 25 '18 at 7:50
  • gis.stackexchange.com/a/82923/115 is the answer from the duplicate that I think provides an answer to your question almost identical to my comment above. – PolyGeo Sep 25 '18 at 8:31
  • @PolyGeo, I would doubt if it is a duplicate of Finding duplicate records in field using ArcGIS for Desktop?. – Taras Sep 25 '18 at 8:35
0

Best bet would be to add a field called "BType" in ArcMap and make it "Short". Then using the select by attributes function select from the field with the medical types.

Once all the features are selected as you would like them grouped, run the field calculator on the newly created "BType" field and give it a calue of "1".

I see you tagged "Excel", if you want to do this in Excel and ArcMap. Create a field called "B_ID" in ArcMap. Use the field calculator to and add the "OID" field "+1" to the field calculator, to ensure that each feature has a numeric ID.

Export this table to CSV.

Open this CSV in Excel and edit / group the values as are needed, ensuring you do not change the "B_ID" field. When you are done, save the table as a CSV and add it to ArcMap.

Use a table join and the "B_ID" field to bring the edited values back into your original buildings layer.

  • I hope you mean integer type field, e.g. Short. – FelixIP Sep 25 '18 at 7:41
  • Thanks for the responses! Keagan when running the field calculator is there a certain query i need to write to give it a value? – mncra7 Sep 25 '18 at 7:42
  • Also for excel any idea on how I would group? – mncra7 Sep 25 '18 at 7:42
  • Yes, short integer. With Excel you could run a VLookup to assign values based on a value. The Field Calculator you don't need anything fancy, but with the Select by Attributes you will need to create a query that meets your data needs. – Keagan Allan Sep 25 '18 at 7:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.