Initial guidance needed on mapping longitude and latitude to the x,y coordinates of an image.

Discussion in 'Java' started by Penn, Jul 6, 2007.

  1. Penn

    Penn Guest

    I have an image of a map and want to correlate latitude and longitude
    to the x,y of the image. Is there a way to input a few points into a
    mapping algorithm and then have it map the entire image? Is there a
    java library dedicated to just this or some code that someone can
    guide me to???

    Thanks!
     
    Penn, Jul 6, 2007
    #1
    1. Advertising

  2. Penn

    ~kurt Guest

    Penn <> wrote:
    >
    > I have an image of a map and want to correlate latitude and longitude
    > to the x,y of the image. Is there a way to input a few points into a


    This is a very broad topic. It depends a lot on the map projection you
    have. Some are kind of complicated. The easiest one to deal with is
    probably the plate carrée.

    <http://en.wikipedia.org/wiki/Plate_carr%C3%A9e_projection>

    Bottom line, the first thing you have to determine is what projection
    the map you have is in.

    > mapping algorithm and then have it map the entire image? Is there a
    > java library dedicated to just this or some code that someone can
    > guide me to???


    I have no idea if there is one for Java. It is probably best to just
    compute it on the fly. A couple years ago, I had found an open source
    library in, I think it was C. It should be easy enough to google up.

    - Kurt
     
    ~kurt, Jul 7, 2007
    #2
    1. Advertising

  3. Penn <> burped up warm pablum in
    news::

    >
    > I have an image of a map and want to correlate latitude and longitude
    > to the x,y of the image. Is there a way to input a few points into a
    > mapping algorithm and then have it map the entire image? Is there a
    > java library dedicated to just this or some code that someone can
    > guide me to???


    Check out the mapping and GIS resources at http://gislounge.com/ll/javaandgis.shtml before beginning.

    --
    Tris Orendorff
    [Q: What kind of modem did Jimi Hendrix use?
    A: A purple Hayes.]
     
    Tris Orendorff, Jul 9, 2007
    #3
  4. Penn

    Sygsky Guest

    On Jul 7, 2:04 am, Penn <> wrote:
    > Is there a way to input a few points into a
    > mapping algorithm and then have it map the entire image?



    11-12 years ago I did something similar to your goal: bind cosmic
    photo to the geographical map.
    I used some method to create a polinomial equations of follow type:

    x = A+ B*x1 + C*y1 + D*x1*x1 + E*x1*y1 + F*y1*y1 + G*x1*x1*y1 +
    H*y1*y1*x1 + I*x1*x1*x1 + J*y1*y1*y1;

    y = K + L*x1 + M*y1 + N*x1*x1 + O*x1*y1 + P*y1*y1 + Q*x1*x1*y1 +
    R*y1*y1*x1 + S*x1*x1*x1 + T*y1*y1*y1;


    x,y are wanted new coordinates in the map(or photo - as you need) from
    a photo (or map) coordinates X1,Y1.

    Coefficients from A to T are generated by the technique of least
    squares in standard way. And, of course, you
    need a quantity of reference poins not less than number of
    coefficients. Also try to set referencies uniformly along the image.

    I worked well for a practical usage so could work for your goal.
    Deviations were near one pixel.
     
    Sygsky, Jul 9, 2007
    #4
  5. Penn

    Roedy Green Guest

    On Fri, 06 Jul 2007 22:04:28 -0000, Penn <> wrote,
    quoted or indirectly quoted someone who said :

    >I have an image of a map and want to correlate latitude and longitude
    >to the x,y of the image. Is there a way to input a few points into a
    >mapping algorithm and then have it map the entire image? Is there a
    >java library dedicated to just this or some code that someone can
    >guide me to???


    there are two basic flavours of problem.

    One is you have map of a municipality with roads, gas lines, telephone
    poles each on separate maps. When you overlay the maps you discover to
    your horror that they are out by hundreds of feet. You need a way of
    synching them together. What you do is find survey points and mark
    them on each of the maps. Then you use a sort of rubber sheet
    transform that drags these points to the proper points on your
    geographic grid. The points in between are interpolated. If this does
    not give you accurate enough overlay, you go out and survey some more
    points and mark them on your maps. Here we are treating the earth as
    if it were a flat plane.

    If you are mapping larger areas, the curvature of the earth comes into
    play, and even the elongation and even and its pear-shaped ness. There
    are dozens of co-ordinate systems for 2D and 3D mapping on the earth's
    surface. The math is pretty hairy to convert between systems, but it
    boils down to a lot of trigonometry.

    Normally you use a mapping package that does these sorts of
    transformations for you. Back in the 70s. Silicon Graphics was big in
    this area.

    Back then I got involved in photogrammetry for the local power
    utility analysing aireal photographs to create 3D maps of powerlines
    and "danger trees" monitoring when they might grow big enough to
    interfere with the lines."

    I was also involved in mapping pipes for the gas utility. I have not
    kept up on how it has evolved since.

    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Jul 9, 2007
    #5
  6. Penn

    Penn Guest

    Thanks to all for the help. Being that I wanted a 'quick and dirty'
    solution, I loved the suggestion from Sigsky and treated the mapping
    of x and y to longitude and latitude as two separate 3D problems. I
    solved for both of them and found that the fit for longitude performed
    very well with a polynomial and the fit for latitude worked better
    with a sinusoidal-type function. Both functions resulted in sub-pixel
    errors in the prediction of the latitude-longitude location in my
    image.

    Thanks!!!
     
    Penn, Jul 11, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. YS Sze
    Replies:
    4
    Views:
    663
    -berlin.de
    Feb 7, 2004
  2. helpneeded
    Replies:
    6
    Views:
    536
    Help needed
    Aug 1, 2006
  3. Replies:
    5
    Views:
    2,665
    Luc The Perverse
    Aug 14, 2006
  4. Replies:
    1
    Views:
    579
    Roedy Green
    Aug 13, 2012
  5. clusardi2k
    Replies:
    1
    Views:
    671
    Roedy Green
    Aug 13, 2012
Loading...

Share This Page