Classes 18 and 20 – Mapping

Overview

Mapping is a critical part of earth sciences.  A lot of people will use google maps and ArcGIS for their mapping.  These are great tools. What i am also learning is that Python has a lot of tools within it that makes mapping very easy. Plus you can make professional looking maps.  Plus if you have multiple parameters in your pandas dataframe it is easy to loop and plot them all.  This is a new mapping segment as I changed what I used to do to update it and help us make publishable maps. I am still organizing so here is a list of files we will be using.

Files.

Mapping Homework.

Due- Monday 8, 2024

  • Map 1.  Make a worldwide map with 5 places you like to visit marked with points and labeled.  To do this.  Make an excel sheet and then read in the excel sheet and map it.  Choose a projection and type of map you like.   You need to read your data from a file.
  • Map 2.  The temperature on the day were you born with a star showing where you were born and a title that correctly converts the time units to the date.
  • Bonus 10%.  Make a map in folium.  Here is the Folium pdf that is in the mapping folder (Map3-Bonus-Folium-contextilly).  Take one of your 5 places from map 1.  Find 5 places in that location you want to visit.  Using an excel file for your data make a folium map showing those 5 new places you are going to visit in that location.  Make sure to name each place in the popup/circle on the folium map.   For example if you wanted to visit the twin cities in Minnesota you could make a map with the Mall of America, St Anthony Falls Lab etc,.
  • For the homework you need to turn in each excel file and the html file for folium.

40 thoughts on “Classes 18 and 20 – Mapping

  1. The visualizing of map and the Mapping tool really amazing! However, it was a challenge to update the package. Maybe it would help to have the update as an assignment before and the class, and we can get help during the class to trobuleshot.

  2. I thought that learning about how to create different kinds of maps was super useful prior to our final projects as I noticed that many students chose to visualize geographically where their data came from.

  3. I found this class really helpful when working on my final project! I also liked learning how to make an interactive folium map rather than just using shape files!

  4. Mapping was one of the most fun classes to me! I know a bit of GIS so it was cool to see how similar displays are generated across platforms. I do wonder about Python’s utility for mapping: is there anything Python can do better than the Arc suite? I know in ArcMap you can apply scripts written in Python to do tools, so maybe it would be more useful to have a class on Python that can be cross-applied to ArcGIS! But for people with no GIS background, that could be confusing too.

  5. I was amazed by Folium and how powerful of a tool it is. I’ve even showed my maps to some of my friends studying computer science and they were in awe of what we are learning in this class!

  6. I found a way to make the labels for points offset different than the one you provide in the notebook. I was frustrated with how the notebook solution, you move the points rather than the labels:(x,y=m(df.Longitude.values***-9.0***,df.Latitude.values)

    However, if you instead of using ax.text use ax.annotate:

    ax.annotate(textstr,(tx,ty),fontsize=8,***textcoords=”offset points”,xytext=(10,0)***,bbox=props)

    the labels are offset from the points according to the xytext coordinates you set.

  7. This assignment was super challenging for me. I think that mapping is one of the most important things in environmental science. It helps illustrate different environmental factors. I think the mapping questions were a little vague and I could have benefitted from a little more direction with how to map specific things. Google tiles were difficult to work with, but they can be used in the future, so this was a good way to experiment.

  8. This was one of the most fun yet most challenging packets of the class so far. It took me a good 20 minutes just to get Basemap working on my computer but the first time I saw the graphic depiction of the earth’s map (in full real world colors) I was awestruck. I feel a little more guidance would be helpful towards the beginning of the packet especially around how to zoom in on particular areas of the map but a little trial and error was all it took.

  9. This was one of my favorite classes. Mapping is super useful (especially in environmental data analysis), and believe I learned the basic components of how to map using python. I wish the basemap had worked more smoothly, but besides that, this class was great.

  10. When making the graph of CO2 by state for the US, it would have been helpful to know that any data plotted using a colorbar needs to be scaled. I know we learned how to do it in class, but I didn’t realize that this applied to any data, and not just percentages, because of the way that colorbar coding works.

  11. This was one of my favorite parts of class – learning how to make maps with data within them was so fascinating, as they’re such valuable tools in climate science. The only part of this class that didn’t go very smoothly was the downloading of basemap and the other interfaces we needed to do mapping – I think that class could have been more effective if we’d come in with the necessary things downloaded ahead of time.

  12. This was my favorite class, I really liked what we were able to make. I wish we spent a bit more time on it and when over more how we could do our own projects if we wanted to do a specific area. For example, where would I download information like we did to make the congressional districts in the US but for other maps? I also felt like there was just so much information in the packet it would have been nice to have two classes.

  13. I really enjoyed this section of python. I thought that making the maps was fun and allowed a lot of customization so that we could change it up how we wanted. I also thought the two different python maps that we did were both great and useful for the class. Folium maps allowed for an interactive experience and I also preferred it for local areas but the other type of map was great for broader areas. Overall the classwork was easy to follow and helpful and the homework was doable and fun.

  14. I really enjoyed learning this notebook. I thought that the concepts tied the class together and were very relatable to every day life. The Google Ties were buggy but overall I thought the class was really fun.

  15. This class was super useful for because I already do a lot of mapping for other classes. It really showed me how useful python is for certain kinds of maps. For example, Python would be a better tool to use instead of ArcMap for mapping out Indices of climate data. The compatibility that it has with large datasets makes it a good tool for mapping scientific data.

  16. I really liked this unit because it was so visually rewarding. As a visual learner, I was particularly excited and motivated by seeing my maps change bit by bit depending on what I changed in the code. The color-map gradient was also fun to play with!

  17. This was an awesome class! Making the maps was really satisfying and made my feel like I could do a lot more with python. I definitely felt really accomplished and like everything was coming together. That being said there were really difficult moments and it was hard to feel like I could retain everything that I had been learning and apply it to this new topic and still figure out some things on my own. All in all I really enjoyed working with the maps.

  18. This class was very fun and homework was incredibly enjoyable. I see the comments about bugs due to tiles being used but for 2017 all these issues were resolved very well. The very hard part for me was to get the mapping packages or libraries to get working before I could map anything. My computer could not read it in and I had to uninstall anaconda two times to get folium to even work but once it was all running, the class became very intuitive to me.
    The power of looping was clear too as we could go through hundreds of GPS coordinates and plot them with just a few lines of code. I came back to the folium and mapping components for my final poster and feel like I would find it incredibly useful in the future. I am learning GIS as well so I am very excited how I could use Python script in GIS for better results.

  19. I though learning to make maps was useful specially of you have all your data and you want a quick map on where things are. However, I found this assignment to be the most frustrating one. my kernel keep dying all the time i used google tile but also OSM or the other one you suggested but I was even able to see if my code was ok there two maps that i though the code was good but i was never able to pot them without the kernel during every two seconds. I found the first part of this notebook on converting the long and lat into the values we needed to plot was extremely helpful and hoping to apply that in other projects.

  20. Although I had a few problems with GoogleTiles and this was a challenging assignment, I thought it was really cool! I didn’t realize this was something that we’d be exploring on python so it was really exciting. I think the only annoying problems with this class other than Googletiles was also inputting the data because when I was trying to code I realized my data was not in the correct format.

  21. I thought this was really fun, I guess because I love maps because I love Earth Science. My critique is that we got introduced to a lot of stuff that we didn’t get to practice much in this lesson. An example is using Cartopy. I still don’t really have a sense for what Cartopy is. I’m also a little confused about what kind of thing it is, such that we needed to plug something into terminal to get/use it. I would have liked more examples of/practice with this kind of thing. I understand that might be a lot to ask given that this is just one class for people who have never coded before. To be a little more specific, there were commands that I think were based in Cartopy that I never really got a handle on why we used them. But that is the kind of thing that I gained appreciation of through repetition and variation of the other things we learned, so if it were between getting exposed to Cartopy but not quite understanding it, and not getting exposed at all, I would choose exposure.

  22. I had a lot of confusion with this assignment that was difficult to resolve. I think that a visual example of what we were shooting for, especially regarding the “around the world” path, might have made it easier to understand what we were trying to achieve. I found that figuring out how to label and move the label was useful and challenging. Also, it would be helpful to discuss how we should format the excel document versus what formatting/editing is best done within python.

  23. While I agree with some of the comments that google tiles (especially when you try for a higher resolution) can be buggy, I think it is important to keep mapping in the curriculum. Mapping shows us the power of python beyond what we have usually done with strings and csv files and graphing regressions. It was a fun assignment, and now I know how to use maps in case I ever need to map something. But most importantly, it showed me that there are a lot of applications to what we are learning outside what we cover in class.

  24. This was definitely the most difficult assignment for me. Working with Google Tiles was difficult for me because the map took a very long time to generate the map even at a low resolution/zoom. I ended up using another module to complete the assignment.

  25. This was great—creating the maps was fun, and it was interesting to see how Python interfaces with GIS. The homework was also an interesting exercise, although I struggled a bit in establishing the appropriate upper right and lower left boundaries for the second map. Before landing on the right combination, the maps I produced would be of very strange shapes depending on which latitude and longitude values I entered. This was a long, iterative process and so I’m wondering if there is a more efficient way of establishing the boundaries. Also, is there a general rule of thumb for the maximum zoom level that should be used on the average computer? Based on trial-and-error, I established this to be around 12-13 in order to avoid crashing my browser.

  26. This was a very fun and straight-forward application of Python to mapping. You didn’t need a GIS background to learn basic mapping which is a plus. I think the only annoying aspects were that the data we inputted via google forms did not match, and while you did your best to explain how to fix columns to match en masse, this was wasn’t supposed to be the focus of the class and I think threw some people off because it was completely new also. That should belong in a totally separate lecture. I also did not totally love that labels overlapped and the only was around it was futzing with the image size–but this was still doable. Lastly, I think the google tiles being wonky was a bit frustrating but this was out of our (and your!) control.

  27. I had a lot of trouble with this section. The Google Tiles were particularly buggy and I had to restart Anaconda several times before I could actually load and graph my CSV file. This made setting the zoom level quite difficult as I would receive errors in between adjustments. Setting up the upper right and lower left corners was also a bit confusing as I chose to focus on a city with a negative latitude and longitude.

  28. I loved this class. I didn’t know that GIS was backed by python code- it was really cool for me to make GIS maps in ArcMap, and do a similar thing behind the scene with python.

    When you request the longitude and latitude of our homes and destinations I’d recommend you have a google doc that we all add to instead of a survey. We should have one example with the right format and everyones answers goes below- this way we avoid bugs or difficulty putting it in the right format once we read it in. However, the pages that showed how cleaned up the data was useful for future reference.

  29. This class was immensely helpful for me at work- this GitHub notebook in particular is one I go back to a lot and I love using OSM. This question sort of extends past course content, but anyone know how/if it’s possible to layer a shapefile over an OSM/Google Map tile?

  30. This was definitely my favorite section so far. It took a few extra steps and headaches for me to set up cartopy and to then understand how to use it, but once it all came together it was awesome. I have always loved maps and have always dreamed of being able to edit my own. This has made me want to learn GIS. I also was having issues using googletiles on the home work. They worked fine for the global map, but would not work when I was trying to zoom in on Iceland. OSMtile ended up working. Maybe google was having issues because its so far North?

  31. I really like this mapping exercise because it seems to be the most relevant to me as an Urban Studies major. The installation of Cartopy, however, took a really long time. Maybe next time you can send an email to students beforehand and ask them to install Cartopy prior to the class? That way, they would be able to focus on learning how to code the actual maps in class instead of spending time installing the program, which took quite a while!

  32. Mapping is so cool! I’ve been having a couple of bugs with GoogleTiles – sometimes it will show up as a blank white space instead of having the street view of the map. I’m not sure why this happens, but sometimes it will work and sometimes it won’t, without me changing any of my code.

Leave a Reply