shp

package
v0.0.0-...-1f28478 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TypeNull indicates Null
	TypeNull = 0

	// TypePoint indicates Point
	TypePoint = 1

	// TypePolyline indicates Polyline
	TypePolyline = 3

	// TypePolygon indicates Polygon
	TypePolygon = 5

	// TypeMultiPoint indicates MultiPoint
	TypeMultiPoint = 8

	// TypePointZ indicates PointZ
	TypePointZ = 11

	// TypePolylineZ indicates PolylineZ
	TypePolylineZ = 13

	// TypePolygonZ indicates PolygonZ
	TypePolygonZ = 15

	// TypeMultiPointZ indicates MultiPointZ
	TypeMultiPointZ = 18

	// TypePointM indicates PointM
	TypePointM = 21

	// TypePolylineM indicates PolylineM
	TypePolylineM = 23

	// TypePolygonM indicates PolygonM
	TypePolygonM = 25

	// TypeMultiPointM indicates MultiPointM
	TypeMultiPointM = 28

	// TypeMultiPatch indicates MultiPatch
	TypeMultiPatch = 31
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BBox

type BBox struct {
	MinX, MinY, MaxX, MaxY float64
}

BBox is the bounding box for an associated shape.

type Header struct {
	FileLength int32
	ShapeType  ShapeType
	BBox       BBox
}

Header ...

type MData

type MData struct {
	MRange Range
	M      []float64
}

MData encapsulates all the optional data for M type shape records.

type MultiPatch

type MultiPatch struct {
	BBox           BBox
	NumberOfParts  int32
	NumberOfPoints int32
	Parts          []int32
	PartTypes      []PartType
	Points         []Point
	ZRange         Range
	Z              []float64
	MData
}

MultiPatch consists of a number of surface patches. Each surface patch describes a surface. The surface patches of a MultiPatch are referred to as its parts, and the type ofpart controls how the order of vertices of an MultiPatch part is interpreted.

func (*MultiPatch) Type

func (m *MultiPatch) Type() ShapeType

Type ...

type MultiPoint

type MultiPoint struct {
	BBox           BBox
	NumberOfPoints int32
	Points         []Point
}

MultiPoint represents a set of points.

func (*MultiPoint) Type

func (m *MultiPoint) Type() ShapeType

Type ...

type MultiPointM

type MultiPointM struct {
	BBox           BBox
	NumberOfPoints int32
	Points         []Point
	MData
}

MultiPointM represents a set of PointMs. Note that the M data is optional and missing values are specified with NaN.

func (*MultiPointM) Type

func (m *MultiPointM) Type() ShapeType

Type ...

type MultiPointZ

type MultiPointZ struct {
	BBox           BBox
	NumberOfPoints int32
	Points         []Point
	ZRange         Range
	Z              []float64
	MData
}

MultiPointZ represents a set of PointZs.

func (*MultiPointZ) Type

func (m *MultiPointZ) Type() ShapeType

Type ...

type Null

type Null struct{}

Null indicates a shape with no geometric data. Each feature type (point, line, polygon, etc.) supports nulls. It is valid to have points and null points in the same shapefile.

func (Null) Type

func (n Null) Type() ShapeType

Type ...

type PartType

type PartType int32

PartType ...

const (
	// TriangleStrip indicates the part is a linked strip of triangles,
	// where every vertex (after the first two) completes a new triangle.
	// A new triangle is always formed byconnecting the new vertex with
	// its two immediate predecessors.
	TriangleStrip PartType = 0

	// TriangleFan indicates the part is a linked fan of triangles,
	// where every vertex (after the first two) completes a new triangle.
	// A new triangle is always formed byconnecting the new vertex with
	// its immediate predecessor and thefirst vertex of the part
	TriangleFan PartType = 1

	// OuterRing indicates the part is the outer ring of a polygon.
	OuterRing PartType = 2

	// InnerRing indicates the part is a hole in a polygon.
	InnerRing PartType = 3

	// FirstRing indicates the part is the first ring of a polygon of
	// unspecified type.
	FirstRing PartType = 4

	// Ring indicates the part is a ring of a polygon of unspecified type.
	Ring PartType = 5
)

