Guides
We provide learning paths for best guidance leveling up your Geospatial Intelligence skills.
Learning path for geoprotests
Analyze the broadcasted news related to protests, and identify hot- and cold spots.
Ramp up your development environment
Setup your development environment and start with the first tutorial activating your Geospatial Intelligence skills. You will learn how to analyse the broadcasted news of the last 24 hours.
We are ging to use the ArcGIS API for Python which enables access to ready-to-use maps and curated geographic data from Esri and other authoritative sources, and works with your own data as well. It integrates well with the scientific Python ecosystem and includes rich support for Pandas and Jupyter notebook.
Step 1: Create a dedicated environment
Choose your favourite enironment e.g. conda or pip and create a dedicated environment. Enter the following at the prompt:
Using conda:
conda create -n geoint
Activate the dedicated environment:
conda activate geoint
Using pipenv:
python -m venv geoint
Activate the dedicated environment:
Using pipenv on Linux:
source geoint/bin/activate
Using pipenv on Windows:
geoint/Scripts/activate
Step 2: Install and Setup packages
The arcgis package is much more restrictive than our georapid package. We start setting up arcgis first. Follow the detailed steps at: Install and Setup.
The georapid package only supports pipenv. You can install any pip package from an activated conda environment, too. Enter the following at the prompt:
pip install georapid
The default factory implementation reads the API key using the environment.
You need to set the environment variable x_rapidapi_key
containing your Rapid API key.
After you installed the georapid and arcgis package, you need to verify it.
Note
Make sure you set the environment variable x_rapidapi_key
.
Otherwise, the default factory implementation will raise a ValueError
.
Step 3: Verify your environment
Navigate to the directory you want to work in. Start a new Juypter notebook instance:
jupyter notebook
Create new notebook named Mapping Protests
.
Add the following imports and execute the cell:
from arcgis import GIS
from arcgis.features import FeatureSet
from georapid.client import GeoRapidClient
from georapid.factory import EnvironmentClientFactory
from georapid.formats import OutFormat
from georapid.protests import aggregate
Create a client instance:
host = "geoprotests.p.rapidapi.com"
client: GeoRapidClient = EnvironmentClientFactory.create_client_with_host(host)
Warning
The host
parameter must target the specific host like "geoprotests.p.rapidapi.com"
.
Furthermore, the factory directly access os.environ['x_rapidapi_key']
and uses the specified API key as a header parameter.
Otherwise, georapid.factory.EnvironmentClientFactory.create_client_with_host()
will raise a ValueError
.
Connect to ArcGIS Online anonymously and display a map view:
gis = GIS()
world_map = gis.map()
world_map