https://github.com/paulsmith/gogeos
apt-get install libgeos-dev
or
$ wget http://download.osgeo.org/geos/geos-3.3.8.tar.bz2
$ tar xvfj geos-3.3.8.tar.bz2
$ cd geos-3.3.8
$ ./configure
$ make
$ sudo make install
package main
import (
"fmt"
"github.com/paulsmith/gogeos/geos"
)
func main() {
line, _ := geos.FromWKT("LINESTRING (0 0, 10 10, 20 20)")
buf, _ := line.Buffer(2.5)
fmt.Println(buf)
// Output: POLYGON ((18.2322330470336311 21.7677669529663689, 18.61…
}
网友评论