Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: CoordConversions NPM Module for Map Coordinate Conversions (github.com/matthewcsimpson)
8 points by smatthewaf 72 days ago | hide | past | favorite | 2 comments
I have been working on a project that has multiple repos, all of which have to convert between multiple map coordinate types, so I made an NPM module that allows you to parse and convert between Decimal Degrees, Degrees-Minutes, and Degrees-Minutes-Seconds coordinate types. Niche? Yes. Useful? Also yes (I hope)!


Nice library. Without trying to start the classic geo-flamewar, do you consider returning the DD coordinates as [longitude, latitude]? This is in line with a number of formats out there, including the popular GeoJSON that is often used in JavaScript apps.

Getting these backwards is a common frustration, so my vote would be for Lon/lat ordering.

Regardless of which you choose, I find DD to be quite cryptic and it would be nicer to spell out the order, eg parseToLonLat - then the order is clear to the user


Sorry for the late reply! To be honest I hadn't considered it because when I wrote this it was originally to solve a specific problem and that situation always has them in lat/lon rather than lon/lat, but what I'll add to the future to do list is maybe a toggle so if you have them in lon/lat order you can society that and feed them in that way.

I get your point on "DD" being cryptic, I will consider that. Maybe rather than DD, DM, DMS, DecDeg, DegMin, DegMinSec or something slightly more descriptive. Hm.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: