Giter VIP home page Giter VIP logo

Comments (17)

jdroenner avatar jdroenner commented on May 22, 2024 2

You are right, for geographic coordinates lat/lon are very useful. But there are also non-geographic (e.g. projected) spatial coordinates where lat/lon makes no sense.
I think that each algorithm should only use one of them and generic algorithms should only use x/y.

from geo.

urschrei avatar urschrei commented on May 22, 2024 1

@Indy2222 This feature exists in the form of the optional Project and Convert traits, see #192 (note that the MapCoordsFallible trait has become TryMapCoords. As of now, the vast majority of Geo's functionality is predicated on planar coordinates (or coordinates in planar projections), which is signalled by the use euclidean for clarity where necessary, and haversine for e.g. spherical coordinates.

from geo.

frewsxcv avatar frewsxcv commented on May 22, 2024 1

How do people feel about dropping the lng and lat methods? Would that be a satisfying resolution here?

from geo.

frewsxcv avatar frewsxcv commented on May 22, 2024 1

Great, let's deprecate them then with the plan to remove them in a future breaking change release.

from geo.

TeXitoi avatar TeXitoi commented on May 22, 2024

What do you propose? removing getter/setter lat/lon?

I think that these getter/setter are very useful. Else, when we work with geographical coordinates, using x and y is very error prone.

from geo.

frewsxcv avatar frewsxcv commented on May 22, 2024

Does anyone know what similar libraries use? (e.g. go.geo, OGR, etc.)

from geo.

TeXitoi avatar TeXitoi commented on May 22, 2024

@jdroenner I agree with that

from geo.

jdroenner avatar jdroenner commented on May 22, 2024

JTS uses x,y (z)
The OGC Simple Feature Access also defines points as x,y (z).
The OGC spec is implemented in most database systems (Oracle, SQL Server, PostGIS, Mysql).

from geo.

TeXitoi avatar TeXitoi commented on May 22, 2024

boost geometry use

double x = bg::get<0>(point);
double y = bg::get<1>(point);

As you should implement that for your own struct, you can use whatever you want.

from geo.

jdroenner avatar jdroenner commented on May 22, 2024

We could change Coordinate to be a tuple to get .0 and .1 ;)

from geo.

TeXitoi avatar TeXitoi commented on May 22, 2024

@jdroenner please no ;)

from geo.

frewsxcv avatar frewsxcv commented on May 22, 2024

I'm fine with x, y, lng, lon, lat. I'm against .0 and .1 because it's not obvious if the user is dealing with longitude, latitude or latitude, longitude.

from geo.

frewsxcv avatar frewsxcv commented on May 22, 2024

Relevant: http://www.macwright.org/lonlat/

from geo.

jdroenner avatar jdroenner commented on May 22, 2024

Well i guess the important part is to not mix x/y and lat/lon. Can we enforce this somehow?

@frewsxcv web based GIS is an area where very strange things happen ;) The axis ordering in WMS was switched between two versions and this is still confusing.

from geo.

Indy2222 avatar Indy2222 commented on May 22, 2024

It would be nice if geometries could be projected between different spacial reference systems (#32) in which case lat() and lon() would have to be projected to WGS84 SRS. For example a hypothetical GIS GUI may need to project geometries to Web Mercator [and its pixel coordinates] to draw them as overlay of a map. For example see GeoJSON.io.

I personally prefer attitude where geometric libraries are coordinate system agnostic (i.e. it behave like the coordinates are Cartesian) and doesn't force users to use any specific projection. For example if one needs accurate but local SRS she can use UTM zone, etc. Different projections are good for different purposes and from my experience its best to separate geometrical library and projection library from each other. I this context lon(), lat() getters stay in the way.

from geo.

urschrei avatar urschrei commented on May 22, 2024

I think so. The only potential users of lat / lng I can think of might be the CanalTP people, just because it's an older codebase. In any case, we could deprecate with a "we'll be dropping this in 1.0" message?

from geo.

frewsxcv avatar frewsxcv commented on May 22, 2024

#710

from geo.

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.