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

Feature/5 given two coordinates determine visibility #13

Conversation

simonadamprog
Copy link
Contributor

No description provided.

- Basic structure for new feature.
- Next is adding the math.
- Modified Tile to have a function to get height by double lat/lon.
- Renamed Xyz to Vector3D and added some useful functions to it.
- Implemented the main calculation for CanSeeCalculator.
- Added examples to readme.
@simonadamprog simonadamprog force-pushed the feature/5_given_two_coordinates_determine_visibility branch from 81aae13 to 27246e8 Compare October 16, 2021 12:09
@dodie
Copy link
Owner

dodie commented Oct 17, 2021

Looks cool thanks @adtewa 👍

As far as I can tell it already works quite nicely. The only missing part is to apply Earth's curvature in the calculation which is mentioned in the readme. (Something similar is already in place for the contour diagram, maybe a generalized version of that could be a useful here?)

As a followup idea, in the future it would be cool to add some visualization to this feature. E.g. it would be quite nice to show it on a map, or even show a map that indicates all the points that you can see from a given point. (Although, I'm not sure if that's feasible from a runtime point of view. I checked the current calculation, and it's pretty fast, but running the algorithm to all nearby points would be pretty time-consuming.)

I've opened a followups for these ideas to make sure new ideas would not inflate the original issue. #15 #16

@dodie dodie merged commit 6a0b719 into dodie:master Oct 17, 2021
@simonadamprog
Copy link
Contributor Author

Looks cool thanks @adtewa +1

As far as I can tell it already works quite nicely. The only missing part is to apply Earth's curvature in the calculation which is mentioned in the readme. (Something similar is already in place for the contour diagram, maybe a generalized version of that could be a useful here?)

As a followup idea, in the future it would be cool to add some visualization to this feature. E.g. it would be quite nice to show it on a map, or even show a map that indicates all the points that you can see from a given point. (Although, I'm not sure if that's feasible from a runtime point of view. I checked the current calculation, and it's pretty fast, but running the algorithm to all nearby points would be pretty time-consuming.)

I've opened a followups for these ideas to make sure new ideas would not inflate the original issue. #15 #16

Hi @dodie ,
It was a nice topic to work on. Yes, I already started thinking on how to use up the calculation from the ContourCalculator. But I thought I make a PR about this and maybe do the curve thing in an other. The thing is that I don't yet understand how this hiddenHeight calculation works. I checked the source of the idea though and did some drawing myself, to get it that way. But my hunch is that just subtract the calculated height from the actual height might not give the correct answer.
I came up with an alternative solution btw, nearly the same as this, just use the lat/lon as Polar coordinate system angles in Vector3D and not Cartesian c.s., and that way we can calculate te real vector between points considering the earth's curve. After that we can use the same method to compare heights.

it would be quite nice to show it on a map, or even show a map that indicates all the points that you can see from a given point.

I think that the countour calculator is already a solution to that. What also can be done imo, to draw triangles (with opengl?) between the heighs considering height's square's middle.

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

Successfully merging this pull request may close these issues.

2 participants