type Point

type Point struct {
	X, Y float64
}

Point consists of a pair of double-precision coordinates in the order X,Y.

func (*Point) Type

func (p *Point) Type() ShapeType

Type ...

type PointM

type PointM struct {
	X, Y, M float64
}

PointM is a Point plus a measure M.

func (*PointM) Type

func (p *PointM) Type() ShapeType

Type ...

type PointZ

type PointZ struct {
	X, Y, Z, M float64
}

PointZ is a triplet of double-precision coordinates in the order X,Y,Z, plus a measure.

func (*PointZ) Type

func (p *PointZ) Type() ShapeType

Type ...

type Polygon

type Polygon struct {
	BBox           BBox
	NumberOfParts  int32
	NumberOfPoints int32
	Parts          []int32
	Points         []Point
}

Polygon consists of one or more rings. A ring is a connected sequence of four or more points that form a closed, non-self-intersecting loop. A polygon may contain multiple outer rings. The order of vertices or orientation for a ring indicates which side of the ring is the interior of the polygon. The neighborhood to the right of an observer walking along the ring in vertex order is the neighborhood inside the polygon. Vertices of rings defining holes in polygons are in a counterclockwise direction. Vertices for a single, ringed polygon are, therefore, always in clockwise order. The rings of a polygon are referred to as its parts.

func (*Polygon) Type

func (p *Polygon) Type() ShapeType

Type ...

type PolygonM

type PolygonM struct {
	BBox           BBox
	NumberOfParts  int32
	NumberOfPoints int32
	Parts          []int32
	Points         []Point
	MData
}

PolygonM is a Polygon with optional measure (M) data. Missing M data is specified as NaN.

func (*PolygonM) Type

func (p *PolygonM) Type() ShapeType

Type ...

type PolygonZ

type PolygonZ struct {
	BBox           BBox
	NumberOfParts  int32
	NumberOfPoints int32
	Parts          []int32
	Points         []Point
	ZRange         Range
	Z              []float64
	MData
}

PolygonZ represents a polygon in the order X,Y,Z with optional associated measure (M) data. Missing M data is indicated with NaN.

func (*PolygonZ) Type

func (p *PolygonZ) Type() ShapeType

Type ...

type Polyline

type Polyline struct {
	BBox           BBox
	NumberOfParts  int32
	NumberOfPoints int32
	Parts          []int32
	Points         []Point
}

Polyline is an ordered set of vertices that consists of one or more parts. A part is a connected sequence of two or more points. Parts may or may not be connected to one another. Parts may or may not intersect one another.

func (*Polyline) Type

func (p *Polyline) Type() ShapeType

Type ...

type PolylineM

type PolylineM struct {
	BBox           BBox
	NumberOfParts  int32
	NumberOfPoints int32
	Parts          []int32
	Points         []Point
	MData
}

PolylineM is a Polyline with optional measure (M) data. Missing M data is specified as NaN.

func (*PolylineM) Type

func (p *PolylineM) Type() ShapeType

Type ...

type PolylineZ

type PolylineZ struct {
	BBox           BBox
	NumberOfParts  int32
	NumberOfPoints int32
	Parts          []int32
	Points         []Point
	ZRange         Range
	Z              []float64
	MData
}

PolylineZ represents a polyline in the order X,Y,Z with optional associated measure (M) data. Missing M data is indicated with NaN.

func (*PolylineZ) Type

func (p *PolylineZ) Type() ShapeType

Type ...

type Range

type Range struct {
	Min, Max float64
}

Range ...

type Reader

type Reader struct {
	Header
	// contains filtered or unexported fields
}

Reader ...

func NewReader

func NewReader(r io.Reader) (*Reader, error)

NewReader ...

func (*Reader) Next

func (r *Reader) Next() (Shape, error)

Next ...

type Shape

type Shape interface {
	Type() ShapeType
}

Shape ...

type ShapeType

type ShapeType int32

ShapeType is an enum that specifies the type of the associated Shape.

func (ShapeType) String

func (s ShapeType) String() string

Jump to

Keyboard shortcuts

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