16
Koop: Using 3 rd Party Services in ArcGIS Daniel Fenton @dmfenton [email protected] https://github.com/dmfenton

Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

Koop: Using 3rd Party Services in ArcGISDaniel Fenton

@dmfenton

[email protected]

https://github.com/dmfenton

Page 2: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

Koop is a bridge

http://arcg.is/2kI8efh

https://www.yelp.com/search

https://washingtondc.craigslist.org/search/apa

Page 3: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 4: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 5: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 6: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 7: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 8: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

Settings in detailDialing in the specifics of your provider

https://gist.github.com/dmfenton/93379d71f4412716b3e508e1c8612cfa

Page 9: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 10: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

Output Plugins

• Adds routes to every provider

• Works like Express middleware

• Can call functions on the provider

- Or Koop

Teaching Koop New languages

Page 11: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 12: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 13: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

Questions?@dmfenton

[email protected]

https://github.com/dmfenton

Page 14: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 15: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing

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

Page 16: Koop: Using 3rd Party Services in ArcGIS2017 Esri Developer Summit DC--Presentation Keywords 2017 Esri Developer Summit DC--Presentation, 2017 Esri Developer Summit DC, Koop: Accessing