Exemplo n.º 1
0
Arquivo: osr.go Projeto: 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()
}
Exemplo n.º 2
0
Arquivo: osr.go Projeto: 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
}