geocsv

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: LGPL-2.1 Imports: 14 Imported by: 0

Documentation

Overview

Package geocsv is a library for read csv file with geospatial data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoCSV

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

GeoCSV a extension of the CSV with geospatial data

func NewGeoCSV

func NewGeoCSV() (gc *GeoCSV)

NewGeoCSV ...

func Read

func Read(filePath string, options Options) (gc *GeoCSV, err error)

Read read csv file with options

func ReadByte

func ReadByte(reader io.Reader, options Options) (gc *GeoCSV, err error)

ReadByte read csv file with options

func (*GeoCSV) ToGeoJSON

func (gc *GeoCSV) ToGeoJSON() (features *geojson.FeatureCollection)

ToGeoJSON export geojson

type GeocsvEncoder

type GeocsvEncoder struct {
	geojson.BaseEncoder
}

func (*GeocsvEncoder) Decode

func (e *GeocsvEncoder) Decode(s []byte) (space.Geometry, error)

Decode Returns geometry of that decode string by codeType.

func (*GeocsvEncoder) Encode

func (e *GeocsvEncoder) Encode(g space.Geometry) []byte

Encode Returns string of that encode geometry by codeType.

func (*GeocsvEncoder) Read

func (e *GeocsvEncoder) Read(r io.Reader) (space.Geometry, error)

Read Returns geometry from reader.

func (*GeocsvEncoder) ReadGeoJSON

func (e *GeocsvEncoder) ReadGeoJSON(r io.Reader) (*geojson.FeatureCollection, error)

ReadGeoJSON Returns geometry from reader .

func (*GeocsvEncoder) Write

func (e *GeocsvEncoder) Write(w io.Writer, g space.Geometry) error

Write write geometry to reader.

func (*GeocsvEncoder) WriteGeoJSON

func (e *GeocsvEncoder) WriteGeoJSON(w io.Writer, g *geojson.FeatureCollection) error

WriteGeoJSON write geometry to writer.

type Options

type Options struct {
	Fields   []string
	XField   string
	YField   string
	WKTField string
}

Options an options of GeoCSV

Jump to

Keyboard shortcuts

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