Coder Social home page Coder Social logo

Lat/lng representation about taui HOT 5 CLOSED

trevorgerhardt avatar trevorgerhardt commented on June 28, 2024
Lat/lng representation

from taui.

Comments (5)

mattwigway avatar mattwigway commented on June 28, 2024

https://twitter.com/tmcw/status/598605684477943808

from taui.

trevorgerhardt avatar trevorgerhardt commented on June 28, 2024

I'm going to create a helper, but it's going to be based on variable/function names.

Rules:

  1. Anything named coordinates will look like [${longitude}, ${latitude}]
  2. Anything named latlng will look like { lat:${latitude},lng:${longitude} }.
  3. The reverse [${lat}, ${lng}] SHALL NEVER BE USED.
  4. The shorthand lon SHALL NEVER BE USED.
  5. If the reverse or lon need to be used for external libs, never store in a variable, convert on input/output.

from taui.

mattwigway avatar mattwigway commented on June 28, 2024

Sounds good. It may take a while for me to get into the habit of writing
lng instead of lon but I'll do my best. Completely agreed that it should
always be [longitude, latitude].

On Wed, Dec 30, 2015 at 8:57 PM, Trevor Gerhardt [email protected]
wrote:

I'm going to create a helper, but it's going to be based on
variable/function names.

Rules:

  1. Anything named coordinates will look like [${longitude},
    ${latitude}]
  2. Anything named latlng will look like {
    lat:${latitude},lng:${longitude} }.
  3. The reverse [${lat}, ${lng}] SHALL NEVER BE USED.
  4. The shorthand lon SHALL NEVER BE USED.
  5. If the reverse or lon need to be used for external libs, never
    store in a variable, convert on input/output.


Reply to this email directly or view it on GitHub
#8 (comment).

Matthew Wigginton Conway [WIG-in-tun CON-way]
Transportation Analytics/Open Source
Washington, DC

from taui.

trevorgerhardt avatar trevorgerhardt commented on June 28, 2024

x/y should be called points and should be an object. point.x, point.y. So...

originCoordinate should look like [70.01232, 38.13234]
originLatLng should look like { lat: 38.13234, lng: 70.01232 }
originPoint should look like { x: 70.01232, y: 38.13234 }

These rules need to be followed for function inputs and return values and object properties but not 100% necessary if contained.

from taui.

trevorgerhardt avatar trevorgerhardt commented on June 28, 2024

Added ll.js, to be abstracted out on it's own at a later date.

from taui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.