-
-
Notifications
You must be signed in to change notification settings - Fork 868
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
[FEATURE] Better support for cartesian coordinate systems #1386
Comments
I also work in cartesian coordinates, where I don't think a more generic Here comes the challenging part which you are describing: our coordinates are This has a couple of benefits:
I also have some rather unique use-cases so in my case forking was probably inevitable anyway. I could have contributed some of my features, but I felt it would only pollute the I think this is an interesting discussion though. Being able to use either EDIT: Perhaps a first step would be having the layers implemented using |
@JosefWN Good description of the situation, thanks :) We are always happy to see new PRs, but as you said yourself, this would probably 'pollute' this project quite a bit; we are trying to keep things simple here for now. Just as a current example, take #1390. However great it might end up being (and is right now) (we are still discussing over on Discord), if it grows too big or starts to do too much for the end developer, it might be decided unsuitable for the core library here. It is a very similar situation here. Yes, it would be nice to have this. But would it add significant amounts of code: yes. This situation is further weighed down by this being a fairly niche use-case (I think you'll agree), compared to the new attribution system having potential for usage in/on all applications. Of course, a plugin might be a good way to go about this, but this is getting into deep discussion territory. So I'd better invite @ibrierley, @moonag, and @TesteurManiak along! |
Well, I'm not objective for this kind of thing as I've always used |
I was trying to figure if CRS.simple could be used (or extended) in some ways...has anyone tried this (my suspicion would be something like a bounds/LL issue would get in the way like the original post mentioned, but it could be interesting to see if theres a way there...). It may be helpful to have a specific example people can look at and ponder. |
We could look at creating an extension for LatLng that allows working with meters or a constructor for latlng that takes meters. I am not super familiar with multiple CRS. Or this might be something you can do in your own project using either of these methods? |
Not sure how that would work without every |
I suspect those with more experience on CRS side will need to expand a little more of give specific examples of things that don't work. I.e my understanding is that a custom crs basically has projection/unprojection and transformations. So with the original post, what is the issue with having a custom crs that is essentially CRS.simple, but with a transformation that scales by a factor of say 1000 (to allow the values to fit within a LatLng max +/-180,90 ? (it sure feels like bending something into a solution not quite right, but I'd like to understand nontheless). Again, I may well be misunderstanding some core concepts, but it may be good to discuss those, so it gives us some ideas of potential solutions (or if it simply can't be without too much complexity, at least its been considered reasonably). I have some suspicions where some of the flaws are, but it would be good to hear from those who have tried and got stuck what issues are hit. |
Other than the bugs I have reported relating to planar projections (such as polar stereographic projection), I think my main gripe is the API's are only intended for Working only with One thing we could do to get around that is to have two tiers of layers as I think I suggested before. Take the polyline layer for example, we could have a Ultimately, since everything is being projected at the end of the day, the bulk of the code would be in the I don't know if it's feasible, but just food for thought... |
I'm still a bit unsure about what the problem is with using a custom crs like crs.simple to get around reprojections ? |
What you are suggesting can potentially work in the most trivial use cases, but it's working around the API:s, not with them. In my use case I have an actual CRS where this would not work, either. At least far from trivially (since there are occasions where I actually need a Maybe I'm convoluting this issue, but what triggered me was the issue author's need to use The challenge I think I share with LiDAR data is that we process a lot of points, and we are not necessarily talking I'm working in maritime, in ice infested waters. Not just the vessels are moving, but the entire context, even the "ground" (the ice). Very non-linear tracks (hard to simplify) which stretch with ice drift, satellite imagery is moving and so on. The user can then move back and forth by scrolling a timeline, to see what conditions were like, say, 5 hours ago, and what they will be like 10 hours from now. This makes it possible for the user to continuously see on the screen how conditions change over time, which creatives a more intuitive understanding of weather, wind, ocean currents, pressure gradients etc. and their impact on the vessels and the offshore operation at large. At first thought, the fact that the points are already projected is great, right? Because under the hood, every layer is using (scaled) projected points to draw things on the map... but if I want to use a With That being said, it's not impossible of course. Just pay the price of unprojections and reprojections. In my case, it's pretty tough however, since my layers are continuously and dynamically moving on the map, and there is quite a bit of math that is far easier to do in a cartesian coordinate system. Even without the unprojections and reprojections I'm optimizing performance every few months as the code base is growing, because I'm constantly on the brink of the frame budget on the highest-end tablets and mid-end laptops for more advanced use-cases. I'm now maintaining 12 layers/plugins in my code, at least half of which are forked from I do agree that me and @noelex's use cases are somewhat niche, and what I said in the tile layer discussion applies here too: weighing a smaller change that could help a few, albeit a lot, against the cost it would have for everyone else. So I'm not entirely sure we need to change anything. All I'm saying is that there are ways to make my life much easier, which as a result would also make at least some other peoples lives easier and more hack-free, assuming that they work with large point-sets in a planar CRS. |
I think what would be useful is a kind of minimal case that highlights the problem and can't be done easily with the existing crs options. Some basic code which says "I have to do this, but its inefficient and too complex". Then it's a bit easier to ponder the existing code and if it could be either bent or rewritten to deal with it. |
What do you want implemented?
I'm currently writing an app which uses laser scanned 2D images as maps, and I would like to allow user to interact with these maps using
flutter_map
.The problem is that these maps use cartesian coordiantes (measured in meters) instead of geographical coordinates. Although I can write a custom CRS to project map coordinates to pixels, but
LatLng
andLatLngBounds
won't allow me to specify coordinates beyond 'geographical' boundaries ([-90, 90] for latitude and [-180, 180] for longitude).Thus I think having a more generic version of '
LatLng
' would be very helpful for users which doesn't use geographical coordinate systems.What other alternatives are available?
There are two ways to workaround this:
LatLon
and bypass those boundary checks. This is easy to implement and works fine. But there are some methods and properties inLatLon
(e.g.longitude
andlatitudeInRad
) makes no sense for cartesian coordinates and may cause confustions.Can you provide any other information?
No response
Platforms Affected
Android, iOS, Web, Windows, MacOS, Linux, Other
Severity
Annoying: Currently have to use workarounds
Requirements
Bounty
flutter_map uses Polar.sh to provide a bounty on this issue! Contributors who resolve this issue will receive the full amount pledged below, after all fees have been paid.
The flutter_map team funds issues we want to see fixed but are relatively low priority for us, and we do this using your donations! When you donate, 15% goes to the OpenStreetMap Foundation, and the rest is held as donations, some of which we fund these issues with!
Of course, we appriciate any size donation you can make: it supports us directly, and allows us to fund these issues, but if this issue is particularly important to you, you can pledge money directly to this issue using the button below.
The text was updated successfully, but these errors were encountered: