add IsValid function

master
Oliver Tonnhofer 2013-05-12 12:37:55 +02:00
parent e517f5f3fc
commit b57829d95a
1 changed files with 7 additions and 0 deletions

View File

@ -133,6 +133,13 @@ func (this *GEOS) AsWKB(geom *Geom) ([]byte, error) {
return C.GoBytes(unsafe.Pointer(buf), C.int(size)), nil
}
func (this *GEOS) IsValid(geom *Geom) bool {
if C.GEOSisValid_r(this.v, geom.v) == 1 {
return true
}
return false
}
func (this *GEOS) Area(geom *Geom) float64 {
var area C.double
C.GEOSArea_r(this.v, geom.v, &area)