本文整理匯總了Golang中C.OGRErr類的典型用法代碼示例。如果您正苦於以下問題:Golang OGRErr類的具體用法?Golang OGRErr怎麽用?Golang OGRErr使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了OGRErr類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ProjectionParameter
// 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()
}
示例2: BuildPolygonFromEdges
// 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()
}
示例3: InverseFlattening
// 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()
}
示例4: SemiMinorAxis
// 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()
}