Select to view content in your preferred language

Use esri in a restful service

877
4
04-20-2020 04:41 AM
YuvalYaari
Emerging Contributor

Hi,

I'm trying to run a POC to expose a rest API (with a JSON response, no UI is needed), which (at first stage), trying to figure out if there is a line of sight between two points (actually, I need to see if a fresnel zone has no obstructions between two points).

I have no clue on how to get started on that. I tried using the Java SDK, but I do not need a native desktop app.

I do not understand the rest API docs. I do not understand the different things Esri is offering and to be honest, I'm a bit lost right now.

Can anyone steer me in the right direction? what is the best way of writing a restful service which uses Esri as its internal engine? Where should I start if I have never used Esri's products (or any other similar products)?

Thanks!

Tags (1)
0 Kudos
4 Replies
Aled_Jones
Regular Contributor

Sounds like you could use the ESRI JavaScript API to achieve this.

Using similar code to this sample:

https://codepen.io/pen?&editable=true&editors=100

You would just need to add some logic that returns a Boolean value on whether the viewshed graphic intersects another point.

If you're uncomfortable using the API, you can start off exploring the ESRI labs:

Get Started | ArcGIS for Developers 

Hope this helps

0 Kudos
YuvalYaari
Emerging Contributor

Aled Jon‌ Thank you for your quick reply!

The link you've attached is for an empty codepen. am I'm missing something?

What is the advantage of using the JavaScript API over the Viewshed API? 

0 Kudos
Aled_Jones
Regular Contributor

Sorry Yuval Yaari

https://codepen.io/pen?&editable=true&editors=100&prefill_data_id=15c58d50-6549-0138-160e-02420aff00...

Here's the post:

Geoprocessing - viewshed analysis | ArcGIS API for JavaScript 4.15 

Personally, the advantages are purely for development. In this scenario, I'd use the JavaScript API to develop the logic with a visual output on a small sample set and then extract the logic into a REST API application. It's a personal preference and the JavaScript API resources are great to get started on.

YuvalYaari
Emerging Contributor

Aled Jon‌ Thanks again.

Do you see any issue on using the logic inside a nodejs server (which will expose the restful api for) ? Do you know if its a common thing to do? 

0 Kudos