Select to view content in your preferred language

Is it possible to restrict the extent of MapImage and Feature layers provided es services by ArcGIS Portal?

742
2
05-03-2022 12:10 PM
TomGeo
by
Frequent Contributor

I expose my data as MapImage and Feature layers via Portal, and some of the users have been requesting the possibility to adjust the extent that's requested from the services.

Hence, my thought was to provide a MapTool allowing the user to define a bounding box, and restrict the services to this extent. I do have the MapTool in place but realized thereafter that there is no (easy) way to set the extent of these two MapItemTypes.

I went to the CIM, to see if the connections for any of the two layer types provide the possibility to set the extent, but again, I didn't see any possibility to do so.

Next thought was to give the extent as a parameter when establishing the layer (LayerFactory.Instance.CreateLayer()), using an Uri like this one: 

https://our-maps.company.com/portal/home/item.html?id={service.Id}.

But, simply adding a &extent=minX, minY, maxX, maxY only leads to that the requested layer does not exist.

When I was trying to inspect the layer exposed through Portal, I used Python from within ArcGIS Pro, having a look at the values of the extent. One thing puzzled me a bit and that is that the extent coordinates have been returned in WGS84, even though the layers are all in UTM32N!?

 

Now I wonder if it is at all possible to achieve want I want to do, to restrict the extent.

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos
2 Replies
TanuHoque
Esri Regular Contributor

@TomGeo 

I'm afraid I'm not quite sure about your use case and requirements.I'd appreciate if you could kindly explain it a bit more, may be with some screenshots.

Are you trying it do it from Pro?

Have you looked at this clipping and spatialFilter options in map service export, identify etc. operations? Do you think that might help you?


https://developers.arcgis.com/rest/services-reference/enterprise/export-map.htm#ESRI_SECTION1_AB906D... 

0 Kudos
TomGeo
by
Frequent Contributor

@TanuHoque,

yes, I am using Pro.

The use case for my colleagues is e.g. a construction site. For whatever reason the colleague has to take all the existing buildings in the vicinity into consideration and she/he knows that we offer building polygons as a nation-wide feature layer at our portal.

The colleague request the data through an addin as a feature service layer. The area of the mapview is at that point covering not only the closer area around the construction site, but actually the whole municipality (or worse: the whole country).

It takes now a while to get, and visualize all the unnecessary building polygons, and the they clutter the mapview.

To avoid exactly that, the colleague will most likely then go to the portal, define a bounding box and extract the data through the portal, to store the data locally, where they will be outdated after a short while. Of course, buildings might not be the best example, but you get the point.

To provide my colleagues with an easy way to retrieve data from the portal, without knowing to much about the portal I wrote an addin, offering a little ui, where the user get all the publicly available geo-data (provided through our portal) . Here, the user has the possibility to use a map tool to define a bounding box, which I would like to use to limit the requested service layers to.

TomGeo_0-1652704079425.png

TomGeo_2-1652704249673.png


Hence, the question about adding a &extent=minX, minY, maxX, maxY into the uri, when creating the service layer in Pro.

I am aware of the possibilities the user has, once the data are in the map. What I want to do is to limit the data before they come into the map, and to avoid redundant, and/or outdated data laying around in all sort of project folders.

- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!
0 Kudos