Skip to main content

Geospatial basics

Wyvern scenes are rasters. Your field boundaries, sample points, and masks are vectors. Almost every analysis you'll do combines the two, so it's worth being clear on how they differ before moving on to hyperspectral imagery.

Vector data​

Vector data represents features as points, lines, and polygons, each stored as a list of coordinates. Roads, buildings, field boundaries, and sampling sites are all vectors. Because a vector feature is geometry rather than a grid of cells, it stays sharp at any zoom level, and it's small and quick to edit, reproject, and query. Each feature can also carry attributes, such as a field's crop type or a site's sample ID, which is what you colour or filter a map by.

Common formats are GeoJSON, GeoPackage, and shapefile.

Red outlines of grazing area polygons in Alberta, each labelled with its name, including Jumpingpound, Bragg Creek, Elbow, and McLean Creek.

Vector data: grazing area polygons in Alberta, labelled from each polygon's name attribute.

Raster data​

Raster data is a grid of cells, or pixels, each holding a value for one location on the ground. Elevation models, land cover maps, temperature grids, and every satellite image are rasters. A raster can have several layers, called bands, stacked over the same grid. A Dragonette scene has 23 or 31 of them, one per wavelength.

Rasters are larger than vectors and slower to process, and their detail is fixed by the pixel size. Zooming in on a 5.3 m pixel doesn't reveal anything smaller than 5.3 m. It just makes the square bigger.

Common formats are GeoTIFF, including the Cloud-Optimized GeoTIFF (COG) that Wyvern delivers, NetCDF, and HDF5. See hyperspectral image formats for more.

True colour satellite image of farmland in Germany: rectangular fields in greens, browns, and yellows, crossed by roads, with a small village in the centre.

Raster data: a true colour image of farmland in Germany. Every field boundary you can see is a pattern in the pixels, not a stored shape.

Using them together​

Most analyses use vectors to ask questions of rasters. You clip a scene to a field boundary, average an index inside each polygon, or pull a spectrum at each sample point. You can also go the other way and turn a raster result into vectors, for example by outlining every area where an index crosses a threshold. The water quality tutorial ends this way, exporting areas of high chlorophyll as a GeoJSON file you can load into any GIS.

Both kinds of data need to share a coordinate reference system before you combine them. Wyvern L2A scenes are delivered in the UTM zone that contains the scene, while most vector data you download will be in latitude and longitude (EPSG:4326). QGIS reprojects on the fly for display, but for analysis in code, reproject one to match the other first.

Field polygons outlined in red and labelled with crop types such as sugar beet, potato, maize, common wheat, and fallow, drawn over a satellite image of farmland and a village.

Vector crop-type polygons overlaid on a raster image. This pairing is how you get labelled training data for a classifier, or per-field statistics from an index.

More reading​

Intro to GIS and Spatial Analysis by Manuel Gimond

Colorado State GIS Basics