Mapping

CODAP Forums CODAP Help Forum Mapping

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #7030 Score: 0

    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)

    #7040
    Bill Finzer
    Keymaster

    Hi 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.

     

    #7042

    Thank 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?

    #7043
    Bill Finzer
    Keymaster

    Hi 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

    #7044

    That helps a lot thanks Bill

    #7080
    Frieda Reichsman
    Participant

    Hi 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?

    #7087
    Bill Finzer
    Keymaster

    Hi 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.