{"id":23196419,"url":"https://github.com/cspanring/avidgeo-meetup","last_synced_at":"2025-04-05T08:25:42.555Z","repository":{"id":3611461,"uuid":"4676547","full_name":"cspanring/avidgeo-meetup","owner":"cspanring","description":"Meetup material","archived":false,"fork":false,"pushed_at":"2012-06-15T15:05:57.000Z","size":745,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T16:52:12.717Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cspanring.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-15T15:03:29.000Z","updated_at":"2016-04-23T14:48:42.000Z","dependencies_parsed_at":"2022-08-28T11:11:15.636Z","dependency_job_id":null,"html_url":"https://github.com/cspanring/avidgeo-meetup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cspanring%2Favidgeo-meetup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cspanring%2Favidgeo-meetup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cspanring%2Favidgeo-meetup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cspanring%2Favidgeo-meetup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cspanring","download_url":"https://codeload.github.com/cspanring/avidgeo-meetup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247308256,"owners_count":20917668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-18T14:18:25.799Z","updated_at":"2025-04-05T08:25:42.524Z","avatar_url":"https://github.com/cspanring.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Avid Geo Meetup\r\n\r\n[at MAPC, June 14th 2012, about MAPC's Basemap toolchain](http://www.meetup.com/avidgeo/events/65674052/)\r\n\r\nAgenda, in a nutshell:\r\n\r\n1. [MassGIS data](http://www.mass.gov/mgis/massgis.htm) - public domain data\r\n2. [TileMill](http://mapbox.com/tilemill/) - cartography studio\r\n3. [TileStache](http://tilestache.org/) - simple tile server\r\n4. [Amazon S3](http://aws.amazon.com/s3/) - efficient storage\r\n5. [Leaflet](http://leaflet.cloudmade.com/) - client map\r\n\r\n## Our [Basemap](http://tiles.mapc.org/basemap.html)\r\n\r\n\u003ciframe src=\"http://tiles.mapc.org/basemap.html#zoom=10\u0026amp;lat=42.35752\u0026amp;lon=-71.06097\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" width=\"600\" height=\"400\"\u003e\u003c/iframe\u003e\r\n\r\n**Why create and host our own basemap?**  \r\n\r\nIt's easy enough, doesn't require much resources and gives us most flexibility for our online maps.\r\n\r\nFind the TileMill project (with branches for the Trailmap or Parkmap) in our [GitHub repository](https://github.com/MAPC/basemap).\r\n\r\n[Instructions](https://gist.github.com/2923720) about how to include MAPC layers in your own mapping project.\r\n\r\n## Data\r\n\r\nGet it from [MassGIS data](http://www.mass.gov/mgis/massgis.htm) or OpenStreetMap (e.g. [Metro Extracts](http://metro.teczno.com/) and [Imposm](http://imposm.org/docs/imposm/latest/) is a good start)\r\n\r\nCreate a Postgres/PostGIS database, noticeable faster than Shapefiles, and load some data:\r\n\r\n... import Shapefiles\r\n\r\n    $ createdb -T template_postgis -O avidgeo avidgeo\r\n    $ shp2pgsql -s 26986 -I myshape.shp public.myshape | psql -d avidgeo\r\n\r\n...or load the prepared dump file\r\n\r\n    $ createdb -T template0 -O avidgeo avidgeo\r\n    $ pg_restore -d avidgeo -O avidgeo.dump\r\n\r\n## Cartography\r\n\r\nKnow CSS and GIS? Use [TileMill](http://mapbox.com/tilemill/)!\r\n\r\nFor MassGIS data you'll need to add the Spatial Reference:\r\n\r\n    +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +datum=NAD83 +units=m +no_defs\r\n\r\nExport your map as Mapnik XML style file or readily rendered MBTiles.\r\n\r\n## Tile Rendering\r\n\r\nTileStache is a lightweight tile server, supporing a range of data providers - MBTiles, Vector (PostGIS, GeoJSON, Shapefiles), Mapnik, etc. - and caches - Memcache, Disk, Amazon S3.\r\n\r\nRun the server for on-demand Tile rendering behind your web server:\r\n\r\n    HTTP request \u003c=\u003e Web Server \u003c=proxy=\u003e WSGI server \u003c=\u003e TileStache\r\n\r\ne.g. at MAPC we use a combination of [Nginx](http://nginx.org/) as web server, [Gunicorn](http://gunicorn.org/) as WSGI and [TileStache](http://tilestache.org/) as tile server.\r\n\r\nSample TileStache configuration for rendering to the disk cache and adding the avidgeo mapnik xml:\r\n\r\n    {\r\n      \"cache\": {\r\n        \"name\": \"Disk\",\r\n        \"path\": \"/home/avidgeo/www\",\r\n        \"umask\": \"0000\",\r\n        \"dirs\": \"portable\"\r\n      },\r\n      \"layers\": \r\n      {\r\n        \"avidgeo\":\r\n        {\r\n            \"provider\": {\"name\": \"mapnik\", \"mapfile\": \"avidgeo.xml\"},\r\n            \"projection\": \"spherical mercator\",\r\n            \"metatile\":\r\n              {\r\n                \"rows\": 4,\r\n                \"columns\": 4,\r\n                \"buffer\": 128\r\n              },\r\n            \"preview\":\r\n              {\r\n                \"lat\": 42.3551,\r\n                \"lon\": -71.0618,\r\n                \"zoom\": 14,\r\n                \"ext\": \"png\"\r\n              }\r\n        }\r\n      }\r\n    }\r\n\r\n\r\nFor production, pre-seed tiles to Amazon S3 and turn tile server off. S3 is great for serving static tiles and will save you some resources.\r\n\r\n    $ tilestache-seed.py -x -c tilestache-s3.cfg -l basemap -b 40.59 -75.58 43.98 -69.98 9 10\r\n\r\n**Extra points**: add [UTFGrid](http://mapbox.com/developers/utfgrid/) tiles for attribute data in your raster map.\r\n\r\n## Client side map\r\n\r\nMost JavaScript mapping libraries can consume tile server. Below is a simple example using Leaflet:\r\n\r\n    var avidgeo = new L.TileLayer('http://render.mapc.org/avidgeo/{z}/{x}/{y}.png', {\r\n        attribution: 'Tiles: MAPC, Data: MassGIS',\r\n        maxZoom: 18\r\n    });\r\n\r\n    var map = new L.Map(\"map\",{\r\n        minZoom: 14,\r\n        maxZoom: 18\r\n    })\r\n    .setView(new L.LatLng(42.3551, -71.0618), 14)\r\n    .addLayer(avidgeo);\r\n\r\n[Wax](http://mapbox.com/wax/) will allow you're client map to consume UTFGrid tiles.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcspanring%2Favidgeo-meetup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcspanring%2Favidgeo-meetup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcspanring%2Favidgeo-meetup/lists"}