clawpack / visclaw

Clawpack visualization tools
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
29 stars 47 forks source link

Google Earth : Topo coordinates not in Lat/Long coordinates #179

Closed donnaaboise closed 8 years ago

donnaaboise commented 8 years ago

I have been working to do some GE visualizations for the Teton Dam failure in eastern Idaho. The topo maps I am working with (provided by INL) are not in lat/long coordinates, but in Cartesian coordinates. For example, the topo coordinates are [0,48000]x[0,17540] meters. For this small area, it is reasonable to assume a linear map between Cartesian and lat/long coordinates. To create the PNG figures, I use the topo coordinates as the plotaxes limits and the plotfigure.kml_xlimits, plotfigure.kml_ylimits to create the a lat/long boxes for GE overlays. But other features of the GE plotting (regions, patch borders) are created in computational (topo) coordinates, and so are not showing up on GE.

A simple way to fix this is have the user to supply a "map_topo_to_ge_limits" function as a global function (part of the plotdata object?) that I can use to map these other objects to the GE lat/long coordinates.

With this in mind, I have a few questions :

mandli commented 8 years ago

Someone may need to correct me on this but in my experience what you are trying to do is a beta-plane approximation. Basically you pick a point and approximate everything as if it lived on the tangent plane to a sphere at that point. This can uniquely define a Cartesian coordinate system which degrades in accuracy as you move away from this point. To your other question, once you have the plane you can project onto the plane and freeze the spherical mapping so that you can derive a lat-long to meters function. This usually takes the form of a linear mapping depending on the central point in the beta-plane approximation and is a simple scaling.

donnaaboise commented 8 years ago

A quick search online says that the beta plane does assume a flat tangent plane approximation to the sphere, but it seems that the main point there is to approximate the Coriolis term as a linear term in equations for geophysical fluid flows on the sphere. I've added a "kml_map_topo_to_latlong" attribute to the plot data - see my next PR, where we can continue the discussion.