TileMill plugin to add geo styling (nearest, farthest, clusters, within polygon)
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
geocsv
templates
views
.DS_Store
Datasource.server.bones
package.json
readme.md

readme.md

GeoCSV

Helps you create geo queries to style point features in TileMill.
Works with CSV files from GeoCommons, the EPA, and more.
Works with any layer that includes attributes for latitude and longitude ( they can have any name, but they must appear in the layer inspector view )

Install

Mac OS X Terminal - install plugin: cp -r TileMill-GeoCSV /Applications/TileMill.app/Contents/Resources/plugins/

For layers with more than 500 points, copy this to raise max to 10,000 points cp TileMill-GeoCSV/Datasource.server.bones /Applications/TileMill.app/Contents/Resources/models/

What to do

  1. Open the new GeoCSV plugin (it looks like a dot).
  2. Select layer and properties.
  3. Write code like this:
    [ near 32.3 -112.1 0.5 ]
  4. Click 'Process' and GeoCSV will print a list of IDs in Carto which fit those standards:
    #busstops [ id = "101" ],
    #busstops [ id = "103" ],
    #busstops [ id = "204" ]{

    }

Filling out a query: three points closest to southern tip of Manhattan

The result:

Possible Queries

  • [ near LAT, LNG, DEGREES ]
  • [ nearest LAT, LNG, COUNT ]
  • [ far LAT, LNG, DEGREES ]
  • [ farthest LAT, LNG, COUNT ]
  • [ neighbor_others_by DEGREES ] for clustering
  • [ inside lat1,lng1,lat2,lng2,lat3,lng3 ] for polygons
  • You don't need a plugin for rectangles

TODO: combine rules such as [ far LAT, LNG, DEGREES ] [ far LAT, LNG, DEGREES ] to highlight points distant from all of the lat/lngs listed

Potential uses

  • Highlight the three closest bus stops to your building
  • Re-style densely-packed points to make them more distinct
  • Map toxic sites within your city limits
  • Contrast points within and outside of a business/delivery service area