Clip ArcGIS Online Web Service

2027
6
05-01-2021 07:03 PM
Labels (3)
BenjaminSkinner
New Contributor III

Hello,

I am brining an ArcGIS Online layer into Map Viewer as a Web Service. The ArcGIS Online Web Service in question is: https://maps.gov.bc.ca/arcserver/rest/services/mpcm/bcgwpub/MapServer/75?f=pjson

Is it possible to clip the Web Service to a polygon or extent within Map Viewer?

I have attempted setting a Custom Parameter for 'extent' as well as 'fullExtent' for the layer, to no success. The hope here was that the layer would essentially be clipped to a bounding box. Even better would be if a polygon could be used instead of a bounding box. 

Additionally, I have looked into using the Clip and Intersect arcade expressions within the layer style. However, this seems to provide a boolean or numeric indication of occurrences of features that intersect or fall within the clip, as opposed to actually creating a layer that has been subsetted to show a smaller region.

Here is the Intersect Arcade expression used:

var geom2 = Polygon({ "rings": [ [[-13955923,6470764],[-13631489,6492862],[-13889128,6123228],[-13616423,6122224]] ],"spatialReference": { "wkid": 3857 } });

EnvelopeIntersects($feature, geom2);

Thank you for any assistance you can provide in helping me 'Clip' an AGOL Web Service to a smaller area.

-Ben

0 Kudos
6 Replies
JayantaPoddar
MVP Esteemed Contributor

You can not extract/download the features from the given map service.

You can download an offline version of data from https://catalogue.data.gov.bc.ca/dataset/4483aeea-df26-4b83-a565-934c769e74de#edc-pow > BC Geographic Warehouse Custom Download 

JayantaPoddar_0-1619935138350.png

 



Think Location
BenjaminSkinner
New Contributor III

Thank you for your reply.

I'm thinking I may have to read the service into FME as an ArcGIS Server Service, perform clipping there, and then write out a hard copy version of the dataset. 

 

0 Kudos
DavidPike
MVP Frequent Contributor

I guess you could create a new custom field/popup for the intersection Truthy Falsey then use the filter on that field.  I understand this might still return geometry outside the extent but which still passes the intersection 'test' as it has a part which intersects.

Any way sounds computationally expensive.

BenjaminSkinner
New Contributor III

Thank you for your reply. 

This was my thought as well, however from what I can tell so far it looks like I would not be able to symbolize by a second attribute in an aesthetically pleasing way while also doing this. That being said I haven't fully explored the option so maybe it could work. 

0 Kudos
DavidPike
MVP Frequent Contributor

How so? the filter would be separate from any symbology applied, maybe I don't get the full picture.

0 Kudos
BenjaminSkinner
New Contributor III

Hi David,

Yes I see you are correct now. Looking at this further, I realized that I was using an Arcade expression in the 'Symbology' pane. This is why I was not able to symbolize a second attribute as desired once another expression had been entered there.

To elaborate, using the Arcade expression:

var geom2 = Polygon({...});
Area(Difference($feature, geom2), 'square-miles');

I am able to successfully 'clip' the ArcGIS Rest Service data layer to a polygon by symbolizing it using the 'type (unique symbols)' style so that only resulting features from the above expression show. However, as previously mentioned this inhibits me from symbolizing a second attribute as desired. 

I like your idea of creating a field that contains a boolean result, then filtering based on that. However, I do not see how to create a field using Arcade unless I go into the 'Data' window of the Rest Service's Content page. Unfortunately I am not the owner of the data layer, and it seems as though the custodian has locked this screen for access (even when I copy/paste the service URL and add the layer to my own AGO).

Is there a way to add a field using Arcade directly within the Map Viewer and populate it with the results of an Arcade expression similar to the one above? 

Thank you,

Ben 

 

0 Kudos