vector

package
v0.0.0-...-26dca7e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2024 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package vector implements geological features using a vectorial data model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	Name  string
	Type  Type
	Plate int // Plate ID

	// Temporal range of the feature
	// in years.
	Begin int64
	End   int64

	// Geographic coordinates of the feature
	Point   *Point
	Polygon Polygon
}

A Feature is a tectonic feature.

func DecodeGPML

func DecodeGPML(r io.Reader) ([]Feature, error)

DecodeGPML returns an slice of vector features from a GPML encoded file.

The GPML format is an implementation of XML for tectonic plates modelling, and is the main format used by GPlates software. For a formal description of the GPML format see GPlates GPML documentation.

func (Feature) Pixels

func (f Feature) Pixels(pix *earth.Pixelation) []int

Pixels return an slice with the ID of pixels in a pixelation that are part of a feature.

type Point

type Point struct {
	Lat float64
	Lon float64
}

A Point is a geographic point.

func ParsePoint

func ParsePoint(sLat, sLon string) (Point, error)

ParsePoint returns a point from an string pair that contains the latitude and longitude of a geographic point.

type Polygon

type Polygon []Point

A Polygon is an ordered collection of points that encloses an area.

func ParsePolygon

func ParsePolygon(points string) (Polygon, error)

ParsePolygon returns a polygon from a string that contains a list of coordinates (latitude and longitude) separated by spaces.

For example:

85.151499473643639 180
83.701321128178307 180
83.870575085724681 178.17567629054798
85.08306008527849 178.86696019920456
85.151499473643639 180

type Type

type Type string

Type is the type of a tectonic element.

const (
	Basin     Type = "basin"
	Boundary  Type = "plate boundary"
	Coastline Type = "coastline"

	// A polygon that represents a boundary
	// between continental and oceanic crust.
	Continent Type = "continental boundary"

	// A large portion of a continental plate
	// that has been relatively undisturbed
	// since the Precambrian era.
	Craton Type = "craton"

	Fragment Type = "continental fragment"

	// A generic or unclassified feature.
	Generic Type = "generic"

	// A present day surface expression of a mantle plume.
	HotSpot Type = "hotspot"

	// A volcanic arc that is formed from magma rising
	// from a subduction oceanic plate.
	IslandArc Type = "island arc"

	// An extensive region of basalts
	// resulting from flood basalt volcanism.
	LIP Type = "large igneous province"

	// A part of a plate boundary
	// that no longer exists.
	PaleoBoundary Type = "paleo-boundary"

	// A passive continental boundary
	// indicating the change between continental and oceanic crust.
	Passive Type = "passive continental boundary"

	// A large-scale structural feature
	// associated with continental collision.
	Suture Type = "suture"

	// A crust fragment formed on a tectonic plate
	// and accreted to crust lying on another plate.
	Terrane Type = "terrane"
)

Valid types of tectonic elements. This types are taken from the definitions of the GPML format (<https://www.gplates.org/docs/gpgim/>).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL