Documentation ¶
Overview ¶
Package models provides common types modelled after entities in the ASTM standard.
Index ¶
Constants ¶
const (
// TimeFormatRFC3339 is the string used for RFC3339
TimeFormatRFC3339 = "RFC3339"
)
Variables ¶
var ( // ErrMissingSpatialVolume indicates that a spatial volume is required but // missing to complete an operation. ErrMissingSpatialVolume = errors.New("missing spatial volume") // ErrMissingFootprint indicates that a geometry footprint is required but // missing to complete an operation. ErrMissingFootprint = errors.New("missing footprint") )
Functions ¶
This section is empty.
Types ¶
type GeoCircle ¶
type GeoCircle struct { Center LatLngPoint RadiusMeter float32 }
GeoCircle models a circular enclosed area on earth's surface.
func GeoCircleFromSCDProto ¶
GeoCircleFromSCDProto converts a circle proto to a GeoCircle
func (*GeoCircle) CalculateCovering ¶
CalculateCovering returns the spatial covering of gc.
func (*GeoCircle) ToSCDProto ¶
ToSCDProto converts the GeoCircle to a proto
type GeoPolygon ¶
type GeoPolygon struct {
Vertices []*LatLngPoint
}
GeoPolygon models an enclosed area on the earth. The bounding edges of this polygon shall be the shortest paths between connected vertices. This means, for instance, that the edge between two points both defined at a particular latitude is not generally contained at that latitude. The winding order shall be interpreted as the order which produces the smaller area. The path between two vertices shall be the shortest possible path between those vertices. Edges may not cross. Vertices may not be duplicated. In particular, the final polygon vertex shall not be identical to the first vertex.
func GeoPolygonFromRIDProto ¶
func GeoPolygonFromRIDProto(footprint *ridpb.GeoPolygon) *GeoPolygon
GeoPolygonFromRIDProto convert proto to model object
func GeoPolygonFromSCDProto ¶
func GeoPolygonFromSCDProto(p *scdpb.Polygon) *GeoPolygon
GeoPolygonFromSCDProto converts a polygon proto to a GeoPolygon
func (*GeoPolygon) CalculateCovering ¶
func (gp *GeoPolygon) CalculateCovering() (s2.CellUnion, error)
CalculateCovering returns the spatial covering of gp.
func (*GeoPolygon) ToRIDProto ¶
func (gp *GeoPolygon) ToRIDProto() *ridpb.GeoPolygon
ToRIDProto converts GeoPolygon model obj to proto
func (*GeoPolygon) ToSCDProto ¶
func (gp *GeoPolygon) ToSCDProto() *scdpb.Polygon
ToSCDProto converts the GeoPolygon to a proto
type Geometry ¶
type Geometry interface { // CalculateCovering returns an s2 cell covering for a geometry. CalculateCovering() (s2.CellUnion, error) }
Geometry models a geometry.
type GeometryFunc ¶
GeometryFunc is an implementation of Geometry
func (GeometryFunc) CalculateCovering ¶
func (gf GeometryFunc) CalculateCovering() (s2.CellUnion, error)
CalculateCovering returns the result of invoking gf.
type LatLngPoint ¶
LatLngPoint models a point on the earth's surface.
func LatLngPointFromSCDProto ¶
func LatLngPointFromSCDProto(p *scdpb.LatLngPoint) *LatLngPoint
LatLngPointFromSCDProto converts a point proto to a latlngpoint
func PointFromRIDProto ¶
func PointFromRIDProto(pt *ridpb.LatLngPoint) *LatLngPoint
PointFromRIDProto convert proto to model object
func (*LatLngPoint) ToRIDProto ¶
func (pt *LatLngPoint) ToRIDProto() *ridpb.LatLngPoint
ToRIDProto converts latlngpoint model obj to proto
func (*LatLngPoint) ToSCDProto ¶
func (pt *LatLngPoint) ToSCDProto() *scdpb.LatLngPoint
ToSCDProto converts the LatLngPoint to a proto
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
Version represents a version, which can be supplied as a commit timestamp or a string.
func VersionFromString ¶
VersionFromString converts a version, typically provided from a user, to a Version struct.
func VersionFromTime ¶
VersionFromTime converts a timestamp, typically from the database, to a Version struct.
func (*Version) ToTimestamp ¶
ToTimestamp converts the version back its commit timestamp.
type Volume3D ¶
type Volume3D struct { // Maximum bounding altitude (meters above the WGS84 ellipsoid) of this volume. AltitudeHi *float32 // Minimum bounding altitude (meters above the WGS84 ellipsoid) of this volume. AltitudeLo *float32 // Projection of this volume onto the earth's surface. Footprint Geometry }
Volume3D is A three-dimensional geographic volume consisting of a vertically-extruded shape.
func Volume3DFromRIDProto ¶
Volume3DFromRIDProto convert proto to model object
func Volume3DFromSCDProto ¶
Volume3DFromSCDProto converts a vol3 proto to a Volume3D
func (*Volume3D) CalculateCovering ¶
CalculateCovering returns the spatial covering of vol3.
func (*Volume3D) ToRIDProto ¶
ToRIDProto converts Volume3D model obj to proto
type Volume4D ¶
type Volume4D struct { // Constant spatial extent of this volume. SpatialVolume *Volume3D // End time of this volume. EndTime *time.Time // Beginning time of this volume. StartTime *time.Time }
Volume4D is a Contiguous block of geographic spacetime.
func UnionVolumes4D ¶
UnionVolumes4D unions volumes and returns a volume that covers all the individual volumes in space and time.
func Volume4DFromRIDProto ¶
Volume4DFromRIDProto convert proto to model object
func Volume4DFromSCDProto ¶
Volume4DFromSCDProto converts vol4 proto to a Volume4D
func (*Volume4D) CalculateSpatialCovering ¶
CalculateSpatialCovering returns the spatial covering of vol4.
func (*Volume4D) ToRIDProto ¶
ToRIDProto converts Volume4D model obj to proto