Documentation ¶
Index ¶
- func LoadShapeCollection(path, name string) (*model.ShapeCollection, error)
- func LoadShapes(path, name string) ([]geometry.Shape, error)
- func ReadGeoJSONFeatureCollection(path, file string, inputType InputType) (geojson.FeatureCollection, error)
- func SaveShapeCollection(path, name string, shapeCollection model.ShapeCollection) error
- func SaveShapeCollectionFile(path, name string, shapeCollectionFile ShapeCollectionFile) error
- func SaveShapes(path, name string, shapes []geometry.Shape) error
- func WatchIndexFolder(path string) (chan WatchEvent, error)
- type InputType
- type ShapeCollectionFile
- type WatchEvent
- type WatchEventType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadShapeCollection ¶
func LoadShapeCollection(path, name string) (*model.ShapeCollection, error)
LoadShapeCollection loads a prior saved file and deserializes it to a shape collection
func LoadShapes ¶
LoadShapes loads a prior saved file and deserializes it to a list of shapes
func ReadGeoJSONFeatureCollection ¶
func ReadGeoJSONFeatureCollection(path, file string, inputType InputType) (geojson.FeatureCollection, error)
ReadGeoJSONFeatureCollection reads a GeoJSON feature collection and returns as a geojson-struct
func SaveShapeCollection ¶
func SaveShapeCollection(path, name string, shapeCollection model.ShapeCollection) error
SaveShapeCollection saves the given shape collection to a gob-encoded file for later use
func SaveShapeCollectionFile ¶
func SaveShapeCollectionFile(path, name string, shapeCollectionFile ShapeCollectionFile) error
SaveShapeCollectionFile saves the given shape collection to a gob-encoded file for later use
func SaveShapes ¶
SaveShapes saves the given shapes to a gob-encoded file for later use
func WatchIndexFolder ¶
func WatchIndexFolder(path string) (chan WatchEvent, error)
WatchIndexFolder will watch given folder and return a channel which will publish a WatchEvent upon file changes for .gob files changed and if they contain a ShapeCollection
Types ¶
type InputType ¶
type InputType int
InputType Type of geoJSON input
const ( // GeoJSON normal GeoJSON input GeoJSON InputType = 0 )
type ShapeCollectionFile ¶
type ShapeCollectionFile struct { ShapeCollection model.ShapeCollection ShapeStore geometry.ShapeStore }
ShapeCollectionFile is a file representation of a complete ShapeCollection including its shapes
func LoadShapeCollectionFile ¶
func LoadShapeCollectionFile(path, name string) (*ShapeCollectionFile, error)
LoadShapeCollectionFile loads a prior saved file and deserializes it to a shape collection along with a corresponding shape store
type WatchEvent ¶
type WatchEvent struct { // Event is which kind of watch event type Event WatchEventType // Path is the path of the file Path string // ShapeCollection is the ShapeCollection for the event ShapeCollectionFile *ShapeCollectionFile }
WatchEvent is the event you receive when a file has changed
type WatchEventType ¶
type WatchEventType string
WatchEventType is the type of event received when a file has changed
const ( // Updated means a file has been created or updated Updated WatchEventType = "updated" // Removed means a file has been removed Removed WatchEventType = "removed" )