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

Trying to do geocolor and not sure what I'm missing #42

Closed
bartonhammond opened this issue Dec 18, 2015 · 2 comments
Closed

Trying to do geocolor and not sure what I'm missing #42

bartonhammond opened this issue Dec 18, 2015 · 2 comments

Comments

@bartonhammond
Copy link

Thanks for your help! It took me a little longer to get all the data together.

I can load this map on http://geocolor.io/# but all I see are dots rather then regions being colored.

The input file:
heatmap.geojson.zip
The code:

var geocolor = require('geocolor');

var fs = require('fs');

try {
  var heatmap = JSON.parse(fs.readFileSync('./heatmap.geojson'));
} catch (err) {
  console.log('err',err);
}

var z = 'stars',
    numberOfBreaks = 5,
    colors = ['red', 'blue', 'white'];

// jenks
var geoJenks = geocolor.jenks(heatmap, z, numberOfBreaks, colors);

fs.writeFileSync('./jenks.geojson', JSON.stringify(geoJenks));

My output Jenks.json:
jenks.geojson.zip

The share: http://bl.ocks.org/anonymous/raw/39c4ed96bf428cc67344

@bartonhammond
Copy link
Author

So I update zoom when building the tiles and add a feature.properties["marker-color"] = "#55aa00";

So now, http://bl.ocks.org/anonymous/raw/c331c007fa82a8248053 I'm seeing markers that are blocks. I'm assuming that's because we used

tilebelt.pointToTile(star.long, star.lat,
                                  zoom).join('/');

So I'm trying to figure out what I need to get "countries" to be lit up.

@bartonhammond
Copy link
Author

Wanted to share what I have now. The icons are colored from geoColor.

screen shot 2015-12-19 at 11 39 24 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant