Documentation ¶
Index ¶
- Constants
- Variables
- type BinaryHeader
- func (h *BinaryHeader) Envelope() []float64
- func (h *BinaryHeader) EnvelopeType() envelopeType
- func (h *BinaryHeader) IsGeometryEmpty() bool
- func (h *BinaryHeader) IsStandardGeometry() bool
- func (h *BinaryHeader) Magic() [2]byte
- func (h *BinaryHeader) SRSId() int32
- func (h *BinaryHeader) Size() int
- func (h *BinaryHeader) Version() uint8
- type Content
- type CoordinateReferenceSystem
- type Extension
- type Extent
- type Feature
- type FeatureCollection
- type GeoPackage
- func (g *GeoPackage) AddGeomColumn(tableName, geomColumn, geomType string) error
- func (g *GeoPackage) AddSpatialIndex(tabelName, geomColumn string) error
- func (g *GeoPackage) AutoMigrate() error
- func (g *GeoPackage) AutoMigrateRelatedTables() error
- func (g *GeoPackage) Close() error
- func (g *GeoPackage) Exists() bool
- func (g *GeoPackage) GetExtent() (*Extent, error)
- func (g *GeoPackage) GetFeatureCollection(table_name string) (*FeatureCollection, error)
- func (g *GeoPackage) GetGeometryType(table_name string, column_name string) (string, error)
- func (g *GeoPackage) GetMaxZoom(table string) (int, error)
- func (g *GeoPackage) GetSpatialReferenceSystem(srs_id int) (SpatialReferenceSystem, error)
- func (g *GeoPackage) GetSpatialReferenceSystemCode(srs_id int) (string, error)
- func (g *GeoPackage) GetTile(table string, z int, x int, y int) ([]byte, error)
- func (g *GeoPackage) GetTileHeight(table string) (int, error)
- func (g *GeoPackage) GetTileMatrixSets() ([]TileMatrixSet, error)
- func (g *GeoPackage) GetTileMatrixSetsAsIterator() (*TileMatrixSetIterator, error)
- func (g *GeoPackage) GetTileMatrixSetsAsList() (*TileMatrixSetList, error)
- func (g *GeoPackage) GetTileWith(table string) (int, error)
- func (g *GeoPackage) GetVectorLayers() ([]VectorLayer, error)
- func (g *GeoPackage) GetVectorLayersAsList() (*VectorLayerList, error)
- func (g *GeoPackage) Init() error
- func (g *GeoPackage) InitSpatialRefSys() error
- func (g *GeoPackage) QueryInt(stmt string) (int, error)
- func (g *GeoPackage) Size() (int64, error)
- type Geometry
- type GeometryColumn
- type Metadata
- type MetadataReference
- type NullInt8
- type RTree
- type Relation
- type SQLiteSequence
- type SpatialReferenceSystem
- type TileMatrix
- type TileMatrixSet
- type TileMatrixSetIterator
- type TileMatrixSetList
- type VectorLayer
- type VectorLayerList
Constants ¶
const ( EnvelopeTypeNone = envelopeType(0) EnvelopeTypeXY = envelopeType(1) EnvelopeTypeXYZ = envelopeType(2) EnvelopeTypeXYM = envelopeType(3) EnvelopeTypeXYZM = envelopeType(4) EnvelopeTypeInvalid = envelopeType(5) )
Variables ¶
var Magic = [2]byte{0x47, 0x50}
Magic is the magic number encode in the header. It should be 0x4750
Functions ¶
This section is empty.
Types ¶
type BinaryHeader ¶
type BinaryHeader struct {
// contains filtered or unexported fields
}
BinaryHeader is the gpkg header that accompainies every feature.
func NewBinaryHeader ¶
func NewBinaryHeader(data []byte) (*BinaryHeader, error)
NewBinaryHeader decodes the data into the BinaryHeader
func (*BinaryHeader) Envelope ¶
func (h *BinaryHeader) Envelope() []float64
Envelope is the bounding box of the feature, used for searching. If the EnvelopeType is EvelopeTypeNone, then there isn't a envelope encoded and a search without an index will need to be preformed. This is to save space.
func (*BinaryHeader) EnvelopeType ¶
func (h *BinaryHeader) EnvelopeType() envelopeType
EnvelopeType is the type of the envelope that is provided.
func (*BinaryHeader) IsGeometryEmpty ¶
func (h *BinaryHeader) IsGeometryEmpty() bool
IsGeometryEmpty tells us if the geometry should be considered empty.
func (*BinaryHeader) IsStandardGeometry ¶
func (h *BinaryHeader) IsStandardGeometry() bool
IsStandardGeometery is the geometry a core/extended geometry type, or a user defined geometry type.
func (*BinaryHeader) Magic ¶
func (h *BinaryHeader) Magic() [2]byte
Magic is the magic number encode in the header. It should be 0x4750
func (*BinaryHeader) SRSId ¶
func (h *BinaryHeader) SRSId() int32
SRSId is the SRS id of the feature.
func (*BinaryHeader) Size ¶
func (h *BinaryHeader) Size() int
Size is the size of the header in bytes.
func (*BinaryHeader) Version ¶
func (h *BinaryHeader) Version() uint8
Version is the version number encode in the header.
type Content ¶
type Content struct { ContentTableName string `sql:"type:text" gorm:"column:table_name;unique;not null;primary_key"` DataType string `sql:"type:text" gorm:"column:data_type;not null"` Identifier string `sql:"type:text" gorm:"column:identifier;unique"` Description string `sql:"type:text" gorm:"column:description;default:''"` LastChange *time.Time `gorm:"column:last_change;not null"` MinX float64 `gorm:"column:min_x"` MinY float64 `gorm:"column:min_y"` MaxX float64 `gorm:"column:max_x"` MaxY float64 `gorm:"column:max_y"` SpatialReferenceSystemId int `sql:"type:integer REFERENCES gpkg_spatial_ref_sys(srs_id)" gorm:"column:srs_id"` }
type CoordinateReferenceSystem ¶
type CoordinateReferenceSystem struct { Type string `json:"type" bson:"type" yaml:"type" hcl:"type"` Properties map[string]interface{} `json:"properties" bson:"properties" yaml:"properties" hcl:"properties"` CoordinateReferenceSystem *CoordinateReferenceSystem `json:"crs,omitempty" bson:"crs,omitempty" yaml:"crs,omitempty" hcl:"crs"` }
type Extension ¶
type Extension struct { Table string `sql:"type:text" gorm:"column:table_name"` Column *string `sql:"type:text" gorm:"column:column_name"` Extension string `sql:"type:text" gorm:"column:extension_name;not null"` Definition string `sql:"type:text" gorm:"column:definition;not null"` Scope string `sql:"type:text" gorm:"column:scope;not null"` }
type Feature ¶
type Feature struct { Id interface{} `json:"id" bson:"id" yaml:"id" hcl:"id"` Type string `json:"type" bson:"type" yaml:"type" hcl:"type"` Properties map[string]interface{} `json:"properties" bson:"properties" yaml:"properties" hcl:"properties"` GeometryName string `json:"geometry_name" bson:"geometry_name" yaml:"geometry_name" hcl:"geometry_name"` Geometry Geometry `json:"geometry" bson:"geometry" yaml:"geometry" hcl:"geometry"` }
func NewFeature ¶
type FeatureCollection ¶
type FeatureCollection struct { Type string `json:"type" bson:"type" yaml:"type" hcl:"type"` TotalFeatures int `json:"totalFeatures" bson:"totalFeatures" yaml:"totalFeatures" hcl:"totalFeatures"` Features []Feature `json:"features" bson:"features" yaml:"features" hcl:"features"` CoordinateReferenceSystem *CoordinateReferenceSystem `json:"crs,omitempty" bson:"crs,omitempty" yaml:"crs,omitempty" hcl:"crs"` }
func NewFeatureCollection ¶
func NewFeatureCollection(features []Feature) FeatureCollection
func (FeatureCollection) ToJson ¶
func (fc FeatureCollection) ToJson() (string, error)
type GeoPackage ¶
func New ¶
func New(uri string) *GeoPackage
func (*GeoPackage) AddGeomColumn ¶
func (g *GeoPackage) AddGeomColumn(tableName, geomColumn, geomType string) error
AddGeomColumn geom type will be covert to upper case
func (*GeoPackage) AddSpatialIndex ¶
func (g *GeoPackage) AddSpatialIndex(tabelName, geomColumn string) error
AddSpatialIndex ..
func (*GeoPackage) AutoMigrate ¶
func (g *GeoPackage) AutoMigrate() error
func (*GeoPackage) AutoMigrateRelatedTables ¶
func (g *GeoPackage) AutoMigrateRelatedTables() error
AutoMigrateRelatedTables creates tables used by the related tables extension.
func (*GeoPackage) Close ¶
func (g *GeoPackage) Close() error
func (*GeoPackage) Exists ¶
func (g *GeoPackage) Exists() bool
func (*GeoPackage) GetExtent ¶
func (g *GeoPackage) GetExtent() (*Extent, error)
func (*GeoPackage) GetFeatureCollection ¶
func (g *GeoPackage) GetFeatureCollection(table_name string) (*FeatureCollection, error)
func (*GeoPackage) GetGeometryType ¶
func (g *GeoPackage) GetGeometryType(table_name string, column_name string) (string, error)
func (*GeoPackage) GetMaxZoom ¶
func (g *GeoPackage) GetMaxZoom(table string) (int, error)
func (*GeoPackage) GetSpatialReferenceSystem ¶
func (g *GeoPackage) GetSpatialReferenceSystem(srs_id int) (SpatialReferenceSystem, error)
func (*GeoPackage) GetSpatialReferenceSystemCode ¶
func (g *GeoPackage) GetSpatialReferenceSystemCode(srs_id int) (string, error)
func (*GeoPackage) GetTileHeight ¶
func (g *GeoPackage) GetTileHeight(table string) (int, error)
func (*GeoPackage) GetTileMatrixSets ¶
func (g *GeoPackage) GetTileMatrixSets() ([]TileMatrixSet, error)
func (*GeoPackage) GetTileMatrixSetsAsIterator ¶
func (g *GeoPackage) GetTileMatrixSetsAsIterator() (*TileMatrixSetIterator, error)
func (*GeoPackage) GetTileMatrixSetsAsList ¶
func (g *GeoPackage) GetTileMatrixSetsAsList() (*TileMatrixSetList, error)
func (*GeoPackage) GetTileWith ¶
func (g *GeoPackage) GetTileWith(table string) (int, error)
func (*GeoPackage) GetVectorLayers ¶
func (g *GeoPackage) GetVectorLayers() ([]VectorLayer, error)
func (*GeoPackage) GetVectorLayersAsList ¶
func (g *GeoPackage) GetVectorLayersAsList() (*VectorLayerList, error)
func (*GeoPackage) Init ¶
func (g *GeoPackage) Init() error
func (*GeoPackage) InitSpatialRefSys ¶
func (g *GeoPackage) InitSpatialRefSys() error
InitSpatialRefSys ..
func (*GeoPackage) Size ¶
func (g *GeoPackage) Size() (int64, error)
type Geometry ¶
type Geometry struct { Type string `json:"type" bson:"type" yaml:"type" hcl:"type"` Coordinates interface{} `json:"coordinates" bson:"coordinates" yaml:"coordinates" hcl:"coordinates"` }
func NewPolygon ¶
type GeometryColumn ¶
type GeometryColumn struct { GeometryColumnTableName string `gorm:"column:table_name;unique;not null;primary_key"` ColumnName string `gorm:"column:column_name;not null"` GeometryType string `gorm:"column:geometry_type_name;not null"` SpatialReferenceSystemId int `gorm:"column:srs_id"` Z int `gorm:"column:z;not null"` M int `gorm:"column:m;not null"` }
func (GeometryColumn) TableName ¶
func (GeometryColumn) TableName() string
type Metadata ¶
type Metadata struct { Id int `gorm:"column:id;not null;primary_key"` MdScope string `sql:"type:text" gorm:"column:md_scope;not null;default:'dataset'"` MdStandardUri string `sql:"type:text" gorm:"column:md_standard_uri;not null"` MimeType string `sql:"type:text" gorm:"column:mime_type;not null;default:'text/xml'"` Metadata string `sql:"type:text" gorm:"column:metadata;not null;default:''"` }
type MetadataReference ¶
type MetadataReference struct { ReferenceScope string `sql:"type:text" gorm:"column:reference_scope;not null"` Name string `sql:"type:text" gorm:"column:table_name"` ColumnName string `sql:"type:text" gorm:"column:column_name"` RowIdValue *int `gorm:"column:row_id_value"` Timestamp *time.Time `gorm:"column:timestamp;not null;"` MdFileId int `gorm:"column:md_file_id;not null"` MdParentId *int `gorm:"column:md_parent_id"` }
func (MetadataReference) TableName ¶
func (MetadataReference) TableName() string
type NullInt8 ¶
NullInt8 represents an int8 that may be null. NullInt8 implements the Scanner interface so it can be used as a scan destination, similar to NullString.
type RTree ¶
type RTree struct { Table string `gorm:"-"` Id int `gorm:"column:id;unique;not null;primary_key"` MinX float64 `gorm:"column:minx;not null"` MaxX float64 `gorm:"column:maxx;not null"` MinY float64 `gorm:"column:miny;not null"` MaxY float64 `gorm:"column:maxy;not null"` }
func (RTree) ResourceName ¶
type Relation ¶
type Relation struct { Id int `gorm:"column:id;uniqu;not null;primary_key"` BaseTableName string `gorm:"column:base_table_name;not null"` BasePrimaryColumn string `gorm:"column:base_primary_column;not null;default:'id'"` RelatedTableName string `gorm:"column:related_table_name;not null"` RelatedPrimaryColumn string `gorm:"column:related_primary_column;not null;default:'id'"` RelationName string `gorm:"column:relation_name;not null"` MappingTableName string `gorm:"column:mapping_table_name;not null"` }
type SQLiteSequence ¶
type SQLiteSequence struct { Name string `gorm:"column:name;unique;not null;primary_key"` Value int64 `gorm:"column:seq;not null"` }
func (SQLiteSequence) TableName ¶
func (SQLiteSequence) TableName() string
type SpatialReferenceSystem ¶
type SpatialReferenceSystem struct { Name string `gorm:"column:srs_name;unique;not null;primary_key"` SpatialReferenceSystemId *int `gorm:"column:srs_id;unique;not null;primary_key"` Organization string `gorm:"column:organization;not null" json:"org"` OrganizationCoordinateSystemId *int `gorm:"column:organization_coordsys_id;not null" json:"org_id"` Definition string `gorm:"column:definition;not null" json:"def"` Description string `gorm:"column:description" json:"description"` }
func (*SpatialReferenceSystem) Code ¶
func (srs *SpatialReferenceSystem) Code() string
func (SpatialReferenceSystem) TableName ¶
func (SpatialReferenceSystem) TableName() string
type TileMatrix ¶
type TileMatrix struct { Name string `sql:"type:text" gorm:"column:table_name;not null"` //ZoomLevel sql.NullInt64 `gorm:"column:zoom_level;not null"` ZoomLevel NullInt8 `gorm:"column:zoom_level;not null"` MatrixWidth uint64 `gorm:"column:matrix_width;not null"` MatrixHeight uint64 `gorm:"column:matrix_height;not null"` TileWidth uint32 `gorm:"column:tile_width;not null"` TileHeight uint32 `gorm:"column:tile_height;not null"` PixelXSize float64 `gorm:"column:pixel_x_size;not null"` PixelYSize float64 `gorm:"column:pixel_y_size;not null"` }
func (TileMatrix) TableName ¶
func (TileMatrix) TableName() string
type TileMatrixSet ¶
type TileMatrixSet struct { Name string `"type:text" gorm:"column:table_name;not null;primary_key"` SpatialReferenceSystemId *int `gorm:"column:srs_id;not null"` MinX *float64 `gorm:"column:min_x;not null"` MinY *float64 `gorm:"column:min_y;not null"` MaxX *float64 `gorm:"column:max_x;not null"` MaxY *float64 `gorm:"column:max_y;not null"` }
func (TileMatrixSet) GetSpatialReferenceSystemId ¶
func (tms TileMatrixSet) GetSpatialReferenceSystemId() int
func (TileMatrixSet) TableName ¶
func (TileMatrixSet) TableName() string
type TileMatrixSetIterator ¶
type TileMatrixSetIterator struct {
// contains filtered or unexported fields
}
func (*TileMatrixSetIterator) Next ¶
func (it *TileMatrixSetIterator) Next() (*TileMatrixSet, error)
type TileMatrixSetList ¶
type TileMatrixSetList struct {
// contains filtered or unexported fields
}
func (*TileMatrixSetList) Item ¶
func (l *TileMatrixSetList) Item(i int) *TileMatrixSet
func (*TileMatrixSetList) Size ¶
func (l *TileMatrixSetList) Size() int
type VectorLayer ¶
type VectorLayerList ¶
type VectorLayerList struct {
// contains filtered or unexported fields
}
func (*VectorLayerList) Item ¶
func (l *VectorLayerList) Item(i int) *VectorLayer
func (*VectorLayerList) Size ¶
func (l *VectorLayerList) Size() int
Source Files ¶
- BinaryHeader.go
- Content.go
- CoordinateReferenceSystem.go
- Extension.go
- Extent.go
- Feature.go
- FeatureCollection.go
- GeoPackage.go
- Geometry.go
- GeometryColumn.go
- Metadata.go
- MetadataReference.go
- NullInt8.go
- RTree.go
- Relation.go
- SQLiteSequence.go
- SpatialReferenceSystem.go
- TileMatrix.go
- TileMatrixSet.go
- TileMatrixSetIterator.go
- TileMatrixSetList.go
- VectorLayer.go
- VectorLayerList.go
- param.go