Skip to content

Instantly share code, notes, and snippets.

@francbartoli
Created April 14, 2020 16:40
Show Gist options
  • Save francbartoli/f4e62096333b007d2dd183ec6f5ecc42 to your computer and use it in GitHub Desktop.
Save francbartoli/f4e62096333b007d2dd183ec6f5ecc42 to your computer and use it in GitHub Desktop.
COVID-19 data loaded by GDAL
from osgeo import gdal
ds = gdal.OpenEx('CSV:/vsicurl/https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-regioni/dpc-covid19-ita-regioni.csv', gdal.OF_VECTOR, open_options=['X_POSSIBLE_NAMES=long', 'Y_POSSIBLE_NAMES=lat'])
lyr = ds.GetLayer(0)
f = lyr.GetNextFeature()
f.ExportToJson()
'{"type": "Feature", "geometry": {"type": "Point", "coordinates": [13.39843823, 42.35122196]}, "properties": {"data": "2020-02-24T18:00:00", "stato": "ITA", "codice_regione": "13", "denominazione_regione": "Abruzzo", "lat": 42.35122196, "long": 13.39843823, "ricoverati_con_sintomi": "0", "terapia_intensiva": "0", "totale_ospedalizzati": "0", "isolamento_domiciliare": "0", "totale_positivi": "0", "variazione_totale_positivi": "0", "nuovi_positivi": "0", "dimessi_guariti": "0", "deceduti": "0", "totale_casi": "0", "tamponi": "5", "note_it": "", "note_en": ""}, "id": 1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment