POV-Ray : Newsgroups : povray.general : POVEarth: how to calculate latitude from distance to the equator? Server Time
23 Dec 2024 12:02:42 EST (-0500)
  POVEarth: how to calculate latitude from distance to the equator? (Message 1 to 4 of 4)  
From: Jörg "Yadgar" Bleimann
Subject: POVEarth: how to calculate latitude from distance to the equator?
Date: 10 May 2018 17:18:02
Message: <5af4b70a$1@news.povray.org>
Hi(gh)!

This is not a truly POV-Ray-related question, but rather a geographical 
one... it seems to be hopeless to google for it, so I try it here.

The problem: UTM data tiles provide only grid-east and grid-north 
values, usually in metres. When reading in those data from ASCII files, 
I need to know an algorithm to calculate latitudes and longitudes. For 
example:

32342000.00,5658000.00,45.11 (one measuring point)

The value in the first column is grid-east (longitude) and first has to 
be clipped to 342000.00 (the "32" indicates the UTM zone) and then 
500000.00 has to be subtracted, which translates to -158000 metres east 
(i. e. 158000 metres west) from the reference meridian, which is 9° E.

The second column contains the distance to the equator (grid-north) - 
but as due to the Earth's flattening, latitudes are not equally spaced, 
I have no clue how to calculate the accurate latitude from something 
like 5658000.00 - and seemingly, in the entire Internet, only automatic 
calculation services can be found, but not the very algorithm!

Should I better content myself with stupid flat landscapes not following 
the curvature of Earth and derived from manually pixeled topographic maps?

Programming hurts!!!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Bald Eagle
Subject: Re: POVEarth: how to calculate latitude from distance to the equator?
Date: 10 May 2018 20:00:00
Message: <web.5af4dc5bf8e52e8510874a080@news.povray.org>
=?UTF-8?Q?J=c3=b6rg_=22Yadgar=22_Bleimann?= <yaz### [at] gmxde> wrote:
> Hi(gh)!
>
> This is not a truly POV-Ray-related question, but rather a geographical
> one... it seems to be hopeless to google for it, so I try it here.

https://lite.qwant.com/?q=convert+from+latitude+to+distance&client=opensearch

https://gis.stackexchange.com/questions/91865/how-to-convert-distance-into-latitude-longitude

http://www.movable-type.co.uk/scripts/latlong.html

https://stackoverflow.com/questions/238260/how-to-calculate-the-bounding-box-for-a-given-lat-lng-location

.....


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: POVEarth: how to calculate latitude from distance to the equator?
Date: 10 May 2018 21:21:38
Message: <5af4f022$1@news.povray.org>
Hi(gh)!

On 11.05.2018 01:57, Bald Eagle wrote:

> https://lite.qwant.com/?q=convert+from+latitude+to+distance&client=opensearch
> 
>
https://gis.stackexchange.com/questions/91865/how-to-convert-distance-into-latitude-longitude
> 
> http://www.movable-type.co.uk/scripts/latlong.html
> 
>
https://stackoverflow.com/questions/238260/how-to-calculate-the-bounding-box-for-a-given-lat-lng-location

Too complicated for my feeble brain... I just once more gave in to 
pixeling away another three, four or five years of my life, using 
OpenTopoMaps and OpenStreetMaps, which both are just classical 
Mercator's projections, which I'm able to handle mathematically!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: Jörg "Yadgar" Bleimann
Subject: Re: POVEarth: how to calculate latitude from distance to the equator?
Date: 13 May 2018 08:20:11
Message: <5af82d7b@news.povray.org>
Hi(gh)!

On 11.05.2018 03:23, Jörg "Yadgar" Bleimann wrote:
> Hi(gh)!
> 
> On 11.05.2018 01:57, Bald Eagle wrote:
> 
>> https://lite.qwant.com/?q=convert+from+latitude+to+distance&client=opensearch 
>>
>>
>>
https://gis.stackexchange.com/questions/91865/how-to-convert-distance-into-latitude-longitude

>>
>>
>> http://www.movable-type.co.uk/scripts/latlong.html
>>
>>
https://stackoverflow.com/questions/238260/how-to-calculate-the-bounding-box-for-a-given-lat-lng-location

>>
> 
> Too complicated for my feeble brain... I just once more gave in to 
> pixeling away another three, four or five years of my life, using 
> OpenTopoMaps and OpenStreetMaps, which both are just classical 
> Mercator's projections, which I'm able to handle mathematically!

Meanwhile, I installed the proj-bin package for Debian, a positively 
ancient piece of Unix software dating back to pre-Linux days... and with 
the "invproj" command line tool I'm finally able to convert UTM into 
geographic coordinates!

Here is what the original data (available under 
https://www.opengeodata.nrw.de/produkte/geobasis/dgm/dgm1/, I downloaded 
the Cologne (Köln) data file) looked like - for convenience just a 5 by 
5 slice from the original 2000 by 2000 measuring points (spaced 1 meters):

32342000.00 5658000.00 45.11
32342000.00 5658001.00 45.20
32342000.00 5658002.00 44.96
32342000.00 5658003.00 44.59
32342000.00 5658004.00 44.40
32342001.00 5658000.00 45.16
32342001.00 5658001.00 45.13
32342001.00 5658002.00 45.00
32342001.00 5658003.00 44.67
32342001.00 5658004.00 44.45
32342002.00 5658000.00 45.11
32342002.00 5658001.00 45.13
32342002.00 5658002.00 45.09
32342002.00 5658003.00 44.75
32342002.00 5658004.00 44.48
32342003.00 5658000.00 45.11
32342003.00 5658001.00 45.11
32342003.00 5658002.00 45.12
32342003.00 5658003.00 44.79
32342003.00 5658004.00 44.45
32342004.00 5658000.00 45.10
32342004.00 5658001.00 45.10
32342004.00 5658002.00 45.16
32342004.00 5658003.00 44.87
32342004.00 5658004.00 44.53

The first column contains the right (or east) value in meters, relative 
to the reference meridian of Cologne's UTM zone. In UTM projection, the 
Earth's surface is divided into 60 meridional zones, each one 6 degrees 
wide and numbered, beginning with 180°W. Cologne's UTM zone is 32, with 
9°E being the reference meridian. To avoid negative right values, the 
reference meridian in any zone is given the arbitrary value of 500000 
(so-called "false easting").

The second column contains the distance to the equator, i. e. the high 
(or north) value; the third column is the elevation in meters above sea 
level, which will pass unaltered through the following operations.

As the first column data are concatenated with the zone number (32), in 
each line the first two characters have to be removed. I did this with 
the powerful Unix editor tool sed:

sed -e 's/^32//g' testtile > testtile_no32

...and voilà:

342000.00 5658000.00 45.11
342000.00 5658001.00 45.20
342000.00 5658002.00 44.96
342000.00 5658003.00 44.59
342000.00 5658004.00 44.40
342001.00 5658000.00 45.16
342001.00 5658001.00 45.13
342001.00 5658002.00 45.00
342001.00 5658003.00 44.67
342001.00 5658004.00 44.45
342002.00 5658000.00 45.11
342002.00 5658001.00 45.13
342002.00 5658002.00 45.09
342002.00 5658003.00 44.75
342002.00 5658004.00 44.48
342003.00 5658000.00 45.11
342003.00 5658001.00 45.11
342003.00 5658002.00 45.12
342003.00 5658003.00 44.79
342003.00 5658004.00 44.45
342004.00 5658000.00 45.10
342004.00 5658001.00 45.10
342004.00 5658002.00 45.16
342004.00 5658003.00 44.87
342004.00 5658004.00 44.53

Now the UTM coordinates can be converted to geographic coordinates, and 
as I want to have the resulting ASCII file processed by a POV-Ray 
script, I prefer output in decimal form rather than degrees-minutes-seconds:

invproj +proj=utm +zone=32 -f %.9f testtile_no32 > testtile_degrees

Here we go:

6.745681594	51.051771388 45.11
6.745681158	51.051780374 45.20
6.745680721	51.051789359 44.96
6.745680285	51.051798344 44.59
6.745679848	51.051807330 44.40
6.745695850	51.051771663 45.16
6.745695414	51.051780649 45.13
6.745694977	51.051789634 45.00
6.745694541	51.051798620 44.67
6.745694104	51.051807605 44.45
6.745710106	51.051771938 45.11
6.745709670	51.051780924 45.13
6.745709233	51.051789909 45.09
6.745708797	51.051798895 44.75
6.745708360	51.051807880 44.48
6.745724362	51.051772213 45.11
6.745723926	51.051781199 45.11
6.745723489	51.051790184 45.12
6.745723053	51.051799170 44.79
6.745722616	51.051808155 44.45
6.745738618	51.051772488 45.10
6.745738182	51.051781474 45.10
6.745737745	51.051790459 45.16
6.745737309	51.051799445 44.87
6.745736872	51.051808430 44.53

Afterwards, I will use sed once more to replace the tabs and spaces by 
commas, as well as adding a comma at the end of each line - and then 
programming ultra-high resolution terrain reliefs with POV-Ray can 
begin! I wish I had such accurate data for Afghanistan...

Watch out for the first OpenCologne terrain views in the next few weeks!

See you in Khyberspace!

Yadgar


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.