CODAP › Forums › CODAP Help Forum › Opening a GeoJSON file in an existing CODAP file
Tagged: boundaries, mapping, merging in GeoJSON files
- This topic has 9 replies, 3 voices, and was last updated 1 year, 1 month ago by traci_higgins@terc.edu.
-
AuthorPosts
-
traci_higgins@terc.eduParticipant
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
October 17, 2023 at 7:44 pm #7897Bill FinzerKeymasterHi 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
October 17, 2023 at 7:48 pm #7898Dan DamelinKeymasterAre 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.
October 17, 2023 at 7:58 pm #7899traci_higgins@terc.eduParticipantWhen 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
October 17, 2023 at 8:04 pm #7900Dan DamelinKeymasterDefinitely 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.
October 17, 2023 at 8:26 pm #7901Bill FinzerKeymasterHi 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
October 17, 2023 at 8:28 pm #7902Dan DamelinKeymasterFYI, there is this nice help page on joining tables:
https://codap.concord.org/help/work-tables/join-two-tables- This reply was modified 1 year, 2 months ago by Dan Damelin.
October 17, 2023 at 9:10 pm #7904traci_higgins@terc.eduParticipantThat 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
October 18, 2023 at 1:16 pm #7905Dan DamelinKeymasterThe 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.
November 3, 2023 at 2:05 pm #7933traci_higgins@terc.eduParticipantThank you for all of the help. Works beautifully now.
Traci
-
AuthorPosts
- The forum ‘CODAP Help Forum’ is closed to new topics and replies.