Esempio n. 1
0
File: osr.go Progetto: sn-amber/gdal
// Fetch a projection parameter value
func (sr SpatialReference) ProjectionParameter(name string, defaultValue float64) (float64, error) {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	var cErr C.OGRErr
	value := C.OSRGetProjParm(sr.cval, cName, C.double(defaultValue), &cErr)
	return float64(value), cErr.Err()
}
Esempio n. 2
0
File: ogr.go Progetto: colek42/gdal
// Build a polygon / ring from a set of lines
func (geom Geometry) BuildPolygonFromEdges(autoClose bool, tolerance float64) (Geometry, error) {
	var cErr C.OGRErr
	newGeom := C.OGRBuildPolygonFromEdges(
		geom.cval,
		0,
		BoolToCInt(autoClose),
		C.double(tolerance),
		&cErr,
	)
	return Geometry{newGeom}, cErr.Err()
}
Esempio n. 3
0
File: osr.go Progetto: sn-amber/gdal
// Get spheroid inverse flattening axis
func (sr SpatialReference) InverseFlattening() (float64, error) {
	var cErr C.OGRErr
	flat := C.OSRGetInvFlattening(sr.cval, &cErr)
	return float64(flat), cErr.Err()
}
Esempio n. 4
0
File: osr.go Progetto: sn-amber/gdal
// Get spheroid semi-minor axis
func (sr SpatialReference) SemiMinorAxis() (float64, error) {
	var cErr C.OGRErr
	axis := C.OSRGetSemiMinor(sr.cval, &cErr)
	return float64(axis), cErr.Err()
}