Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.01 KB

README.md

File metadata and controls

41 lines (28 loc) · 1.01 KB

mtgrid

Go CI

This is an implementation of the ESA Major TOM equal area grid in Go.
This code is based on work in the ESA-PhiLab repository, specifically here

Usage:

Also see tests

package main

import (
    "github.com/earth-genome/mtgrid"
)

func main(){

	//create a simple polygon, this is 1/10th of a degree square
	p := orb.Polygon{{{0.0, 0.0},{0.0, 0.1},{0.1, 0.1},{0.1, 0.0},{0.0, 0.0}}}
	//instantiate a new grid with overlaps
    grid := NewGrid(320, true)
	//generate cells that cover the area
    cells, _ := grid.GenerateGridCells(&p)
		//do something with cells 
	for _, cell := range cells {
		fmt.Printf("cell id %s", cell.Id())
    }
}

Before: Before

After: After