Jump to content

 
Photo

convert latitude/longitude to x/y in image

- - - - -

  • Please log in to reply
4 replies to this topic

#1
brian314

brian314

    Newbie

  • Validated Member
  • Pip
  • 6 posts
  • No Country Selected

I have an image of a map thought to have been made using LCC. I'm confused about how to convert latitude/longitude pairs to x/y pairs in this image.

$ cat test

cs2cs \

  +proj=longlat +ellps=WGS84 +datum=WGS84 \

  +to \

  +proj=lcc +lat_0=85 +lat_1=20 +lat_2=60 +lon_0=-98 +x_0=0 +y_0=0 +units=m \

  <<EOF

-109.045172 36.998976

EOF

$ sh test

-923284.04	  -5772396.54 0.00

These coordinates seem to represent distances in meters, but from what? I don't see how to convert them into the image's rectangular coordinate system. Thanks for any help.

#2
jrat

jrat

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 143 posts
  • Gender:Male
  • Location:Hagerstown, MD
  • United States

So I do all my work in ArcGIS which takes care of all of the math for me so I can't be of help if you are trying to calculate the projection yourself. But, I would suggest doing some google searches on Lambert Conformal Conic projection. There is alot of information on that projection out there. This is my guess at what your data is looking like. Your datum is WGS84 Using the Lambert conformal conic projection. your Lat0 and Lon0 represent your false origin. lat_1 and lat_2 are your standard parallels. the -109.045172 36.998976 from your post are probably lat and log coordinates in decimal degrees and not meter distances.

If you want help doing the math I did find this site.
http://www.linz.govt...onic/index.aspx

#3
brian314

brian314

    Newbie

  • Validated Member
  • Pip
  • 6 posts
  • No Country Selected

Good page, thanks. I was trying to use Proj.4 stuff to do it, but maybe that's actually more confusing. I'll implement the conversion described on that page and report back if I still can't make it work. Thanks.

#4
brian314

brian314

    Newbie

  • Validated Member
  • Pip
  • 6 posts
  • No Country Selected

OK, I implemented lat/lon conversion to LCC today and verified it using cs2cs from Proj.4.

So now I have some northing/easting pairs I would like to plot on an image. But I don't understand how to relate my northing/easting coordinates to x/y coordinates in my image.

#5
brian314

brian314

    Newbie

  • Validated Member
  • Pip
  • 6 posts
  • No Country Selected

Hi, I've been able to make some fairly accurate plots, but I'm still off. Please check my understanding and method.

Here are my conversion parameters in Proj.4 notation:
+proj=longlat +ellps=WGS84 +datum=WGS84

+to

+proj=lcc +lat_0=85 +lat_1=20 +lat_2=60 +lon_0=-98 +x_0=0 +y_0=0 +units=m

+a=6378137 +rf=298.257223563 +no_defs

Northing seems to be 0 at lat 85, lon -98. The map looks like a fan, and that's the corner. Northing becomes more and more negative as latitude decreases.

Easting seems to be relative to lon -98. It's positive on the east side and negative on the left.

When I plot a point in my image, how do I decide how many pixels there are per meter? My map image's left and right edges are approximately lon -129 and lon -76 respectively. Its top and bottom edges are approximately lat 60 and lat 20. To calculate the number of pixels per meter of easting, I have been using the number of meters between the points of the lower two corners, -129/20 and -76/20. This seems to work somewhat, but I doubt it's the correct way to do it.

Thanks for any help!




6 user(s) are reading this topic

0 members, 6 guests, 0 anonymous users

-->