POST
|
See how ArcGIS Velocity offers different options for saving real-time data to feature layers.
... View more
01-20-2021
07:03 AM
|
0
|
0
|
85
|
POST
|
Hi GeoNet When I create a new user using the Python API and set the role parameter to a custom role that I know to exist in the org, the resulting user does not belong to the role I specified. If I set the role parameter to be a default role the user ends up in that role. Is there a particular way to set new users into a custom role or is this a known issue? Thanks, Ken
... View more
03-18-2020
09:12 AM
|
0
|
0
|
42
|
POST
|
The example on the right makes perfect sense. You get a 401 (Unauthorized) error because the Azure function has an authorization level of 'Function' meaning it restricts requesting clients to only those sending proper credentials. inReach Portal sends no such credentials so the request fails. This is why you must set the function's Auth level to 'Anonymous'. Regarding the left example, is your feature layer shared with everyone? The code I shared assumes an unprotected destination feature layer. Thus it does not send a token or any other kind of credentials. This is entirely possible to enable. To do so follow guides and examples for our .Net developer API. That being said, I suspect the issue is something else given the error returned. When I unshared my feature layer and attempted to send a test message from Portal Connect, the error returned was a 400 (Bad request). Can you confirm the destination feature layer is of the correct schema? If not you can create a new one in your portal by using mine as a template. Can you share the url to your feature layer? If you are reluctant to post it in this public forum thread but are willing and able to share your feature layer with me you may email me directly at kgorton@esri.com. I will be happy to have a look.
... View more
02-19-2020
02:13 PM
|
0
|
1
|
76
|
POST
|
Hi Surenderreddy Konatham, This may happen if your Azure function's Authorization level is set to Function or Admin which would require inReach Portal Connect to send authentication credentials with each request. If this is required it may be possible for you to implement that but I do not know what would be required to do so. Switch auth level to Anonymous by going to Integrate settings in your Azure function: then set Authorization level to Anonymous: and click save. Also, I found and corrected an error in my code so please update your function. While verifying this behavior this morning I noticed I had left off a rather important element to the feature json that gets sent to the feature layer - spatialReference (DOH!!!). InReach sends data in WGS84 (wkid 4326) while ArcGIS Online feature layers use, by default, web mercator (wkid 102100). If incoming features include spatialReference info other than web merc, the feature layer will project them correctly to web merc and store them. Otherwise it assumes the features are already in web merc and does nothing to the geometries resulting in incorrect placement for inReach features. I have updated my code on GitHub. Ken
... View more
02-19-2020
07:33 AM
|
0
|
3
|
76
|
POST
|
Well, I got ambitious and decided to check out writing a utility to send inReach messages to an ArcGIS feature layer. I ended up creating a serverless compute function in Azure Portal that receives POST requests containing inReach JSON in the same schema that the inReach Portal sends. Then it reformats the messages into Esri feature JSON and sends them to a feature layer. When this function receives a POST request containing inReach data, the function reformats the inReach json into Esri feature json and submits the data to the following feature layer: https://services1.arcgis.com/1YRV70GwTj9GYxWK/arcgis/rest/services/inReach_log/FeatureServer/0 If you have the proper credentials on inreach.garmin.com and wish to test this, feel free. Just log in to inreach.garmin.com go to Settings > Portal Connect, toggle Outbound Settings to ‘On’ and paste the ‘inReach2ArcGIS’ url below into the URL line. Click Test and Save. inReach2ArcGIS’ url: https://inreachfuntions.azurewebsites.net/api/inReach2ArcGIS Assuming the test message is successful, you will see new output in the feature layer. Then start your inReach device(s) and verify that their data arrive in the same feature layer. Keep in mind there is no security on the feature layer so anyone who accesses it can see all the data. If you would like to implement this in your own space you may get the C# code from this Github repo: GitHub - kengorton/inReach2ArcGIS: An azure serverless compute function to receive Garmin inReach event messages, conver… If you do try this out I would be happy to hear any feedback. Cheers, Ken
... View more
02-05-2020
11:00 AM
|
0
|
5
|
273
|
POST
|
I recently did a search for tools that will convert feature layers to GPX format. Not finding anything, I ended up writing one. I deployed it to an Azure portal as a severless compute function. You can see the results in this storymap: The 2020 BMW RA Rally The routes in this storymap were created using the Directions capability in the standard ArcGIS Online web map viewer. The resulting route feature collections were published as hosted feature layers and shared publicly. The URLs to those feature layers are configured as parameters in the links in each of the 'Download GPX file' buttons in the storymap. If anyone is interested you can leverage a similar capability in your own storymaps or other applications using this function: https://arcgis2gpx.azurewebsites.net/api/Layers2GPX It takes GET or POST requests and accepts point or polyline feature layers. The features in point feature layers become GPX waypoints while the features in polyline feature layers become GPX tracks. The minimum parameters required for GET requests is the url to a point or polyline feature layer. Thus you can create a URL for a hyperlink in a web page, storymap or other document as follows: https://arcgis2gpx.azurewebsites.net/api/Layers2GPX?url=https://services1.arcgis.com/EvDRLcHhbHG5BnwT/arcgis/rest/services/Hiking_Routes/FeatureServer/0&name=Name&desc=Description or https://arcgis2gpx.azurewebsites.net/api/Layers2GPX?url=https://services1.arcgis.com/fBc8EJBxQRMcHlei/arcgis/rest/services/Appalachian_National_Scenic_Trail/FeatureServer/0 The minimum payload for a POST request is a json object with a title element (which will become the output GPX filename) and an array of feature layer urls. Thus you can combine multiple point and/or polyline feature layers into a single GPX file. Example: { "title":"Some Trails", "returnFile":"true", "layers":[ { "url":"https://services1.arcgis.com/EvDRLcHhbHG5BnwT/arcgis/rest/services/Hiking_Routes/FeatureServer/0", "name":"Name", "desc":"Description", "where":"AscentFT>3600" }, { "url":"https://services1.arcgis.com/fBc8EJBxQRMcHlei/arcgis/rest/services/Appalachian_National_Scenic_Trail/FeatureServer/0", "name":"Name", "desc":"Description", "where":"Length_Ft>40000" } ] } Additionally, both methods allow you to include optional parameters for each url to indicate wich fields from the source feature layers to utilize for the different GPX elements such as name, desc, cmt, etc Click the function URL above for a complete list of optional parameters. I cannot guarantee how long the function will remain up. If you want the code let me know. If you find an error in functinality or behavior, please also let me know. Ken
... View more
02-03-2020
10:53 AM
|
0
|
0
|
504
|
POST
|
Hi ExB community, I have an app with some widgets that display data from a feature layer with fields containing, among other things, phone numbers. If a user is viewing the app on a phone, I would like to enable them to click a phone number and place a call. Right now the phone number is just normal text and is not clickable. Is this kind of behavior currently possible or will it be? Thanks, Ken
... View more
02-02-2020
01:58 PM
|
0
|
1
|
123
|
POST
|
No problem. There is nothing you need to do in map applications for this. It's simply a matter of sending features to your feature layers. To add features programmatically via web requests, your code should send features in json arrays to the addFeatures REST endpoint of the feature service in question. See this doc: Add Features—ArcGIS REST API: Services Directory | ArcGIS for Developers for more details and examples. Thus the inReach Portal would forward messages from inReach devices to the rest endpoint of your Azure Function, which will reformat the inReach json into ArcGIS feature json and POST it to your feature layer.
... View more
01-16-2020
11:26 AM
|
0
|
6
|
273
|
POST
|
Kara I looked through my old files for the HttpHandler I wrote but it's been quite a while so I'm afraid I have nothing to send. However, in the interest of keeping it modern you can certainly do this on any of the major cloud platforms using serverless compute such as Amazon Web Services Lambda, Azure Functions, or whatever Google calls their incarnation of this. This tutorial walks you through setting up a serverless compute resource on Azure (for free): Create your first function in Azure using Visual Studio Code | Microsoft Docs . Your folks can pick their development language from some of the popular ones: JavaScript, Java, C#, Python, etc. Following this tutorial I was able to set up a function to receive GET or POST requests and return a response. You could then modify the code to receive inReach messages, reformat them to feature service json and send them via http POST requests to the ArcGIS feature service of your choice. Again, some internet searches turned up examples of how to make http POST requests from within Azure Functions. Sorry I cannot provide actual code examples of my old HttpHandler. But if I were to set out to recreate such a capability I would leverage AWS, Google or Azure serverless compute resources instead. Good luck. Ken
... View more
01-16-2020
10:42 AM
|
1
|
8
|
273
|
POST
|
Thanks Owen. I suspected it might be something about the older device that was getting in the way. Maybe time for an upgrade.
... View more
01-14-2020
10:57 AM
|
0
|
5
|
105
|
Online Status |
Offline
|
Date Last Visited |
01-20-2021
09:15 AM
|