-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add geojson format #4
base: main
Are you sure you want to change the base?
Conversation
Test are missing |
index.js
Outdated
parseFloat(steckbrief.longitude), | ||
parseFloat(steckbrief.latitude) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest parsing and validating (for NaN for example) these before pushing into the geojson result.
Also I would vouch for not using parseFloat
. The MDN page for parseFloat
says one should use Number()
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you suggest if longitude
or latitude
is NaN? Throwing an error and rejecting? Or just returning some defaults?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just looked this up in the GeoJSON spec which says:
A Feature object has a member with the name "geometry". The value
of the geometry member SHALL be either a Geometry object as
defined above or, in the case that the Feature is unlocated, a JSON null value.
so setting the geometry
to null
would be according to the spec. The unparseable coordinate would appear in the properties
anyway, right?
No description provided.