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

Allow DEMs with projections that are not north-up #544

Open
nwagenbrenner opened this issue Jan 17, 2025 · 0 comments
Open

Allow DEMs with projections that are not north-up #544

nwagenbrenner opened this issue Jan 17, 2025 · 0 comments

Comments

@nwagenbrenner
Copy link
Member

To do this, one idea is:

  1. Read in the DEM in it's native projection.
  2. Grab the DEM center point and reproject that point to EPSG 4326 (lat/lon).
  3. Make another lat/lon point some short distance straight north of the lat/lon point generated in 2.
  4. Reproject those two lat/lon points back to the projection of the DEM.
  5. Now you have two sets of points, one in lat/lon coordinates which forms a straight line aligned with north and another set in the DEM projection coordinates which forms a line that is some angle off of north.
  6. Compute the angle between those two lines and this is the angle by which the input wind direction needs to be adjusted.
  7. Adjust the input wind direction by the angle calculated in 6 and proceed with the simulation.

We think this is all that would need to be done, but this work should be double checked during implementation.

@nwagenbrenner nwagenbrenner added this to the 3.12.0 milestone Jan 17, 2025
nwagenbrenner added a commit that referenced this issue Jan 18, 2025
latwood added a commit that referenced this issue Feb 11, 2025
…runs. Also caught a spot in the original mass solver domain average run implementation that seemed to need corrected

seems like we will need to take extra care to check each instance of input.inputDirection in the code, to determine whether angleFromNorth needs to be added or not, or setup a second direction variable to be differentiated from the input.inputDirection value

for issue #544
latwood added a commit that referenced this issue Feb 11, 2025
the original fix was to deal with png layers not quite extending to the right spots/bounds in the domain. The fix was necessary this time because negative input min and max bounds would result in vectors not being drawn in google earth. The locations of the vectors and values would pop up, but no arrows would be drawn.

The problem this time turned out to be because the bounds in the overall LatLonAltBox of the kmz would get reversed. The fix worked because it keeps track of all four points of the bounding box, rather than just two. I suspect that the fix will also be more robust for when we allow more types of projections in WindNinja, as the bounding box can take on varying orientations during reprojections.

The original fix is described in e765438 and 395c93e. This fix should come in real handy for issue #544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant