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

Support multi dimensions #1287

Open
latot opened this issue Dec 20, 2024 · 4 comments
Open

Support multi dimensions #1287

latot opened this issue Dec 20, 2024 · 4 comments

Comments

@latot
Copy link

latot commented Dec 20, 2024

Hi! actually there is the const generic option, which I think would be nice to use as a base to get N dimensions.

This could mix well with the project, the algorithms for 2 dimensions can also be implemented in their respective use case, and the ones who can be generalized could also be done.

What do you think?

@kylebarron
Copy link
Member

kylebarron commented Dec 20, 2024

There's been a lot of discussion about this before. #797, #1150.

Note that the new geo_traits crate supports Z, M, and ZM dimensions. So we could have an alternate backend that uses const generics to support multiple dimensions of coordinates. But having that as a separate crate would be backwards compatible for anything using geo-types now. And you can write algorithms in terms of the traits that support input from many sources with whatever dimension.

@michaelkirk
Copy link
Member

michaelkirk commented Dec 20, 2024

See (#1011 edit: woops, I meant #797, same as above) for some prior discussion. The bar for making a change like this to our most fundamental types would be very high.

@latot
Copy link
Author

latot commented Dec 20, 2024

Thx for the replies.

I has been playing a lot with this concept today, and there is ways to on the same crate do it compatible.

For example, each coord and point basic functions can exists on the basic implement function, while all x/y related access are implemented only for points of two dimensions.

Rust support create specialized functions using the const generics, we can take advantage a lot of it, so all the implemented logic functions could be organized in their respective dimension (actually 2), also helps to extend them on the future.

Agree change the base is very expensive, from the issue seems intentions are of the crate being used for more ppl, is just... z, y, z, m are just a subset of the spatial/geometry use, the lack one 0, 1 and >=3 dimensions hits a lot in what we can do...a lot of data and things are not in two dimensions, a lot of research (including the one I do) also uses different number of dimensions... my point there is that handle and use two dimensions also means restrict ppl who can contribute, in my case for example I would move to write my own crate, which is sad because I was expecting be able to contribute here.

From what I see, Lat/Long/UTM/XY/Z/M, should be above, at base an abstract geometry layer which we can use and over that make that needed functions for that particular cases, that could open how to use the crate.

Thx!

@kylebarron
Copy link
Member

I think it would take at least a year to get enough consensus to add support for multiple dimensions to geo-types. I'd encourage you to explore the use of geo-traits to interoperate across the geospatial rust ecosystem without needing changes to geo-types.

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

No branches or pull requests

3 participants