grect

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 3 Imported by: 13

README

GRECT

Quickly get the outer rectangle for GeoJSON, WKT, WKB.

	r := grect.Get(`{
      "type": "Polygon",
      "coordinates": [
        [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
          [100.0, 1.0], [100.0, 0.0] ]
        ]
    }`)
	fmt.Printf("%v %v\n", r.Min, r.Max)
	// Output:
	// [100 0] [101 1]

Contact

Josh Baker @tidwall

License

GRECT source code is available under the MIT License.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rect

type Rect struct {
	Min, Max []float64
}

func Get

func Get(s string) Rect
Example
r := Get(`{
      "type": "Polygon",
      "coordinates": [
        [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],
          [100.0, 1.0], [100.0, 0.0] ]
        ]
    }`)
fmt.Printf("%v %v\n", r.Min, r.Max)
Output:

[100 0] [101 1]

func (Rect) String

func (r Rect) String() string

Jump to

Keyboard shortcuts

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