jlord / sheetsee.js

:eyes: :chart_with_upwards_trend: Visualize Data from a Google Spreadsheet
jlord.github.io/sheetsee.js
Other
2.96k stars 884 forks source link

Polygons #45

Closed CrokinoleMaster closed 10 years ago

CrokinoleMaster commented 10 years ago

Not really an Issue but I tried for a long time and could not figure out how to make my spreadsheet for polygons. I can't seem to find the documentation for it but it does say that Sheetsee has supported this feature for a while. It would be great if I could get some help with this! This is for GeoJson.

jlord commented 10 years ago

Gah! Documentation is hard... I guess I wrote it as a blog post and then didn't write in the actual documentation and I guess just had the memory "I've written this...somewhere" -- anyways. Sorry about that. Here is the blog post that talks about that:

http://jlord.github.io/blog/sheetsee-3.html

I will add it to the actual docs!

jlord commented 10 years ago

Added :pencil: http://jlord.github.io/sheetsee.js/docs/sheetsee-maps.html

lostingz commented 10 years ago

thanks very much

CrokinoleMaster commented 10 years ago

Thanks for the quick reply and adding docs right away! But the part I don't understand is actually the "correct coordinate structure" in the google spreadsheet. I tried adding multiple 'LAT', 'LONG' cells to a row and adding a 'COORDINATE' cell with the coordinates string, but neither of those worked. I keep getting back a "point"' when I use the 'createGeoJSON' method. Maybe I'm not missing something obvious...

jlord commented 10 years ago

The column name should be either 'multipoloygon', 'linestring' or 'polygon' -- so sorry, that's still not clear at all. I'll fix that, too!

Right now sheetsee expects a column to be all of one of the things, ie a column with only linestring coordinates, so you couldn't have one row with a linestring and one with a polygon in the same column called 'linestring'.

If you had a map that had all three kinds of those things you'd need a column for each. Does that make sense?

I'll try to put together a spreadsheet example of these soon.

Thanks so much for finding these holes and bearing with me!

CrokinoleMaster commented 10 years ago

I think I get what you mean. I created a column called 'POLYGON' then put the coordinate string in the cell. However, it's causing an error,

shapeJSON is not defined

In the line

var shapeFeature = shapeJSON(lineItem, type, optionObj)

Perhaps I'm still doing something wrong?

Thanks for helping me through this!

CrokinoleMaster commented 10 years ago

I think i found a bug. I'll make a pull request.

CrokinoleMaster commented 10 years ago

46

This fixes the error I was getting. Do you think it's the right fix? Thanks!

jlord commented 10 years ago

I just left a comment about doing your PR on sheetsee-maps -- thanks so much for all this help!

I just did a quick test map for all the polygon stuff: http://jlord.github.io/mappy

The spreadsheet

I'll turn it into a proper demo for the site.

CrokinoleMaster commented 10 years ago

Very awesome!