Documentation ¶
Index ¶
- type Box
- type Field
- type MultiPatch
- type MultiPoint
- type MultiPointM
- type MultiPointZ
- type Null
- type Point
- type PointM
- type PointZ
- type PolyLine
- type PolyLineM
- type PolyLineZ
- type Polygon
- type PolygonM
- type PolygonZ
- type Reader
- type SequentialReader
- type Shape
- type ShapeType
- type Writer
- type ZipReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box struct {
MinX, MinY, MaxX, MaxY float64
}
Box structure made up from four coordinates. This type is used to represent bounding boxes
func BBoxFromPoints ¶
BBoxFromPoints returns the bounding box calculated from points.
func (*Box) Extend ¶
Extend extends the box with coordinates from the provided box. This method calls Box.ExtendWithPoint twice with {MinX, MinY} and {MaxX, MaxY}
func (*Box) ExtendWithPoint ¶
ExtendWithPoint extends box with coordinates from point if they are outside the range of the current box.
type Field ¶
type Field struct { Name [11]byte Fieldtype byte Addr [4]byte // not used Size uint8 Precision uint8 Padding [14]byte }
Field representation of a field object in the DBF file
type MultiPatch ¶
type MultiPatch struct { Box Box NumParts int32 NumPoints int32 Parts []int32 PartTypes []int32 Points []Point ZRange [2]float64 ZArray []float64 MRange [2]float64 MArray []float64 }
MultiPatch consists of a number of surfaces patches. Each surface path descries a surface. The surface patches of a MultiPatch are referred to as its parts, and the type of part controls how the order of vertices of an MultiPatch part is interpreted.
func (MultiPatch) BBox ¶
func (p MultiPatch) BBox() Box
BBox returns the bounding box of the MultiPatch feature
type MultiPoint ¶
MultiPoint is the shape that consists of multiple points.
func (MultiPoint) BBox ¶
func (p MultiPoint) BBox() Box
BBox returns the bounding box of the MultiPoint feature
type MultiPointM ¶
type MultiPointM struct { Box Box NumPoints int32 Points []Point MRange [2]float64 MArray []float64 }
MultiPointM is the collection of multiple points with measures.
func (MultiPointM) BBox ¶
func (p MultiPointM) BBox() Box
BBox eturns the bounding box of the MultiPointM feature
type MultiPointZ ¶
type MultiPointZ struct { Box Box NumPoints int32 Points []Point ZRange [2]float64 ZArray []float64 MRange [2]float64 MArray []float64 }
MultiPointZ consists of one ore more PointZ.
func (MultiPointZ) BBox ¶
func (p MultiPointZ) BBox() Box
BBox eturns the bounding box of the MultiPointZ feature.
type Point ¶
type Point struct {
X, Y float64
}
Point is the shape that consists of single a geometry point.
type PolyLine ¶
PolyLine is a shape type that consists of an ordered set of vertices that consists of one or more parts. A part is a connected sequence of two ore more points. Parts may or may not be connected to another and may or may not intersect each other.
func NewPolyLine ¶
NewPolyLine returns a pointer a new PolyLine created with the provided points. The inner slice should be the points that the parent part consists of.
type PolyLineM ¶
type PolyLineM struct { Box Box NumParts int32 NumPoints int32 Parts []int32 Points []Point MRange [2]float64 MArray []float64 }
PolyLineM is the polyline in which each point also has a measure.
type PolyLineZ ¶
type PolyLineZ struct { Box Box NumParts int32 NumPoints int32 Parts []int32 Points []Point ZRange [2]float64 ZArray []float64 MRange [2]float64 MArray []float64 }
PolyLineZ is a shape which consists of one or more parts. A part is a connected sequence of two or more points. Parts may or may not be connected and may or may not intersect one another.
type Polygon ¶
type Polygon PolyLine
Polygon is identical to the PolyLine struct. However the parts must form rings that may not intersect.
type Reader ¶
type Reader struct { GeometryType ShapeType // contains filtered or unexported fields }
Reader provides a interface for reading Shapefiles. Calls to the Next method will iterate through the objects in the Shapefile. After a call to Next the object will be available through the Shape method.
type SequentialReader ¶
type SequentialReader interface { // Closer frees the resources allocated by the SequentialReader. io.Closer // Next tries to advance the reading by one shape and one attribute row // and returns true if the read operation could be performed without any // error. Next() bool // Shape returns the index and the last read shape. If the SequentialReader // encountered any errors, nil is returned for the Shape. Shape() (int, Shape) // Err returns the last non-EOF error encountered. Err() error }
SequentialReader is the interface that allows reading shapes and attributes one after another. It also embeds io.Closer.
func SequentialReaderFromExt ¶
func SequentialReaderFromExt(shp io.ReadCloser) SequentialReader
SequentialReaderFromExt returns a new SequentialReader that interprets shp as a source of shapes whose attributes can be retrieved from dbf.
type Shape ¶
type Shape interface { BBox() Box // contains filtered or unexported methods }
Shape interface
type ShapeType ¶
type ShapeType int32
ShapeType is a identifier for the the type of shapes.
const ( NULL ShapeType = 0 POINT ShapeType = 1 POLYLINE ShapeType = 3 POLYGON ShapeType = 5 MULTIPOINT ShapeType = 8 POINTZ ShapeType = 11 POLYLINEZ ShapeType = 13 POLYGONZ ShapeType = 15 MULTIPOINTZ ShapeType = 18 POINTM ShapeType = 21 POLYLINEM ShapeType = 23 POLYGONM ShapeType = 25 MULTIPOINTM ShapeType = 28 MULTIPATCH ShapeType = 31 )
These are the possible shape types.
type Writer ¶
type Writer struct { GeometryType ShapeType // contains filtered or unexported fields }
Writer is the type that is used to write a new shapefile.
func CreateFrom ¶
func CreateFrom(ws io.WriteSeeker, t ShapeType) (*Writer, error)
type ZipReader ¶
type ZipReader struct {
// contains filtered or unexported fields
}
ZipReader provides an interface for reading Shapefiles that are compressed in a ZIP archive.
func ReadZipFrom ¶
ReadZipFrom read zip file from io.Reader, zip file must contain only one shape file