Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add M-dim bindings #600

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add M-dim bindings #600

wants to merge 7 commits into from

Conversation

JmsPae
Copy link

@JmsPae JmsPae commented Jan 3, 2025

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

This PR seeks to add bindings for GDAL functions relating to higher-dimension geometry, in particular Measured geometry, with some other minor fixes/additions.

Added methods for Geometry:

  • add_point_zm
  • add_point_m
  • set_point_zm
  • set_point_m
  • get_point_zm
  • get_point_vec_zm
  • iso_wkt
  • iso_wkb

Considering renaming get_point_vec_zm to get_point_zm_vec, though neither exactly roll off the tongue.

Also modified the Debug impl. for Geometry to use iso_wkt in cases of measured geometry.

@JmsPae JmsPae marked this pull request as ready for review January 3, 2025 20:00
@JmsPae JmsPae changed the title Add Measure-dim. support Add M-dim bindings Jan 3, 2025
}
Ok(wkb)
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of a separate function, modifying the original wkb/wkt methods would be nicer, though that would be a breaking change.

pub fn geometry_type_has_m(ty: OGRwkbGeometryType::Type) -> bool {
unsafe { gdal_sys::OGR_GT_HasM(ty) != 0 }
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about adding a bunch of stand-alone functions like this when they only take an OGRwkbGeometryType though since that's generated, this might just be good enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant