- This topic has 6 replies, 3 voices, and was last updated 2 years, 4 months ago by Bill Finzer.
-
AuthorPosts
-
travisweiland@gmail.comParticipant
I am trying to add some map boundaries to a dataset I have and everytime I go to do it with the lookup function CODAP crashes. Here is a link to the codap workspace https://codap.concord.org/app/static/dg/en/cert/index.html#shared=https%3A%2F%2Fcfm-shared.concord.org%2FY2W8sEH1JCxiYJhKSUaX%2Ffile.json and I attached the geojson file with the boundaries. the formula I have been using to add the boundaries to the existing dataset by creating a new attribute adn then ruing the following lookup function lookupByKey(“CMPD_Police_Divisions”, “boundary”, “DNAME”, CMPD_Division)
June 8, 2022 at 4:03 pm #7040Bill FinzerKeymasterHi Travis,
I believe the crashing behavior is caused by CODAP attempting to make 5000 boundaries, one for each case in Office_Traffic_Stops. The solution is to move CMPD_Division to a parent level and then apply your formula, resulting in 15 boundary values. (Actually only 13 since there seems to be one lookup mismatch.) I suspect that you really are interest in mapping the 5000 stops, though. Points with latitude and longitude would serve that purpose extremely well if you have that data. Here is a link to a revised document.
June 8, 2022 at 8:11 pm #7042travisweiland@gmail.comParticipantThank you!
Follow up question. If I want to map an attribute does it need to be at the same level as the boundaries? In other words if I wanted to see the average driver age for each district would I need to create that attribute myself at the same level as the boundaries or would CODAP do that if I drag and drop the attribute at the lower case level onto the map?
June 8, 2022 at 9:32 pm #7043Bill FinzerKeymasterHi Travis,
Yes, to use an attribute as a legend variable for a map, it does need to be at the same level as the point or boundaries. The reason for this is that if you attempt to use a lower level attribute, CODAP makes no assumption about what aggregate measure you want to display; e.g. a mean or median of numeric values, a modal category, etc. So, by creating an attribute at the same (or higher) level and giving that new attribute a formula to compute a measure, you specify what you want to use for coloration.
Hope that helps,
Bill
June 8, 2022 at 9:38 pm #7044travisweiland@gmail.comParticipantThat helps a lot thanks Bill
July 6, 2022 at 2:02 pm #7080Frieda ReichsmanParticipantHi Bill,
In the revised file you posted above, CMPD_Division has indeed been dragged to the left, but in addition, there is a new attribute, “Boundary,” right next to it. Where do the data in “Boundary” come from?
July 6, 2022 at 10:13 pm #7087Bill FinzerKeymasterHi Frieda,
I believe Travis gave me a link to the geojson file on the Web for the municipality boundaries and I “joined” them into the table. I moved them to the left so there would be one boundary for each municipality.
Bill
-
AuthorPosts
- You must be logged in to reply to this topic.