vantuyls / studyGroup

Gather together a group to skill-share, co-work, and create community
http://vantuyls.github.io/studyGroup/
Other
0 stars 2 forks source link

Study Group - Introduction to Mapbox #15

Open vantuyls opened 7 years ago

vantuyls commented 7 years ago

Matt Gregory, Senior Faculty Research Assistant in the Department of Forest Ecosystems and Society, will be leading a Study Group on Mapbox. The group get together on May 17 from 11:30-1:30 in the Willamette East and West classrooms of The Valley Library.

Come with your laptop (computers not provided) and your curiosity.

grovduck commented 7 years ago

Hi all, here's a tentative agenda for Wednesday:

15 min - intro to web mapping technologies 10 min - Mapbox (free) account setup 45 min - hands-on workshop with Mapbox Studio 45 min - hands-on intro to Mapbox GL JS and getting a working map 15 min - bring in GeoJSON data, misc. features

This is intended to be a working introduction to Mapbox tools, geared toward the beginning user. If y'all have any suggestions about what to present, please comment here.

debboutr commented 7 years ago

I'd enjoy seeing a time slider that could be used on point data (GeoJSON) if possible or with raster data as well, I might be working on a project soon that will model stream temp. in the columbia over time which would be displayed as raster. Excited about this one! Thanks

vantuyls commented 7 years ago

~8 attendees

grovduck commented 7 years ago

Talk for Mapbox: intro_to_mapbox.pdf Tutorial 1: https://www.mapbox.com/help/create-a-custom-style/ Tutorial 2: https://www.mapbox.com/help/add-points-pt-1/ Tutorial 3: https://www.mapbox.com/help/building-a-store-locator/ Gist for dynamic earthquake viz: https://gist.github.com/grovduck/bee7638e3e0b935bf059d4cd4916acc8

grovduck commented 7 years ago

Another hint for you Python users that I found this morning. If you install both fiona and geojsonio, you can easily translate and view shapefiles as geojson:

fio dump /path/to/shapefile.shp | geojsonio

This opens your shapefile in a web browser and shows you the associated geojson. This question came up during the session.

debboutr commented 7 years ago

Another Python solution is to use the geopandas package, which can read in shapefiles and write-out geojson.

import geopandas as gpd

shp = gpd.read_file('/path/to/shapefile.shp')
shp.to_crs({'init': u'epsg:3857'},inplace=True) # if need to re-project
shp.to_file('path/to/geojson.json',driver="GeoJSON")

This will write the JSON straight to a file. You can also quickly, as seen above, change the projection, which for Mapbox, may not be imperative, but for other slippy maps, the 'WGS Pseudo Mercator' projection is needed. You can also use the extension '.geojson' on the file, it doesn't seem to matter, but will help identify the geo component when sifting through files.