robbie is a user on mastodon.technology. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

Somebody here know shit about #geography? I have some code that translates latitude and longitude in degrees to x and y on a mercator projection.

Only issue is I have no clue what "unit" these results are in.

Documented code from a completely different programming language says "meters", but that doesn't even make any sense to me…

@phryk I love how they say "any use of the Mercator projection is strongly discouraged..."

So the unit is Mercator, which is meters from the meridian and equator. so x is meters from the meridian and y is meters from the equator.

What are you looking to accomplish? What issue is the format causing for you?

@robjloranger

I want is to place markers on an svg of a mercator projection map of the world.

So what I need is to convert that to x and y coordinates in percentages.

Meters still don't make any sense to me in this context tho…

Isn't every "meter" going to be slightly longer/shorter than the previous one due to the distortion of the projection?

@phryk It is, the farther away from each the Meridian and the equator. That's the downside to Mercator Projection.

@robjloranger

So if I'm getting this right…

Meridian and Equator meet at latitude 0 and longitude 0 and this is the very center of the map?

The values of X and Y can be negative?

X and Y have maximum possible values defined by the shape of our planet and I can use those to normalize my values?

@phryk

0,0 I _believe_ is the center of the map.

The values can be negative, not sure on direction. Is north positive or negative?

The Python code linked had the maximum and minimum being normalized in it. Should give you an idea there.

robbie @robjloranger

@phryk have you tried IRC, something like freenode might be a good start or

· Web · 0 · 0