¿Geopandas?
Geopandas enables the use and manipulation of geospatial data in Python. It extends the common datatype used in pandas to allow for the many and unique geometric operations: GeoSeries and GeoDataFrame. Geopandas is also built on top of shapely for its geometric operation; its underlying datatype allows Geopandas to run blazingly fast and is appropriate for many machine learning pipelines that require large geospatial datasets.
Instalation
Following steps:
1. create new environment
conda creare -name new_env
2. Activate new environment
conda activate new_env
3. Install package
conda install -c conda-forge geopandas
Geopandas data types
Shapefile (.shp): vector data that stores geospatial information such as topology, shape geometry, coordinate etc
GeoJSON (.geojson): geospatial information and relevant characteristics (object or string)
Finally, Geopandas creates an additional geometry column

Coordinate Reference Systems (crs)
The coordinate reference systems tell us how GeodataFrame o GeoSeries relate to places on Earth
relevant operations: setting a projection and re-projecting
setting projection: geopandas.read_file() most of time includes projection information. Check using "Geoseries.crs" If GeoDataframe does not include projection, hence use data["geometry"].set_crs(epsg=4326) for WGS-84.
WGS-84:
The Global Positioning System uses the World Geodetic System (WGS84) as its reference coordinate system. It's made up of a reference ellipsoid, a standard coordinate system, altitude data, and a geoid
Reprojecting:
In somes cases, due to distortions in bidimensional plane and your application of geospatial data, re-projection is required.
A commonly used default is Universal Transverse Mercator (UTM)
Covid Data
Public Health Centers Data
Types and classification public centers
We focus on Postas médicas and Hospitales
code2 (Type)
ESTABLECIMIENTO DE SALUD SIN INTERNAMIENTO: 1
SERVICIO MÉDICO DE APOYO: 2
ESTABLECIMIENTO DE SALUD CON INTERNAMIENTO: 3
code1 (Clasification)
ATENCION PRE HOSPITALARIA: 1
CENTROS DE ATENCION PARA DEPENDIENTES A SUSTANCIAS PSICOACTIVAS Y OTRAS DEPENDENCIAS: 2
CENTROS DE SALUD CON CAMAS DE INTERNAMIENTO,CENTROS DE SALUD CON CAMAS DE INTERNAMIENTO: 3
CENTROS DE SALUD O CENTROS MEDICOS: 4
CENTROS DE SALUD O CENTROS MEDICOS,CENTROS DE SALUD O CENTROS MEDICOS: 5
CENTROS DE VACUNACION: 6
CENTROS MEDICOS ESPECIALIZADOS: 7
CONSULTORIOS MEDICOS Y DE OTROS PROFESIONALES DE LA SALUD: 8
ESTABLECIMIENTOS DE RECUPERACION O REPOSO: 9
HEMODIALISIS: 10
HOSPITALES O CLINICAS DE ATENCION ESPECIALIZADA: 11
HOSPITALES O CLINICAS DE ATENCION GENERAL: 12
INSTITUTOS DE SALUD ESPECIALIZADOS: 13
MEDICINA FISICA,REHABILITACION: 14
PATOLOGIA CLINICA: 15
PATOLOGIA CLINICA,ANATOMIA PATOLOGICA: 16
PATOLOGIA CLINICA,DIAGNOSTICO POR IMAGENES: 17
POLICLINICOS: 18
PUESTOS DE SALUD O POSTAS DE SALUD: 19
PUESTOS DE SALUD O POSTAS DE SALUD,PUESTOS DE SALUD O POSTAS DE SALUD: 19
SERVICIO DE TRASLADO DE PACIENTES: 20
SERVICIO DE TRASLADO DE PACIENTES,ATENCION DOMICILIARIA: 21
SERVICIO DE TRASLADO DE PACIENTES,ATENCION DOMICILIARIA,ATENCION PRE HOSPITALARIA: 22
SERVICIO DE TRASLADO DE PACIENTES,ATENCION PRE HOSPITALARIA: 23
CENTROS DE SALUD CON CAMAS DE INTERNAMIENTO: 24
Shape File
Merge: Covid Data & Shapefile
Plot covid infection at disctrict level
Get Centroid
Add District Names in Centroid
Covid y Postas
Hospitales Públicos y Postas Médicas
Relative Size of Markers from panda series
Select Districts
Limits - Boarders
ArcGis Operations in Geopandas
Get Centroids
Get the centroids of each geometry (district).
Proyecting from epsg = 4326 to bidimensional epsg = 24891
Then, we reproject again the centroids to the original CRS.
Intersection
Check CRS
We found that geolocation is recognized by google maps. We set the CRS that correspond to google maps.
Find Ubigeo for each point
Aggregation
We have shapefiles at district levels. It is possible to aggregate districts at Department or Province level.
Checking CRS
Plots with different CRS
Check CRS
Reproject CRS
References:
Geopandas
https://geopandas.org/en/stable/docs/user_guide/set_operations.html
https://geopandas.org/en/stable/docs/user_guide/aggregation_with_dissolve.html
https://geopandas.org/en/stable/docs/user_guide/data_structures.html
https://www.kaggle.com/imdevskp/geopandas
Coordinate Reference System
https://geopandas.org/en/stable/docs/user_guide/projections.html
Types of projections
Universal Transverse Mercator (UTM)
https://manifold.net/doc/mfd9/universal_transverse_mercator_projection.htm