mapbox / csv2geojson

magically convert csv files to geojson files
http://mapbox.github.io/csv2geojson/
MIT License
363 stars 82 forks source link

Allow degrees and seconds in lon/lat fields #13

Closed Fil closed 11 years ago

Fil commented 11 years ago

Examples:

tmcw commented 11 years ago

Cool, but can we go all the way and support seconds and minutes?

Fil commented 11 years ago

Oh yes in fact I think I meant "degrees and minutes" (blush).

Here's a more complete commit, following what Wikipedia says:

for example, 40.1875° = 40° 11′ 15″ . Sometimes single and double quotation marks are used instead: 40° 11' 15"

(with NS and WE of course)

And I wonder about what the degree symbol will be in the field. I chose a utf-8 "°" but maybe there are variants?

tmcw commented 11 years ago

Hm, so I guess I mean seconds. I implemented something like this back in this: https://github.com/tmcw/coords/blob/master/index.js#L2-L11 but am not super confident in it. Speaking of which, this will need tests :)

Fil commented 11 years ago

I don't see how these tests work but if you write one I will follow and write the others.

Your code in coords looks fine but does not allow for ’’ and '' (two simple quotes, curly or not).

tmcw commented 11 years ago

Merged and refactored into 0e9a0559c20dd4bb2aac14f5b717fdbde325c296 + https://github.com/tmcw/sexagesimal

Fil commented 11 years ago

Thanks!