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

Numeric fields examples #71

Open
intothenight opened this issue Jun 1, 2019 · 1 comment
Open

Numeric fields examples #71

intothenight opened this issue Jun 1, 2019 · 1 comment

Comments

@intothenight
Copy link

I struggled to utilize the numeric fields option in JavaScript until I realized it needed to be entered as “numericFields”. Posting this here in case someone else finds themselves in my situation. Could be clarified in the documentation, or with an HTML example where a numericFields is identified.

Thanks this is a great bit of code 👍👍

@tmlmt
Copy link

tmlmt commented Mar 4, 2021

Agree with you @intothenight. Just went through my own process to figure that out and just found out how to make it work.
The additional comment I would add is that the expected value is not a list, but a string with the numeric field names separated by a comma ',' without any space, as this line of code suggests:
https://github.com/mapbox/csv2geojson/blob/gh-pages/index.js#L106

An example can thus be:

csv2geojson.csv2geojson(csvString, {
    latfield: 'LATFIELDNAME',
    lonfield: 'LONFIELDNAME',
    delimiter: ',',
    numericFields: 'NUMFIELD1,NUMFIELD2'
}, function(err, data) {
});

I suggest to add this in the README file. Could send a pull request, but it seems there are not being processed? (there's still an old one in the list)

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