Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

longitude with exponents are misinterpreted #25

Closed
ziodave opened this issue Sep 21, 2014 · 4 comments
Closed

longitude with exponents are misinterpreted #25

ziodave opened this issue Sep 21, 2014 · 4 comments

Comments

@ziodave
Copy link

ziodave commented Sep 21, 2014

I have a CSV such as the following

label,latitude,longitude
House,4.7161357378478E1,1.27381324768066E1
...

The output after conversion is:

    {
        "type": "Feature",
        "properties": {
            "label": "House"
        },
        "geometry": {
            "type": "Point",
            "coordinates": [
                1.27381324768066,
                47.161357378478
            ]
        }
    }

As you can see the latitude is correctly interpreted, while the longitude sees its exponent dropped.

I traced down the issue being in lines 101-102 of csv2geojson.js:

        a = sexagesimal(lonk, 'EW');
        if (a) lonk = a;

lonk is turned from 1.27381324768066E1 to 1.27381324768066.

@ziodave
Copy link
Author

ziodave commented Sep 21, 2014

In sexagesimal.js E is most probably interpreted as cardinal direction.

@tmcw
Copy link
Contributor

tmcw commented Sep 21, 2014

What kind of system outputs numbers formatted like this?

@ziodave
Copy link
Author

ziodave commented Sep 21, 2014

Not sure, this is how data is provided to me.

@tmcw
Copy link
Contributor

tmcw commented Sep 21, 2014

I don't think it's really possible to decipher between this case and people actually wanting 'east' coordinates: the input to csv2geojson should be either decimal numbers, or sexagesimal notation. Handling alternative forms of formatting for decimals will only make it ambiguous.

If your case, you can probably just find & replace E1 with nothing in the file.

@tmcw tmcw closed this as completed Sep 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants