Introduction to the dataset
1. Introduction to the dataset
Welcome to the last chapter of this course on working with geospatial data in Python. In this chapter, we leave the Paris data behind us, and start with a brand new dataset on artisanal mining sites in Eastern Congo. We will use it to practice everything we have learnt up to now, and we will even pick up some new tricks along the way.2. Artisanal mining site data from IPIS
But let's start with introducing the data. We are going to use an open dataset from IPIS, the International Peace Information Service. They gathered data on artisanal mining sites in Congo, a country in Central Africa.3. Artisanal mining site data from IPIS
In Eastern Congo, there is a lot of mineral mining activity, including many artisanal mines. IPIS gathered data on the mining sites, the minerals being mined and the social and security situation.4. Artisanal mining site data from IPIS
IPIS provides an interactive web map, as well as an open dataset. The goal of this project is to better understand the role of those mines in the conflicts taking place in the region. Throughout the exercises in this chapter, we are going to limit ourselves to spatial analyses related to the location of the mines and the national parks in the region. But if you want to see more insight based on these very data and the social and security situation, you can follow this link to their open data tutorial.5. Geospatial file formats
Before diving into the data, let's spend a few words on geospatial file formats. Without explicitly mentioning it, you already encountered different file formats throughout the course while reading data with the read_file function in the exercises: shapefiles, geojson files and geopackage files. The first, the ESRI Shapefile, is currently the most used vector data format. However despite its popularity, it has some drawbacks. One of them, and an important aspect to be aware of, is that it is a multi-file format. So if you receive a shapefile, you actually get a set of files. And so, for example when copying a shapefile, make sure to copy all the files! Next, GeoJSON is a lightweight format based on JSON, and especially often used in web applications. GeoPackage is a relatively recent, open standard format with more advanced capabilities, and can be used in many cases as a modern (and better) alternative for shapefiles. Apart from those 3, there are of course many more vector file formats out in the wild. And in addition to files, GeoPandas also has functionality to read data from spatial databases such as PostGIS.6. Writing to geospatial file formats
GeoPandas can read geospatial file formats thanks the the GDAL library with the read_file function, but it can also write such files. This is done with the `to_file` method, as shown here. The first argument is the name of the resulting file, or a full path. In addition, you need to specify which file format you want to write using the "driver" keyword.7. Let's practice!
Let's now start with exploring the new datasets in the coming exercises.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.