Introduktion till datamängden

Arbeta med geospatial data i Python

Joris Van den Bossche

Open source software developer and teacher, GeoPandas maintainer

Hantverksgruvedata från IPIS

IPIS: International Peace Information Service

Bild: Connormah, CC BY-SA 3.0, från Wikimedia Commons

Arbeta med geospatial data i Python

Hantverksgruvedata från IPIS

IPIS: International Peace Information Service Bild: G.A.O, public domain, från Wikimedia Commons

Arbeta med geospatial data i Python

Hantverksgruvedata från IPIS

Arbeta med geospatial data i Python

Geospatiala filformat

Läsa filer: geopandas.read_file("path/to/file.geojson")

Format som stöds:

  • ESRI Shapefile
    • En "fil" består av flera filer! (.shp, .dbf, .shx, .prj, ...)
  • GeoJSON
  • GeoPackage (.gpkg)
  • ...

& PostGIS-databaser!

Arbeta med geospatial data i Python

Skriva till geospatiala filformat

Skriva en GeoDataFrame till fil med metoden to_file():

# Writing a Shapefile file
geodataframe.to_file("mydata.shp", driver='ESRI Shapefile')

# Writing a GeoJSON file
geodataframe.to_file("mydata.geojson", driver='GeoJSON')

# Writing a GeoPackage file
geodataframe.to_file("mydata.gpkg", driver='GPKG')
Arbeta med geospatial data i Python

Nu kör vi en övning!

Arbeta med geospatial data i Python

Preparing Video For Download...