output

package
v4.32.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Allows outputting (in PIXLISE protobuf dataset format) of in-memory representation of PIXL data that importer has read. Also outputs summary JSON files for the dataset.

Example (ConvertTiffToPNG)
pngFile, err := os.CreateTemp("", "png")
pngPath := pngFile.Name()
err = convertTiffToPNG("./test-files/PCW_D141T0654328732_000RCM_N001000022000045301600LUJ01.TIF", pngPath)
fileInfo, err2 := os.Stat(pngPath)

//fmt.Println(pngPath)
fmt.Printf("%v\n", err)
fmt.Printf("%v\n", err2)
fmt.Printf("%v\n", fileInfo.Size() > 234000 && fileInfo.Size() < 334000)
Output:

<nil>
<nil>
true
Example (RleEncode)
data := []int{0, 0, 4, 2, 2, 2, 3, 0}

encoded := rLEncode(data)

fmt.Printf("%+v\n", encoded)
Output:

[0 2 4 1 2 3 3 1 0 1]
Example (ZeroRunEncode)
data := []int64{0, 0, 4, 2, 0, 0, 0, 0, 3, 0}

encoded := zeroRunEncode(data)

fmt.Printf("%+v\n", encoded)
Output:

[0 2 4 2 0 4 3 0 1]

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PIXLISEDataSaver

type PIXLISEDataSaver struct {
	// contains filtered or unexported fields
}

func (*PIXLISEDataSaver) Save

func (s *PIXLISEDataSaver) Save(
	data dataConvertModels.OutputData,
	contextImageSrcPath string,
	outputDatasetPath string,
	outputImagesPath string,
	db *mongo.Database,
	creationUnixTimeSec int64,
	jobLog logger.ILogger) error

Save - saves internal representation of dataset (outputData)

Jump to

Keyboard shortcuts

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