codeforokc / school-finder

Geolocation-based web app for locating schools and school districts near you
MIT License
18 stars 17 forks source link

Polygon to point using Turf? #74

Open Mike-Loffland opened 9 years ago

Mike-Loffland commented 9 years ago

Turf has a centroid function that figures out a point using the given polygon coordinates.

turf.centroid.

What do you guys think about using this to derive the point data for schools until we have a more reliable/permanent solution?

cc: @joekarl

Mike-Loffland commented 9 years ago

I realize that we discussed the shortcomings of deriving a centroid from the given polygon's BBOX coordinates... But, Turf's centroid function uses all the poylgon's coordinates to derive a centroid.

Using Turf's function is a quick way to extract point data from the existing school data. Then, we would have point data for all of our current existing data types (schools, police, and fire). Leaving only school districts (appropriately) with polygon data.