Skip to content
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 centroid coordinates to json results. #22

Open
dacresni opened this issue Oct 15, 2019 · 3 comments
Open

add centroid coordinates to json results. #22

dacresni opened this issue Oct 15, 2019 · 3 comments
Assignees
Labels

Comments

@dacresni
Copy link
Collaborator

dacresni commented Oct 15, 2019

commit Pandas function to calculate centroid of all polygons and add column to database.

@dacresni
Copy link
Collaborator Author

@dacresni
Copy link
Collaborator Author

var polygon = data.features[0].geometry.coordinates;
var fit = new L.Polygon(polygon).getBounds();
var southWest = new mapboxgl.LngLat(fit['_southWest']['lat'], fit['_southWest']['lng']);
var northEast = new mapboxgl.LngLat(fit['_northEast']['lat'], fit['_northEast']['lng']);
var center = new mapboxgl.LngLatBounds(southWest, northEast).getCenter();
// map.flyTo({center: center, zoom: 10});
map.fitBounds(new mapboxgl.LngLatBounds(southWest, northEast));

@dacresni dacresni self-assigned this Oct 16, 2019
dacresni added a commit that referenced this issue Oct 16, 2019
added entire polygon data to element dataset, sorry
@dacresni
Copy link
Collaborator Author

or we just use this layer instead
https://stlgis.stlouis-mo.gov/arcgis/rest/services/public/STL_PUBLICMAP/MapServer/1
and then query for a single point

@jigglepuff jigglepuff pinned this issue Oct 24, 2019
@dacresni dacresni unpinned this issue Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants