Vector Data
Pre-requisites: Installing QGIS, Is Spatial Special?
Objectives:
- Understand the difference between a raster and a vector dataset.
- Recognize a few spatial data formats.
Vector
Vector data uses features (features are usually points, lines or polygons) to represent discrete phenomena in the real world. For example, a vector data file might include a river represented by a line which is assigned a value. For data which is associated with discrete entities like countries, landmarks, roads, etc. vector data is the way to go.
Vector Data Types
The Geometry Object Model from the Simple Features for SQL specification[^1]:
This structure allowed developers to rely on a standard system for storing spatial data types and representing the relationships between different spatial data types.
Some of the most used spatial data types are:
- Point
- A Point is a 0-dimensional geometric object and represents a single location in coordinate space. A Point has an x-coordinate value, and a y-coordinate value. If called for by the associated Spatial Reference System, it may also have coordinate values for z and m.
- LineString
- A linestring is a Curve with linear interpolation between Points. Each consecutive pair of points defines aLine Segment. A line is a LineString with exactly 2 Points. A Linear Ring is a LineString is a LieString that is both closed and simple. A linestring is a series of connected points. These points act as vertices or nodes and are connected by curves. Each curve is assigned a start point and end point whcih represents the cardinality of the linestring. This cardinality is used to designate an order from the starting point to the end point.
- Polygon
- A Polygon is a planar Surface defined by 1 exterior boundary and 0 or more interior boundaries. Each interior boundary defines a hole in the Polygon. Polygons are topologically closed. THe boundary of a Polygon consists of a set of LinearRings that make up its exterior and interior boundaries. No two Rings in the boundary cross and the Rings in the boundary of a Polygon may intersect but only as a tangent. A series of connected line strings
Data formats
- Shapefile: Stores point, line, and polygon data. This file type is actually made up of a collection of files with the following endings: These are mandatory: .shp, .shx, .dbf There are many others which are optional, including the important .prj file that describes the projection information for that data.
- Geodatabase: Esri proprietary spatial database. Very easy to load data into, not so easy to extract.
- GeoJSON: Encodes points, lines, and polygons (and collections of those) along with information about them using JSON (JavaScript Object Notation). This format is popular for web maps.