embeddedproj

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package embeddedproj defines the format used to embed static projection data in the Cockroach binary. Is is used to load the data as well as to generate the data file (from cmd/generate-spatial-ref-sys).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(d Data, w io.Writer) error

Encode writes serializes Data as a gzip-compressed json.

Types

type Bounds

type Bounds struct {
	MinX float64
	MaxX float64
	MinY float64
	MaxY float64
}

Bounds stores the bounds of a projection.

type Data

type Data struct {
	Spheroids   []Spheroid
	Projections []Projection
}

Data stores all the spheroid and projection data.

func Decode

func Decode(r io.Reader) (Data, error)

Decode deserializes Data from a gzip-compressed json generated by Encode().

type Projection

type Projection struct {
	SRID      int
	AuthName  string
	AuthSRID  int
	SRText    string
	Proj4Text string
	Bounds    Bounds
	IsLatLng  bool
	// The hash of the spheroid represented by the SRID.
	Spheroid int64
}

Projection stores the metadata for a projection; it mirrors the fields in geoprojbase.ProjInfo but with modifications that allow serialization and deserialization.

type Spheroid

type Spheroid struct {
	Hash       int64
	Radius     float64
	Flattening float64
}

Spheroid stores the metadata for a spheroid. Each spheroid is referenced by its unique hash.

Jump to

Keyboard shortcuts

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