Closed sethvincent closed 8 years ago
Oh wait, I just realized the function should probably return a FeatureCollection
Don't merge yet. I'm going to do that.
OK. The function now returns a FeatureCollection
with the slug of the dataset that each feature is from stored as a property on the feature. This should work well, I think.
This turns the main javascript module in this repo into a function that takes long/lat point as input and checks which boundaries the point is inside.
First step toward creating a boundary api service!
It required cleaning a couple of datasets that were using the
GeometryCollection
geojson type, which isn't supported very well by turf, the tool I'm using to check if the point is inside a boundary.Returns a
FeatureCollection
where all the features are a match for the point. The slug of the dataset that the feature is from is stored in the properties of the feature with the keydataset
.Calling the function looks like this:
Which returns something like this:
In each feature there is a property with a key of
dataset
where the value is the slug of the dataset that the feature is from.