Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
Koop: Using 3rd Party Services in ArcGISDaniel Fenton
@dmfenton
https://github.com/dmfenton
Koop is a bridge
http://arcg.is/2kI8efh
https://www.yelp.com/search
https://washingtondc.craigslist.org/search/apa
New in Koop 3.0
• Simplified Provider
- Route and Controller are Optional
- FeatureServer Routes and Handler built in
• Simplified Cache API
- Koop-Cache-Memory
• New Plugin Type: Outputs
- Handle a set of routes automatically
- Can call functions on Koop and Provider model
Koop is extensible
• Provider: Translate remote APIs
- https://github.com/koopjs/koop-provider-yelp
• Output: Translate GeoJSON into an API standard e.g. Geoservices, SODA, WFS
- https://github.com/koopjs/koop-output-geoservices
• Cache: Store and Process GeoJSON
- https://github.com/koopjs/koop-cache-memory
• FileSystem: Write files to disk or cloud storage
- https://github.com/koopjs/koop-filesystem-s3
• General: extend the Koop API in any way
- https://github.com/koopjs/koop-plugin-reverse-geocoder
Providers
• Translate between any remote API and GeoServices
• Pass-Through
- Communicate with remote API on every request
- Data is too big to gather all at once
- And/Or API supports filters and geometry queries
- E.g. https://github.com/koopjs/koop-provider-yelp
• Cached
- Gather all data at once
- Data is small or doesn’t change often
- E.g. https://github.com/dmfenton/koop-provider-craigslist
How to write a provider
• Find API docs or Reverse Engineer API via network tab
• Implement `getData` function
• Configure settings
• Launch Server
From: https://washingtondc.craigslist.org/jsonsearch/apa/
To: http://adapters.koopernetes.com/craigslist/washingtondc/apartments/FeatureServer/0
getData in detail
• Purpose is to talk to remote API and return geojson
• Function takes in a `req` and `callback`
- Req contains parameters `id` and `host
- Callback is called with an error or geojson
• Cache insert/retrieval is managed by this function
• Example: https://github.com/dmfenton/koop-craigslist/blob/master/craigslist.js#L7-
L20
Settings in detailDialing in the specifics of your provider
https://gist.github.com/dmfenton/93379d71f4412716b3e508e1c8612cfa
Advanced ProvidersExtending the routes and functionality of Koop
- Routes
- Maps http verbs and paths to handler functions
- E.g. https://github.com/koopjs/koop-provider-agol/blob/master/routes.js
- Controller
- Handles actions specified in routes
- E.g. https://github.com/koopjs/koop-provider-agol/blob/master/controllers/index.js
Output Plugins
• Adds routes to every provider
• Works like Express middleware
• Can call functions on the provider
- Or Koop
Teaching Koop New languages
Lego Blocks
https://gist.github.com/dmfenton/93379d71f4412716b3e508e1c8612cfa
• Winnow: query geojson without a database
- https://github.com/featureserver/winnow
• FeatureServer: given geojson and a route, respond like a feature server would
- https://github.com/featureserver/featureserver
Resources
• https://github.com/koopjs/koop
• https://github.com/koopjs
• https://koopjs.github.io
• https://github.com/koopjs/koop-sample-provider
• https://github.com/koopjs/koop-sample-app
Please Take Our Survey on the Esri Events App!
Select the session
you attended
Scroll down to find
the survey
Complete Answers
and Select “Submit”
Download the Esri Events
app and find your event
Print Your Certificate of Attendance
Print stations located in the 140 Concourse
Monday
12:30 PM – 6:30 PM
GIS Solutions Expo,
Hall B
5:15 PM– 6:30 PM
Expo Social,
Hall B
Tuesday
10:45 AM– 5:15 PM
GIS Solutions Expo,
Hall B
6:30 PM– 9:30 PM
Networking Reception,
Smithsonian National Air
and Space Museum