validator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidType         = errors.New("invalid type")
	ErrInvalidCoordinates  = errors.New("invalid coordinates")
	ErrInvalidGeometryType = errors.New("invalid geometry type")
	ErrInvalidPolygon      = errors.New("invalid polygon coordinates")
)

Error messages

Functions

func ValidateGeoJSON

func ValidateGeoJSON(data []byte) error

ValidateGeoJSON validates the GeoJSON data

Types

type GeoJSON

type GeoJSON struct {
	Type       string      `json:"type"`
	Geometry   *Geometry   `json:"geometry,omitempty"`
	Properties interface{} `json:"properties,omitempty"`
}

GeoJSON represents the main structure of GeoJSON data

type Geometry

type Geometry struct {
	Type        string      `json:"type"`
	Coordinates interface{} `json:"coordinates"`
	Geometries  []*Geometry `json:"geometries,omitempty"` // For GeometryCollection
}

Geometry represents the geometry of a GeoJSON object

Jump to

Keyboard shortcuts

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