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: osr.go Progetto: kikht/gdal
// Fetch a normalized projection parameter value
func (sr SpatialReference) NormalizedProjectionParameter(
	name string, defaultValue float64,
) (float64, error) {
	cName := C.CString(name)
	defer C.free(unsafe.Pointer(cName))
	var err C.OGRErr
	value := C.OSRGetProjParm(sr.cval, cName, C.double(defaultValue), &err)
	if err != 0 {
		return float64(value), error(err)
	}

	return float64(value), nil
}