Skip to content

Instantly share code, notes, and snippets.

@wboykinm
Created January 30, 2013 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wboykinm/4673702 to your computer and use it in GitHub Desktop.
Save wboykinm/4673702 to your computer and use it in GitHub Desktop.
weird polygon CSV syntax
name border
Bristol ((44.176935,-73.150822),(44.194222,-73.022362),(44.155771,-73.014474),(44.15351,-73.034155),(44.06043,-73.014828),(44.057855,-73.028674),(44.04308,-73.030892),(44.039844,-73.064386),(44.055258,-73.067088),(44.052334,-73.097015),(44.142209,-73.113752),(44.148264,-73.14554),(44.176935,-73.150822))
New Haven ((44.1755598843179,-73.1753556674805),(44.177406608901,-73.1511514133301),(44.1484679458234,-73.1458299106446),(44.1421857656122,-73.1137292331543),(44.053424821185,-73.0972497409668),(44.0458986743567,-73.1805055087891),(44.0539183055982,-73.1762139743653),(44.0587295631207,-73.1777589267579),(44.0648972701375,-73.1841103977051),(44.0706943288641,-73.1938950961915),(44.0677341996001,-73.1997315830079),(44.0697076355586,-73.2071130222168),(44.0668708006784,-73.2151811069336),(44.076984112002,-73.2409303134766),(44.0888218902534,-73.2512299960938),(44.1186524444453,-73.2515733188477),(44.108299742844,-73.2464234775391),(44.108299742844,-73.2090012973633),(44.1612765945072,-73.213807815918),(44.15561157356,-73.1729524082032),(44.1755598843179,-73.1753556674805))
Middlebury ((44.0558942880726,-73.0671554228516),(44.0461475347199,-73.1809669157715),(44.0433095708767,-73.1816535612793),(44.0420756311468,-73.1811385771484),(44.0360289549635,-73.1819968840332),(44.0322031880756,-73.178906979248),(44.0304753414271,-73.1806235930176),(44.0233165829696,-73.1770187041016),(44.0202306445784,-73.1773620268555),(44.0187493370959,-73.19006496875),(44.0092434001328,-73.1888633391113),(43.9882508708922,-73.189893307373),(43.9882508708922,-73.1859450957031),(43.9826927817043,-73.1852584501953),(43.9676215663886,-73.1735854765625),(43.9516814487276,-73.1704955717775),(43.9534115908492,-73.1526427885742),(43.9546473758125,-73.1402831694336),(43.9566245783015,-73.1227737089843),(43.9594666916225,-73.0963378569336),(43.9615672967026,-73.0573707243652),(44.0558942880726,-73.0671554228516),(44.0558942880726,-73.0671554228516))
@cbley
Copy link

cbley commented Jan 30, 2013

Looks like someone is using Python and representing points as a tuple of lat, lng and polygons as a tuple of points.

>>> v1 = (44.176935,-73.150822)
>>> v2 = (44.194222,-73.022362)
>>> v3 = (44.155771,-73.014474)
>>> poly = (v1, v2, v3)
>>> str(poly)
'((44.176935, -73.150822), (44.194222, -73.022362), (44.155771, -73.014474))'
>>>

@wboykinm
Copy link
Author

Thanks for tracking that down. Yeah, it looks like they forced the CSV for some reason. Trying to reverse-engineer native format for a nontechnical client is tough :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment