Monthly Archives: June 2016

“Edible” Tree Species Mapped in NYC

Interest in Agriculture

I have always been interested in agriculture since my humble beginnings as a home gardener in Vermont.  In college, I had a group of friends who were extremely passionate about urban harvesting.  They were concerned about the amount of edible food they saw go to waste around their small city and teamed up to do something about it on a volunteer basis.  When I had the opportunity to dive into the NYC 2015 Tree data, I started thinking about what kind of edible tree species are within the five boroughs.  Also, I often have seen Mulberry trees make a mess of the sidewalk near my house, which made me wonder where all of the Mulberry trees are located specifically.


Mulberry mess on a street in my neighborhood.  Honestly, it doesn’t look like much because the rain earlier this week washed it away, but it can look like the sidewalk is full of purple jam!

NYC Parks’ TreesCount 2015!

If you read my last post, by now you know all about NYC Open Data and the Park’s Department TreesCount 2015 data.  Basically, the Parks department counts all of the “NYC street trees” every ten years to keep tabs on how the urban forest is doing.   Street trees are all of the trees you see in the NYC sidewalks, and they do not include trees that are in public parks.

When first given a chance to analyze this data, of course my mind started asking questions about how many NYC Street Trees are some kind of edible species. I decided to focus my visualization on that.  But there’s a huge caveat!  At the aforementioned event, there were many Parks Department representatives to support, and from one of them I learned that the Parks Department chooses a lot of hybrid species for their street trees.  This means that although in the list of trees in NYC there are many edibles, the actual trees that are planted may not be fruit bearing because that would make a mess of the sidewalks. (The Mulberry trees I mentioned earlier ended up being on private property that borders the sidewalk.)  Also, since I don’t have more specific information about the trees beyond their common and scientific names, please proceed with caution if you decide to check the trees in this visualization.  The following is the process I took to create this visualization.

Consulting an Expert

My first task was to identify all of the tree species that I wanted visualize from the data.  While I was able to identify some species that I knew had some kind of edible, I consulted with my good friend, Samantha Anderson, who happens to be a landscape architect and general expert in these sorts of things.  With her help, we created a list of all the species that could possibly have something edible, most of them being fruit or nut bearing trees.     In total I ended up with 13 species of NYC Trees to include in the visualization.  (Thank you Sam!  Note: final list did not include sugar maple even though the sap is edible.  Can’t imagine NYC Parks is going to tap some trees anytime soon!)

Visualizing Data with CartoDB

Issue #1: Edible Species Not the Most Common

I used CartoDB for visualizing the trees of interest on a map of NYC.  First, I had to import the TreesCount 2015 Street Tree Data off of the NYC Open Data Portal.    Then, since I wanted my visualization to focus on the common species names for the NYC trees, I experimented with viewing the different categories of tree species by specifying that I wanted the data sorted by the “spc_common” column.

In this screen shot, you can see that ten types of specific trees that are the most common in the data set are each given their own colors and pins.  My problem was that some of the  species I was interested in were lumped into the gray “Other” category.


Top categories of trees mapped by category

Solution: Custom CSS

To change which species showed up on the map and to identify which colors I wanted their pins to be, all I had to do was change the CSS style for the species that were being targeted in the CartoCSS editor.  At least that’s what I thought I had to do.

Issue #2: Dataset Too Broad

While some of the pins changed colors, I realized that the map was still showing ALL of the trees in NYC.  I had just changed the styling, but what I really needed to change was the underlying dataset that the map was drawing from to show the plotted trees.

Solution: Custom SQL Query

There may be a more efficient way to do this, but I basically created a custom SQL query that targeted only the tree species I was looking for so that the dataset would only reflect that.

 Final Map

After tweaking the legend and other clean up, I finally had all of my edible tree species in NYC mapped!  Check it out here.  You can see what types of edible tree species live in your neighborhood, but please, sample edibles at your own risk!

TreesCount! Data Jam Recap


Noel Hidalgo from BetaNYC at the kickoff to the TreesCount! Data Jam on June 4, 2016 – part of the National Day of Civic Hacking

