Vector Data Processing using Python Tools

Encodings, Formats and Libraries

Overview

Teaching: 10 min
Exercises: 0 min
Questions
  • What are the common ways to encode vector geospatial data in Python, and how much is borrowed from broader encoding standards?

Objectives
  • Learn about common community standards (broader than Python) for vector data encoding, and how they’re implemented in core Python libraries.

  • Learn to transform from one encoding type to another. Learn the GeoJSON format and exchange encoding storage, including the __geo_interface__ method implemented across libraries.

Standard Geometry/Data Encodings

GeoJSON, __geo_interface__ method

GeoJSON Example:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [102.0, 0.5]
      },
      "properties": {
        "prop0": "value0",
        "prop1": 0
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [-90.0, 10.5]
      },
      "properties": {
        "prop0": "value3",
        "prop1": 3
      }
    }
  ]
}

GIS file formats, RDBMS

Standard encodings and libraries for projections, codes

Key Points