Skip to content

Conversation

@mpfeil
Copy link
Owner

@mpfeil mpfeil commented Jan 24, 2020

No description provided.

@mpfeil mpfeil requested a review from ubergesundheit January 24, 2020 14:55
@mpfeil
Copy link
Owner Author

mpfeil commented Jan 24, 2020

Test are missing

index.js Outdated
Comment on lines 139 to 140
parseFloat(steckbrief.longitude),
parseFloat(steckbrief.latitude)
Copy link
Collaborator

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

Copy link
Owner Author

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?

Copy link
Collaborator

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?

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

Successfully merging this pull request may close these issues.

3 participants