From: Bowen GS12 Randall L To: 'jnstone@U.WASHINGTON.EDU' Subject: RE: lat/long from a projected view Date: Tuesday, April 13, 1999 6:49 AM Jenny, I must have missed your orginal post. You may all ready have an answer to your problem but I will include my script anyway (it's very short). I needed to do the same thing you were asking about, except with UTM zone 18. The script displays Lat/Lon information on the status bar. I have a couple more, one that will display Lat/Lon, Decimal Degrees and UTM in a message box and one that displays continuous Lat/Lon on the satus bar as you move the cursor. If you would like a copy of these just let me know. This script works fine for me..hope you can use it. ------------------------------ 'Displays Lat/Long on Status Bar 'Change projection to Transverse Mercator Zone 18 theView = av.GetActiveDoc t = TransverseMercator.Make (theView.ReturnExtent) t.SetSpheroid(#SPHEROID_GRS80) t.SetCentralMeridian(-75) t.SetReferenceLatitude(0) t.SetScale(0.9996) t.SetFalseEasting(500000) t.SetFalseNorthing(0) t.Recalculate 'Set to return points for user click theProjection = t p = theView.GetDisplay.ReturnUserPoint 'Convert user click to: 'Decimal Degrees p_dd = p.returnUnprojected(theProjection) if (p_dd.GetX < 0) then longHem = " W" else longHem = " E" end if (p_dd.GetY <0) then latHem = " S" else latHem = " N" end 'Degrees Minutes Seconds AsciiRef = 0176 AsciiRef2 = 0180 AsciiRef3 = 0168 x = p_dd.GetX.Abs x_d = x.truncate x_m = ((x-x_d)*60).truncate x_s = ((x-x_d)*60 - x_m)*60 x_dms = x_d.AsString+(AsciiRef.AsChar)++x_m.AsString+(AsciiRef2.AsChar)++x_s.AsStrin g+(AsciiRef3.AsChar) y = p_dd.GetY.Abs y_d = y.truncate y_m = ((y-y_d)*60).truncate y_s = ((y-y_d)*60 - y_m)*60 y_dms = y_d.AsString+(AsciiRef.AsChar)++y_m.AsString+(AsciiRef2.AsChar)++y_s.AsStrin g+(AsciiRef3.AsChar) theMsg = ""+ y_dms ++ latHem + ", " ++ x_dms ++ longHem"" av.ShowMsg(theMsg) ----------------------------------------- I would like to have copies of the scripts which were sent to you. I'm always looking for ways to improve/shorthen my scripts and have found that I can learn a great deal from others' work. Thanks, -Randy Randall L. Bowen DATCO/CALO MCAS New River PSC Box 21001 Jacksonville, NC 28545-1001 Comm: 910.450.6657/6580 DSN: 750.XXXX Fax: 910.450.6695 E-mail: bowenrl@newriver.usmc.mil -----Original Message----- From: "SMTP1@SMTP1@MCB LEJEUNE[\"Jenny Stone\" ]"@clb.usmc.mil [mailto:"SMTP1@SMTP1@MCB LEJEUNE[\"Jenny Stone\" ]"@clb.usmc.mil] Sent: Tuesday, April 06, 1999 7:25 PM To: "SMTP1@SMTP1@MCB LEJEUNE[]"@clb.usmc.mil Subject: SUM: lat/long from a projected view Thanks to everyone that responded. I received a few suggestions and several modifiable scripts, which don't lend themselves to inclusion in one big email file. If you'd like copies of the scripts, let me know and I'll send them to you individually. Original question: > Hi all. I'm working with data in a projected view (DRGs in UTM zone 10, for > example). I'd like to be able to get the lat/long of a point returned from > the cursor. Does anyone have an existing (modifiable) script that does this, > or know of another way to do it? Thanks. Jenny Stone ___________________________________ GIS Librarian * Map Collection University of Washington Libraries Box 352900 * Seattle, WA 98195-2900 phone: 206.543.9392