National Day of Civic Hacking and BetaNYC

Last Saturday, June 4, 2016 was the National Day of Civic Hacking across the USA, where people from a variety of backgrounds come together to hack on projects for good.  How cool is that!?  It sponsored by Code for America and a bunch of other organizations and federal agencies.  It’s a hackathon where people use government data available to them to work on different challenges.  This year there were challenges with everything from mapping honey bees in your yard to analyzing data about the spread of Zika.

I am very interested in the intersection of technology and civic engagement, so when I discovered that BetaNYC was a civic group already doing this work in NYC I joined their Meetup Group immediately.  The TreesCount! Data Jam was the first event I participated in, and I look forward to going to more!

TreesCount! Data Jam

BetaNYC partnered with the NYC Parks department to create the TreesCount! Data Jam Event on the National Day of Civic Hacking.  They unveiled the TreesCount! 2015 dataset of all the street trees counted within the five boroughs of NYC, and people participated in hacking on 5 specific challenges you can read about here.  Data was also collected on street trees in 1995 and 2005, though the 2015 data had more specific geospatial data because volunteers used TreeKits to map.  Every time they’ve done the count they’ve realized that there are more and more trees on NYC streets!


Bar graph from the Parks Department comparing the number of trees per selected boroughs in 1995, 2005, and 2015.

At the event kickoff, members of the parks department intro20160604_162046duced the new dataset and gave us information about how to access it in the NYC Open Data Portal.  In fact, there were NYC Parks department employees hanging around all day to answer questions and provide a deeper understanding of how the Parks Department works.  Manhattan Borough President Gail Brewer also gave a lighthearted speech about the importance of trees in NYC, as well as the complaints her office gets from constituents about trees, and now ivy around the trees leads to rats.

Off to work!

There was over 150 people there from all walks of life.  I met UX designers, project managers, developers like me, data scientists, economists, and even volunteers who collected the data and wanted to see how people could use it. After the kickoff, people drifted towards the challenges they were interested in and began to look at the data and hack the day away!

I chose to participate in a workshop that was going on with Julia Marden from BetaNYC and Annarita Macri from the Parks Department.  It was amazing!  We learned how to interact with the NYC Open Data portal, took a deep dive into the NYC Trees and NYC Blockfaces (shows the completion of trees counted on a block level) datasets, made pivot tables, learned about Geocoding, and also worked on mapping the tree data using CartoDB.  Next week I’ll be blogging about the map I made of edible tree species in the NYC urban forest landscape!

End of Day


You can see the four teams at their numbered laptops ready to present.  The current team was presenting on their data that mapped trees in bad condition in proximity to places like daycares and senior citizen centers.

I have to say that this was one of the most well-run events I have ever attended.  An example of the event’s efficiency has to be the end-of-day wrap-up where about 20 teams who did the hackathon each at a 2 minute (or was it one minute?) period of time to present their project to everyone.  Each project was based on one of the five challenges presented at kick off, and they were judged by a panel of experts on how well they completed the challenge.  After each presentation, the next team was already on stage ready to hook into the overhead screens and present. The presentations and projects turned out great!

One standout for me was a Twitter robot called Every Tree NYC (@everytreenyc) that interacts with the Tree Data to answer the challenge of increasing public engagement with the tree data.  Basically, it pairs pithy (pith – HA!) statements with images and locations of trees around the five boroughs.  For instance, an image of a dead tree came with the caption, “RIP.”  Other projects were more serious in tone than this one, but my love of a good pun is making a little biased here!

The projects were extremely inspiring.  It was amazing to see what people can create when given data and a few hours to hack on it!  I highly suggest this event, and I know I will surely be participating next year.


My neighborhood pizza parlor also made an appearance in this project that compared weather station data on streets with trees versus without streets!

Civic Hall and Future Events

Also, did I mention that the event took place at Civic Hall – an amazing community center!  You should definitely check it out!  If you want to become a member you do have to pay a monthly fee, but they host a lot of interesting events.  For instance, next Tuesday, June 7th at 12:30 they hosting an event where they are launching the 311 Call Center Inquiry dataset.