S
S
s4q2022-03-07 21:02:26
Python
s4q, 2022-03-07 21:02:26

How to convert latitude and longitude to x and y with a certain limit on x and y resolution?

Let's say we have a list:

a = ['()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()']
b = ['()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()']
c = ['()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()']
d = ['()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()']
e = ['()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()', '()']
coordinates = [a, b, c, d, e]

Imagine that this is a conditional map of the world, I want to select the desired list item by geographical coordinates.
That is, I want to convert latitude and longitude to XY, where x = list item (the width of the list obtained from the coordinates list by y - height).
That is, such a "matrix" with a height of 5 and a width of 12 (these are restrictions)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Zagaevsky, 2022-03-07
@s4q

Mercator projection + integer division

F
freeExec, 2022-03-08
@freeExec

What's the problem with dividing 360 by 12 and 180 by 5 and filling out your lists.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question