No announcement yet.

Map Coordinates

This is a sticky topic.
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    We have methods for calculating tile names for a specific locations for Community Landsat7.

    Does anyone know the formulea for NLT Landsat7 image set and the USGS image sets?

    I assume that a similar formulea is available for these image sets. One for NLT and one for USGS.
    My Web Page with WW Add-ons and Add-ons Index


    • #32
      canosso, have you looked at the <ctrl><d> option?

      Maybe the devs, under the <ctrl><d> option, could add another paramater, this being the tile file name and level number where the cross hairs are.
      Also a debug feature, to show the tile boundaries.
      My Web Page with WW Add-ons and Add-ons Index


      • #33
        Correct me if I am wrong, but we have a total 360 degrees longitude but only 180 degrees latitude . . . It makes sense if you look at the globe, but in explanation it can be a little confusing. So now I will try to explain a little without losing everyone . . .

        **Edit-This discussion needs a quick introduction to coordinate system lines:
        meridian: Meridians are the arbitrary lines of longitude. They also represent all the instances of north/south direction between the poles. These lines are a considerable distance apart at the equator, but at their polar origins, they converge. The Prime Meridian is also known as Lon 000 or longitude 0. It is the meridian which passes through Greenwich, UK, and gives us GMT.
        parallel - Parallels are commonly known as lines of latitude. They &#39;parallel&#39; the equator. The equator is, in fact, a parallel. Parallels are reliable for navigation purposes in situations where meridians can be deceptive. More later . . .

        **Edit I almost forgot to include (OK, I DID forget for a very long time) an important concept: that of Great Circles.

        A Great Circle is a meridian (always, and all of them) or a parallel (only in one case: the equator) which includes the maximum circumference of the globe (in other words, it wraps around the globe&#39;s widest point).

        To understand this, look at the difference between parallels and meridians: a meridian must always run through the poles, which are &#39;center points,&#39; while a parallel which is any distance north or south of the equator gets to wrap around a &#39;thinner&#39; part of the earth.

        Why this is important will remain a topic for another discussion, but trust me, it is important.

        So here is the rule: All meridians are Great Circles, while the only parallel to qualify is the equator.

        &#39;nuff said for now - back to the discussion . . . .

        This is the reason for the difference on the lat vs lon formula below: from the equator, you have 90 degrees both N and S latitudes (only one zero- if you pass one of the poles, you have begun to again enter latitudes you just passed on the other &#39;side&#39; of the world), and from the poles (90 degrees N & S), this number can only decrease towards the equator in ANY direction (there is no other possibility).

        But there is no &#39;equator&#39; for longitude, due to the nature of the earth&#39;s spin on its axis. Artificially, we can (and have) make a vertical &#39;equator&#39; for the ease of calculations. But the earth would have to roll (tumble), and not spin, on its axis (therefore there would be a new axis) for this line to be anything but arbitrary, or dependent on view or starting location.

        **Edit- Assigning longitude and associating it with time is not entirely arbitrary, since we assign the &#39;position&#39; of the sun to a point on the earth. Essentially, we take an antiquated, but workable, Earth-centric view of the universe, and &#39;lock&#39; its (the sun&#39;s) position to an imaginary line. Thus, GMT is based on the apparent position of the sun directly above that line of longitude at 12:00 Noon. As the earth spins, the sun &#39;moves&#39; around the earth at a rate of 360 degrees/24 hours. Each of the time zones represents the sun&#39;s position directly over the theoretical longitudinal centerline of that timezone at 12:00 noon. In practice, time zones only approximate this interaction, and all points east or west of the &#39;center&#39; of a timezone will not experience &#39;true&#39; noon . . . Ever wonder about degrees, minutes, etc.? It&#39;s cool, and in fact time/nautical miles/spherical coordinates, etc. have some interesting points of convergence. But I will have to save that for another &#39;time&#39; :lol:

        "But," you might say, "we only have one &#39;zero&#39; longitude, as well."
        Not really. Both Greenwich (0 degrees lon) and the International Date Line (180 + - degrees lon) serve as artificial longitudinal &#39;polar lines&#39; (i.e. they divide the hemispheres), but they are in nature arbitrary and characteristically MUCH different from polar &#39;points,&#39; which are defined by the earth&#39;s axis and are therefore &#39;absolute&#39; terminii. Longitude 0 (Greenwich) was/is a completely artificial point of reference on the globe, and resulted from human need for such a point in combination with Britain&#39;s legacy of maritime domination (prowess) and the lack of any BETTER (any longitudinal point is equally suitable- all 360 degrees could each also be moved by a matter of minutes or seconds with no ill effect, provided they all moved equally). Longitude 180 (International Date Line theoretical location) is in fact nothing more than the opposite of 0 (which makes it also 0).

        To put the above into plain :huh: English, if you wanted to begin your own coordinate system, you would be well served by putting your current location at 0 longitude, and by drawing an imaginary line straight through the earth&#39;s polar axis to the longitudinal plane just opposite, and calling that the &#39;other&#39; 0, or 180 degrees. This is in fact similar to methods used by navigators to determine their location before the advent of GPS, etc.

        Or, if you were doing a coordinate sytem for -around-the-world UFO races, you might want to extend the longitudinal coordinates to 7200 degrees, which would account for a mofoflyslo getting lapped at any point in a 20 lap race-

        Latitude does not work in the same way (latitude carries consistent physical characteristics of earth/sun relationship and definite position related to physical points around which the earth spins - it gets a bit more complicated to discuss polar drift, etc- so I won&#39;t even try).
        **Edit- Please note that I am oversimplifying things here in that i am not discussing differences between magnetic and true north, etc. ALSO, the Z axis is a topic for another day . . .

        What is a little confusing is the fact that we have 360 degrees of longitude and only 180 degrees of latitude, both of these being split into equal halves, and numbers-wise each half is the mirror of the other. But in latitude, we get more than just numerical mirroring, we also get physical mirroring which does not occur in the longitude. To make matters worse, the &#39;axis&#39; with no physical mirroring additionally contains 360 degrees, which is perhaps the opposite situation of what we might have expected.

        In an attempt to somewhat mitigate the apparent inequality in degree distribution between &#39;x and y&#39;, longitude was arbitrarily split into hemispheres, but things are a little different.

        This is the difference (aside from a remaining issue of double number degrees lon as exists with lat):

        You can only go North (the same applies to going South) for so long. When you go north and hit maximum North = North pole= NORTH, you either stop at the pole (having arrived at the LIMIT of North), or you move in any direction which by nature and definition becomes (or is) &#39;south&#39; of NORTH. If you continue in any straight line from NORTH long enough, you will not only be (instantly) located &#39;south of NORTH, and heading South, but eventually, you will arrive at SOUTH, from which ALL points are north, all directions are North, and the final destination of all straight lines is NORTH.

        AND, 90 degrees North is ALWAYS 90 degrees North (or NORTH). It never (to my knowledge) has been (and likely never will be) simultaneously 90 degrees North and South

        With longitude, you can simultaneously be at 180 degrees east and 180 degrees west (in fact, if you are at 180 degrees longitude, you are ALWAYS at BOTH 180 degrees W and 180 degrees E). In this case, it should go without saying that you will cross the same line whether you head West or East, and if you begin at 0 degrees, either direction will be the same distance of travel. In other longitudinal sectors, the distances change proportionately for travel in each direction to 180 degrees set longitude. In other words, if you are at 10 degrees East, heading East to 180 will mean a distance of 170 degrees, while heading West will require 190 degrees of travel to arrive at the same 180 degrees. So, you can head East to go West, and vice-versa.

        HOWEVER, you cannot EVER ARRIVE at WEST, or EAST, because they simply do not exist.
        AND, you cannot head North to go South, without heading South after you get to NORTH.

        There is one remaining issue to clear up (well, a few more than one, but one that I will try for the moment):
        Why 180 degrees of latitude, but a full 360 degrees of longitude??? Good question, and one that will get a short and lousy answer which will hopefully suffice.

        --Since we have poles, NORTH and SOUTH are defined limits, and they exist as the full range of y coordinates along a 360 degree x coordinate spin (around the y axis). Mapping the &#39;other side&#39; would be both redundant and inaccurate. Although I suppose it could be arbitrarily done if you wanted a &#39;mirror&#39; map.

        This all may seem like a waste of breath. You knew all this, right? And some of it is, perhaps, just playing with words.

        But this is why sailors in distant times had an idea of where they were (if they couldn&#39;t follow stars), and why longitude couldn&#39;t be properly (even then, as I said, it is arbitrary) calculated until a couple of hundred years ago when a reliable method of determining distance travelled &#39;horizontally&#39; became available in the form of accurate clocks.

        And this is also why the difference in formula, AND why there would NOT be an equal number of rows to columns, when representing the entire earth in square tiles. One hemisphere (E or W) would work out like this, but to represent the entire earth you would have double the width of whatever is your height (or use tiles of 512x256 to get equal number of columns and rows). [OR use a crazy projection which would distort everything hopelessly]

        I know that nobody asked :unsure: for this poor excuse for a geography lesson, but maybe it will help someone avoid confusion on this matter. If anyone wishes to add to this rather incomplete explanation, or point out any errors in my logic/argument, please do so.

        And if I simply managed to make people MORE :blink: confused, I apologize (blame it on my lack of proper mathematical training- a common problem in the US) :(

        And, finally, if anyone thinks this discussion was interesting (my long-winded description of x and y), I would be happy to try and dig up some links to coherent explanations of the earth&#39;s coordinate systems . . . [or search google, etc. for coordinate systems or map projections- these should help you locate some basic info on understanding the problems inherent in mapping the globe]



        Originally posted by Osumi@Mar 17 2005, 04:09 PM
        Ok this is the answer to my previous question:

        I tried to determine how many tiles were used in the Landsat lvl4 vertical axis by navigating the world and then looking at the cache folders created

        Seems that WW 1.3 uses 64 rows for 90° that makes 256 rows for the whole world in the vertical axis, and since the tiles are square i will asume 256 columns are used horizontally.

        That makes each tile 1.40625° in height and width. Now, i just found out then that the formula to apply for Landsat lvl 4 tiles is:

        lat = row * (0.140625) - 90
        lon = col * (0.140625) - 180

        that gives the bottom left corner lat and long
        An excellent map projection reference


        • #34
          Very interesting barnacle9.


          • #35
            Thanks, Bull-

            I am afraid I skipped quite a few important topics, if this were to be what I consider somewhat complete.

            But it is an interesting subject, and hopefully someone will actually find it useful. If not useful, I would settle for &#39;entertaining&#39;.

            An excellent map projection reference


            • #36
              I just updated my posting to this thread, by including a brief explanation of Great Circles. I am replying to it so that anyone interested can see that it is updated - not sure if that was necessary, but oh well . . .
              An excellent map projection reference


              • #37
                I just drove through the Ozarks last weekend and I would have killed to have GE or WW handy to tell me what I was driving past. [img]style_emoticons/<#EMO_DIR#>/smile.gif[/img]


                • #38
                  Originally posted by cmaxwell View Post
                  Here&#39;s the code that I use to name files. Source Lat and Lon is the Lower-Left corner of the image:

                  public static int GetRowFromLatitude(float latitude, float tileSize)
                  return (int)System.Math.Floor((System.Math.Abs(-90.0 - latitude)%180)/tileSize);

                  public static int GetColFromLongitude(float longitude, float tileSize)
                  return (int)System.Math.Floor((System.Math.Abs(-180.0 - longitude)%360)/tileSize);

                  Hope that helps.
                  How do I acquire the tileSize variable?


                  • #39
                    Also, I assume that this.getAlignmentY() is how I acquire the latitude value correct?