Skip to content

stuartlynn/WOFGraphQL

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 

WOFGraphQL

This is a proof of concept GraphQL interface for Who's On First

Play with it on heroku( it's not backed by a paid dyno so it might be down when you try ....)

https://wofgraphql.herokuapp.com/graphql

Instructions

To run locally, put your mapzen_api_key in a .env file. Then simply do:

npm install
npm start

Then head to http://localhost:4000/graphql

Example queries

Grab a locality by lat and lng and list its neighborhoods and their areas + any microhoods in those areas

{
  locality(lat:40.7048504  lng: -73.9368162 ){
    wof_name
    geometry 	
    neighbourhood{
      wof_name
      geom_area_square_meter
      microhood{
        wof_name
      }
    }
  }
}

Grab a neighborhood in NY by name get it's geometry and it's children

{
  neighbourhood(name:"Canarsie"){
    wof_name
    wof_children
    geometry
  }
}

Grab a neighborhood in NY by name get it's geometry and it's children

{
  macroregion(near:[42.274878 -2.517017] radius:200){
    wof_name
    wof_children
    parents {
      wof_id
      wof_parent_id
      wof_name
      wof_placetype
      geom_latitude
      geom_longitude
      geom_area
      geom_area_square_meter
      geom_bbox
      git_url
    }
  }
}

Next steps

  • Integrate with Census API to bring back census variables/geoms based on WOF regions
  • Build visual interface to view the results of the query

About

A proof of concept for accessing Who's On First with GraphQL queries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published