Skip to content

Commit

Permalink
"Refer" -> "See"
Browse files Browse the repository at this point in the history
  • Loading branch information
metasim committed Jan 10, 2023
1 parent bdf574e commit 0793f7d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
19 changes: 10 additions & 9 deletions src/vector/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl Geometry {
///
/// `index` is the line string vertex index, from 0 to `point_count()-1`, or `0` when a point.
///
/// Refer: [`OGR_G_GetPoint`](https://gdal.org/api/vector_c_api.html#_CPPv414OGR_G_GetPoint12OGRGeometryHiPdPdPd)
/// See: [`OGR_G_GetPoint`](https://gdal.org/api/vector_c_api.html#_CPPv414OGR_G_GetPoint12OGRGeometryHiPdPdPd)
pub fn get_point(&self, index: i32) -> (f64, f64, f64) {
let mut x: c_double = 0.;
let mut y: c_double = 0.;
Expand Down Expand Up @@ -300,14 +300,14 @@ impl Geometry {

/// Get the geometry type ordinal
///
/// Refer: [OGR_G_GetGeometryType](https://gdal.org/api/vector_c_api.html#_CPPv421OGR_G_GetGeometryType12OGRGeometryH)
/// See: [OGR_G_GetGeometryType](https://gdal.org/api/vector_c_api.html#_CPPv421OGR_G_GetGeometryType12OGRGeometryH)
pub fn geometry_type(&self) -> OGRwkbGeometryType::Type {
unsafe { gdal_sys::OGR_G_GetGeometryType(self.c_geometry()) }
}

/// Get the WKT name for the type of this geometry.
///
/// Refer: [`OGR_G_GetGeometryName`](https://gdal.org/api/vector_c_api.html#_CPPv421OGR_G_GetGeometryName12OGRGeometryH)
/// See: [`OGR_G_GetGeometryName`](https://gdal.org/api/vector_c_api.html#_CPPv421OGR_G_GetGeometryName12OGRGeometryH)
pub fn geometry_name(&self) -> String {
// Note: C API makes no statements about this possibly returning null.
// So we don't have to result wrap this,
Expand All @@ -326,7 +326,7 @@ impl Geometry {
///
/// For a polygon, the returned number is the number of rings (exterior ring + interior rings).
///
/// Refer: [`OGR_G_GetGeometryCount`](https://gdal.org/api/vector_c_api.html#_CPPv422OGR_G_GetGeometryCount12OGRGeometryH)
/// See: [`OGR_G_GetGeometryCount`](https://gdal.org/api/vector_c_api.html#_CPPv422OGR_G_GetGeometryCount12OGRGeometryH)
pub fn geometry_count(&self) -> usize {
let cnt = unsafe { gdal_sys::OGR_G_GetGeometryCount(self.c_geometry()) };
cnt as usize
Expand All @@ -336,7 +336,7 @@ impl Geometry {
///
/// Only `wkbPoint` or `wkbLineString` may return a non-zero value. Other geometry types will return 0.
///
/// Refer: [`OGR_G_GetPointCount`](https://gdal.org/api/vector_c_api.html#_CPPv419OGR_G_GetPointCount12OGRGeometryH)
/// See: [`OGR_G_GetPointCount`](https://gdal.org/api/vector_c_api.html#_CPPv419OGR_G_GetPointCount12OGRGeometryH)
pub fn point_count(&self) -> usize {
let cnt = unsafe { gdal_sys::OGR_G_GetPointCount(self.c_geometry()) };
cnt as usize
Expand Down Expand Up @@ -472,15 +472,15 @@ impl Geometry {
///
/// When GEOS < 3.8, this method will return `Ok(self.clone())` if it is valid, or `Err` if not.
///
/// Refer: [OGR_G_MakeValidEx](https://gdal.org/api/vector_c_api.html#_CPPv417OGR_G_MakeValidEx12OGRGeometryH12CSLConstList)
/// See: [OGR_G_MakeValidEx](https://gdal.org/api/vector_c_api.html#_CPPv417OGR_G_MakeValidEx12OGRGeometryH12CSLConstList)
///
/// # Example
/// ```rust, no_run
/// use gdal::vector::Geometry;
/// # fn main() -> gdal::errors::Result<()> {
/// let src = Geometry::from_wkt("POLYGON ((0 0, 10 10, 0 10, 10 0, 0 0))")?;
/// let dst = src.make_valid(())?;
/// assert_eq!("MULTIPOLYGON (((10 0,0 0,5 5,10 0)),((10 10,5 5,0 10,10 10)))", dst.wkt()?);
/// assert_eq!("MULTIPOLYGON (((10 0, 0 0, 5 5, 10 0)),((10 10, 5 5, 0 10, 10 10)))", dst.wkt()?);
/// # Ok(())
/// # }
/// ```
Expand Down Expand Up @@ -708,7 +708,7 @@ mod tests {
#[test]
/// Repairable case (self-intersecting)
pub fn test_make_valid_repairable() {
let src = Geometry::from_wkt("POLYGON ((0 0,10 10,0 10,10 0,0 0))").unwrap();
let src = Geometry::from_wkt("POLYGON ((0 0, 10 10, 0 10, 10 0, 0 0))").unwrap();
let dst = src.make_valid(());
assert!(dst.is_ok());
}
Expand All @@ -718,7 +718,8 @@ mod tests {
/// Repairable case, but use extended options
pub fn test_make_valid_ex() {
let src =
Geometry::from_wkt("POLYGON ((0 0,0 10,10 10,10 0,0 0),(5 5,15 10,15 0,5 5))").unwrap();
Geometry::from_wkt("POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0),(5 5, 15 10, 15 0, 5 5))")
.unwrap();
let dst = src.make_valid(&[("STRUCTURE", "LINEWORK")]);
assert!(dst.is_ok(), "{dst:?}");
}
Expand Down
6 changes: 3 additions & 3 deletions src/vector/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,15 @@ pub trait LayerAccess: Sized {

/// Set a feature on this layer layer.
///
/// Refer [SetFeature](https://gdal.org/doxygen/classOGRLayer.html#a681139bfd585b74d7218e51a32144283)
/// See: [SetFeature](https://gdal.org/doxygen/classOGRLayer.html#a681139bfd585b74d7218e51a32144283)
fn set_feature(&self, feature: Feature) -> Result<()> {
unsafe { gdal_sys::OGR_L_SetFeature(self.c_layer(), feature.c_feature()) };
Ok(())
}

/// Set a spatial filter on this layer.
///
/// Refer [OGR_L_SetSpatialFilter](https://gdal.org/doxygen/classOGRLayer.html#a75c06b4993f8eb76b569f37365cd19ab)
/// See: [OGR_L_SetSpatialFilter](https://gdal.org/doxygen/classOGRLayer.html#a75c06b4993f8eb76b569f37365cd19ab)
fn set_spatial_filter(&mut self, geometry: &Geometry) {
unsafe { gdal_sys::OGR_L_SetSpatialFilter(self.c_layer(), geometry.c_geometry()) };
}
Expand Down Expand Up @@ -421,7 +421,7 @@ pub trait LayerAccess: Sized {
///
/// Returns `Some(SpatialRef)`, or `None` if one isn't defined.
///
/// Refer: [OGR_L_GetSpatialRef](https://gdal.org/doxygen/classOGRLayer.html#a75c06b4993f8eb76b569f37365cd19ab)
/// See: [OGR_L_GetSpatialRef](https://gdal.org/doxygen/classOGRLayer.html#a75c06b4993f8eb76b569f37365cd19ab)
fn spatial_ref(&self) -> Option<SpatialRef> {
let c_obj = unsafe { gdal_sys::OGR_L_GetSpatialRef(self.c_layer()) };
if c_obj.is_null() {
Expand Down

0 comments on commit 0793f7d

Please sign in to comment.