You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit: Now I found out this is due to a conflict between Rail's ActiveSupport to_json and the json gem. Usage outside Rails environment works as intended. How to get around this?
I'm not sure if I'm using this functionality correctly or not, but I'm having trouble outputting a valid GeoJSON collection.
But when a GeoJSONFeature is inside an array, it skips over its own GeoJSONFeature#to_json method (double checked with byebug) and is missing the "type": "Feature" attribute.
Edit: Now I found out this is due to a conflict between Rail's ActiveSupport to_json and the json gem. Usage outside Rails environment works as intended. How to get around this?
I'm not sure if I'm using this functionality correctly or not, but I'm having trouble outputting a valid GeoJSON collection.
Example:
GeoJSONFeature.new(point1).to_json
Output:
But when a GeoJSONFeature is inside an array, it skips over its own
GeoJSONFeature#to_json
method (double checked with byebug) and is missing the"type": "Feature"
attribute.Example:
[GeoJSONFeature.new(point1)].to_json
Output:
Finally putting it together with a FeatureCollection:
Output (not valid GeoJSON):
The text was updated successfully, but these errors were encountered: