Select to view content in your preferred language

New Cartogram tool - keeping attributes

666
4
Jump to solution
06-08-2023 07:55 AM
Labels (2)
KatyAppleton1
Occasional Contributor II

Referring to this new tool : https://www.esri.com/arcgis-blog/products/arcgis-pro/mapping/graphical-cartograms-in-arcgis-pro/

I was able to use the tool to easily create a cartogram representing a certain value for a set of census areas. However, the resulting cartogram's attribute table only contains the standard fields (ObjectID, Shape, Length and Area) and the value I used to size the symbols (rounded to integer). This means there is no way to then colour the symbols, either by an attribute that already exists, or by using a table join to bring in external data.

The example in the blog article implies that some additional information was included when the cartogram was created, if only to colour the circles red or blue.

Can I keep more than one attribute for my cartogram symbols?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KevinMayall
Occasional Contributor III

Try adding these two lines:

Line 508: ARCPY.AddField_management(resObj, "ORIG_FID", "Long")

Line 520: row.setValue("ORIG_FID", o.id)

Then you'll have the original OID as "ORIG_FID" in the output, and you can join the input feature class on that.

 

Kevin

View solution in original post

0 Kudos
4 Replies
MrRamonG
Occasional Contributor

Hello Katy, It looks like in the Geoprocessing Environments tab, in Geodatabase Advanced, tab you can select Preserve Global IDs and Transfer Geodatabase Field Properties. Perhaps that's what you're looking for?

MrRamonG_1-1686237069430.png

 

Layer Slayer
0 Kudos
KatyAppleton1
Occasional Contributor II

Thanks for the reply but I just tested and this doesn't fix the issue. While my census data has a unique identifier for each zone, it is not a Global ID in the ArcGIS Pro technical sense, and Field Properties are not relevant.

(I was not aware of Global IDs but reviewed this page to confirm: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-global-ids.htm)

KevinMayall
Occasional Contributor III

Try adding these two lines:

Line 508: ARCPY.AddField_management(resObj, "ORIG_FID", "Long")

Line 520: row.setValue("ORIG_FID", o.id)

Then you'll have the original OID as "ORIG_FID" in the output, and you can join the input feature class on that.

 

Kevin
0 Kudos
KatyAppleton1
Occasional Contributor II

Thank you! I added those lines and was then able to join the original table to the output.

It would be great if the script did this out of the box or, even better, if the tool panel asked you to identify one or more existing attributes of the input layer to bring over to the cartogram, in addition to the one driving the symbol size. Is anyone at Esri listening?

0 Kudos