dataset

package
v0.0.0-...-0d40728 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2021 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFileType

func CheckFileType(extractedArchivePath string) (string, error)

CheckFileType does a breadth first directory traversal until it finds a file, then it checks its type and returns it to the caller.

func CreateGeoBoundsGrouping

func CreateGeoBoundsGrouping() map[string]interface{}

CreateGeoBoundsGrouping dumps the geobounds grouping structure into a map. It assumes that the dataset has the same structure as during upload.

func CreateSatelliteGrouping

func CreateSatelliteGrouping() map[string]interface{}

CreateSatelliteGrouping dumps the satellite grouping structure into a map. It assumes that the dataset has the same structure as during upload.

func GetSatelliteIndexFields

func GetSatelliteIndexFields() []string

GetSatelliteIndexFields lists the fields to index for satellite datasets.

func StoreZipDataset

func StoreZipDataset(dataset string, rawData []byte) (string, error)

StoreZipDataset writes the archive file to temporary storage, where data is supplied as a byte array.

func StoreZipDatasetFromFormFile

func StoreZipDatasetFromFormFile(dataset string, formFile multipart.File) (string, error)

StoreZipDatasetFromFormFile writes the archive file to temporary storage, where data is supplied as a form multipart file.

Types

type BoundingBox

type BoundingBox struct {
	UpperLeft  *Point
	UpperRight *Point
	LowerLeft  *Point
	LowerRight *Point
}

BoundingBox is a box delineated by four corners.

func (*BoundingBox) String

func (b *BoundingBox) String() string

ToString writes out the bounding box to a string.

func (*BoundingBox) ToGeometryString

func (b *BoundingBox) ToGeometryString() string

ToGeometryString writes out the bounding box to a geometry string (POSTGIS).

type D3M

type D3M struct {
	DatasetName string
	DatasetPath string
}

D3M captures the needed information for a D3M dataset.

func NewD3MDataset

func NewD3MDataset(datasetName string, datasetPath string) (*D3M, error)

NewD3MDataset creates a new d3m dataset from a dataset folder.

func (*D3M) CleanupTempFiles

func (d *D3M) CleanupTempFiles()

CleanupTempFiles does nothing since this creates no temp files.

func (*D3M) CreateDataset

func (d *D3M) CreateDataset(rootDataPath string, datasetName string, config *env.Config) (*serialization.RawDataset, error)

CreateDataset processes the D3M dataset and updates it as needed to meet distil needs.

func (*D3M) GetDefinitiveTypes

func (d *D3M) GetDefinitiveTypes() []*model.Variable

GetDefinitiveTypes returns an empty list as definitive types.

type ExpandedDatasetPaths

type ExpandedDatasetPaths struct {
	RawFilePath       string
	ExtractedFilePath string
}

ExpandedDatasetPaths stores paths info about the input dataset archive and the expanded archive.

func ExpandZipDataset

func ExpandZipDataset(datasetPath string, datasetName string) (*ExpandedDatasetPaths, error)

ExpandZipDataset decompresses a zipped dataset for further downstream processing.

type Media

type Media struct {
	Dataset           string `json:"dataset"`
	MediaType         string `json:"mediaType"`
	TargetMediaType   string `json:"targetMediaType"`
	RawFilePath       string `json:"rawFilePath"`
	ExtractedFilePath string `json:"extractedFilePath"`
	// contains filtered or unexported fields
}

Media captures the data in a media dataset.

func NewMediaDataset

func NewMediaDataset(dataset string, mediaType string, targetMediaType string, rawFilePath string) (*Media, error)

NewMediaDataset creates a new media dataset from raw byte data, assuming json.

func NewMediaDatasetFromExpanded

func NewMediaDatasetFromExpanded(dataset string, mediaType string, targetMediaType string, zipFileName string, extractedArchivePath string) (*Media, error)

NewMediaDatasetFromExpanded creates a new media dataset from raw byte data, assuming json.

func (*Media) CleanupTempFiles

func (m *Media) CleanupTempFiles()

CleanupTempFiles does nothing since this creates no temp files.

func (*Media) CreateDataset

func (m *Media) CreateDataset(rootDataPath string, datasetName string, config *env.Config) (*serialization.RawDataset, error)

CreateDataset processes the raw media dataset and creates a raw D3M dataset.

func (*Media) GetDefinitiveTypes

func (m *Media) GetDefinitiveTypes() []*model.Variable

GetDefinitiveTypes returns an empty list as definitive types.

type Point

type Point struct {
	X float64
	Y float64
}

Point represents a coordinate in 2d space.

type RemoteSensingDatasetProperties

type RemoteSensingDatasetProperties struct {
	MultiClass     bool
	MultiTimestamp bool
}

RemoteSensingDatasetProperties lists the data properties of a remote sensing dataset.

type Satellite

type Satellite struct {
	Dataset           string `json:"dataset"`
	ImageType         string `json:"imageType"`
	RawFilePath       string `json:"rawFilePath"`
	ExtractedFilePath string `json:"extractedFilePath"`
	// contains filtered or unexported fields
}

Satellite captures the data in a satellite (remote sensing) dataset.

func NewSatelliteDataset

func NewSatelliteDataset(dataset string, imageType string, rawFilePath string) (*Satellite, error)

NewSatelliteDataset creates a new satelitte dataset from geotiff files

func NewSatelliteDatasetFromExpanded

func NewSatelliteDatasetFromExpanded(dataset string, imageType string, rawFilePath string, extractedFilePath string) (*Satellite, error)

NewSatelliteDatasetFromExpanded creates a new satelitte dataset from geotiff files where the archive has already been expanded.

func (*Satellite) CleanupTempFiles

func (s *Satellite) CleanupTempFiles()

CleanupTempFiles does nothing since this creates no temp files.

func (*Satellite) CreateDataset

func (s *Satellite) CreateDataset(rootDataPath string, datasetName string, config *env.Config) (*serialization.RawDataset, error)

CreateDataset processes the raw satellite dataset and creates a raw D3M dataset.

func (*Satellite) GetDefinitiveTypes

func (s *Satellite) GetDefinitiveTypes() []*model.Variable

GetDefinitiveTypes returns an empty list as definitive types.

type Table

type Table struct {
	Dataset string     `json:"dataset"`
	CSVData [][]string `json:"csvData"`
	// contains filtered or unexported fields
}

Table represents a basic table dataset.

func NewTableDataset

func NewTableDataset(dataset string, rawData []byte, flagD3MIndex bool) (*Table, error)

NewTableDataset creates a new table dataset from raw byte data, assuming csv.

func (*Table) CleanupTempFiles

func (t *Table) CleanupTempFiles()

CleanupTempFiles does nothing since this creates no temp files.

func (*Table) CreateDataset

func (t *Table) CreateDataset(rootDataPath string, datasetName string, config *env.Config) (*serialization.RawDataset, error)

CreateDataset structures a raw csv file into a valid D3M dataset.

func (*Table) GetDefinitiveTypes

func (t *Table) GetDefinitiveTypes() []*model.Variable

GetDefinitiveTypes returns an empty list as definitive types.

Jump to

Keyboard shortcuts

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