Opening a GeoJSON file in an existing CODAP file

Tags:
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #7896 Score: 0

    I am trying to bring a GeoJSON file into a CODAP file that I have created with civic data from Karnataka. I would like to bring in the boundary data from the GeoJSON file but when I try to import the file with boundary info, the dataset I already had open disappears.  How do you drag two tables into the same CODAP document so that they can be merged?

     

    Thanks,

    Traci

    #7897
    Bill Finzer
    Keymaster

    Hi Traci,

    That sounds very strange! Unfortunately, the forum wouldn’t accept the two files you tried to upload. Perhaps you could send them to me in an email so I can try it out?

    Bill

    #7898
    Dan Damelin
    Keymaster

    Are you saying the entire CODAP document disappears and the browser opens your GeoJSON file?

    You should be able to import any number of datasets into a single CODAP document. Once you have two (or more) tables, you can drag an attribute from one table to a matching attribute on the other table to merge data between tables.

    If you haven’t tried it, perhaps try using the “Import” option from the CODAP menu on the upper left of the CODAP window.

    All of the imported tables should be available in the “tables” menu on the CODAP toolbar.

    #7899

    When I try to import the file with the boundary data into the document I am working on, I get this message: “Close current document without saving?”. When I bring in the new file CODAP closes what I was working on and starts fresh. There is clearly a step I am missing.

    Traci

    #7900
    Dan Damelin
    Keymaster

    Definitely sounds strange. I’ve imported GeoJSON files with no issue in the past into existing documents. The other thing to try would be to import the GeoJSON into a new CODAP doc and then drag in the other dataset. If you sent both files to Bill via email he can try to report back on what he found as well.

    #7901
    Bill Finzer
    Keymaster

    Hi again Traci,

    The problem is the name of the file. Change the suffix from ‘json’ to ‘geojson’. After I did that and dragged the file into your document, I got the desired boundary data, ready to be joined with the district level data.

    I believe that without the name change CODAP is attempting to treat the file as a different CODAP document rather than something to be imported. (Long ago, CODAP documents had the ‘json’ suffix which was later replaced with the ‘codap’ suffix.)

    Hope that helps and you have a successful join!

    Bill

    #7902
    Dan Damelin
    Keymaster

    FYI, there is this nice help page on joining tables:
    https://codap.concord.org/help/work-tables/join-two-tables

    #7904

    That did it! I changed the suffix and everything worked as hoped. My one last question is whether there is a way to get rid of the yellow highlighting?  I added my original table to the table with the boundary info, so now most of the columns are highlighted because they refer back to the original table (which is now hidden). I do see that one of our other DataExplorer tables has just the boundary data column high lighted. Would I need to merge them in the opposite direction if I wanted to minimize the yellow highlighting (just the boundary data). If I merged going in the opposite direction (to minimize the yellow highlighting), would that increase my chance of having issues with the mapping feature?

    Traci

    #7905
    Dan Damelin
    Keymaster

    The yellow highlighting is there because the data for each of those columns is using a formula to populate the cells for that attribute. You can eliminate the highlighting by clicking on the attribute name and selecting “Delete formula (keeping values)”. If you do this for all of those merged columns you can then delete the other table. In fact, it might be preferable to delete that other table if you have the geoJSON boundary definitions in both tables, as the maps will plot both sets of duplicate boundaries.

    #7933

    Thank you for all of the help. Works beautifully now.

    Traci

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