question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switch to Longitude-Latitude for coordinates?

See original GitHub issue

In quite a few places I’m looking at APIs that are built for GeoJSON input and output and having to flip coords and reconstruct bounding boxes for Leaflet to read. Changing Leaflet’s APIs to all do things the GeoJSON way would be (wonderful but) a big, breaking change. Having them all autodetect would be error-prone, and having an is_geojson argument to lots of functions would be lame.

Maybe GeoJSON everywhere is something to think about in 1.0.0, and a global flag, L.GEOJSON_API might be a better near-term goal for the [lat, lon] shortcut to be [lon, lat], for toJSON methods to return GeoJSON, and for bounds to be represented and usable as GeoJSON bounds.

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Reactions:7
  • Comments:22 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
ghybscommented, Apr 29, 2018

Just for reference, since this issue seems to become the main justification: https://macwright.org/lonlat/ screenshot_20180429_225744

Which is right? Neither. This is an opinion with no right answer. Geographical tradition favors lat, lon. Math and software prefer lon, lat.

3reactions
perliedmancommented, Jul 7, 2017

@lukedohner use the builtin GeoJSON layer, it works out of the box with coordinates that follow the GeoJSON spec (lon/lat).

If you really need to flip the axis, there are several ways to go about it, one is to use reproject’s reverse function.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PGC Coordinate Converter - Polar Geospatial Center
Enter values into the coordinate tool and the values will automatically update. For decimal degrees ... Latitude (-90 to 90) and longitude (-180...
Read more >
Convert Coordinates - Earth Point
Enter latitude/longitude or position. Click the corresponding "Calc" button. Lat/Lon, UTM, UPS, MGRS, USNG, GARS, Plus Codes, what3words, Georef, ...
Read more >
Get Lat Long from Address Convert Address to Coordinates
A handy tool to get lat long from address, helps you to convert address to coordinates (latitude longitude) on map, also calculates the...
Read more >
How to Convert Latitude and Longitude to Map Coordinates
Community Mapping Experiment: How to Convert Latitude and Longitude to Map Coordinates ; Step 1: Degrees × 60 = 71 × 60 =...
Read more >
Degrees Minutes Seconds to/from Decimal Degrees
This tool permits the user to convert latitude and longitude between decimal degrees and degrees, minutes, and seconds.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found