Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 06: getPlaces() * * Write a function to create URLs for looking up observations for specific * places using the iNaturalist results data and

Problem 06: getPlaces()

*

* Write a function to create URLs for looking up observations for specific

* places using the iNaturalist results data and place_ids.

*

* When users record observations, they include information about the location.

* Within iNaturalist's database, all places have a numeric id called a `place_id`.

* For example:

*

* - Canada = 6712

* - Ontario = 6883

* - Toronto = 134748

*

* An observation will usually include many place_ids. For example, you might

* record an observation in Toronto, which is also in Ontario, which is also in

* Canada, etc.

*

* The results data includes a property named `place_ids` that lists all of the

* relevant place_ids for the observation:

*

* place_ids: [

* 6712, 6883, 9853, 27593, 57637, 59613, 59651, 59954, 59956, 61551,

* 64422, 64423, 66741, 82257, 97394, 129309, 130989, 134744, 134748

* ]

*

* Convert each observation's place_ids into an object with each key being

* the place_id, and the value being a URL of the following form:

*

* https://www.inaturalist.org/observations?place_id={place_id}

*

* For example, all observations for the City of Toronto are available at:

*

* https://www.inaturalist.org/observations?place_id=134748

*

* The object you create will look like this:

*

* {

* 6712: 'https://www.inaturalist.org/observations?place_id=6712',

* 6883: 'https://www.inaturalist.org/observations?place_id=6883',

* 134748: 'https://www.inaturalist.org/observations?place_id=134748',

* ...and so on

* }

*

* Your function should return an Array of these new Objects:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions