when do I use a filter? In the MXD with a definition query or in the Web Map?

900
4
Jump to solution
02-02-2018 05:55 AM
StewartGalloway
New Contributor III
I am running ArcGIS Server and Portal.  I used Web App Builder to create a Web Map  and a Web Map App.  I now want to filter one of the Feature Classes.  Where do I do this, in the MXD with a definition query or in the Web Map?
thanks.
0 Kudos
1 Solution

Accepted Solutions
rachelg_esri
Esri Contributor

Hello Stewart,

Assuming I am understanding your workflow correctly, there are several points at which you could filter your data for a smaller subset.

First I'd like to confirm I understand your workflow. Let me know if any of this is incorrect?

- You started with data in ArcGIS for Desktop

- You published your content from ArcGIS for Desktop to Portal for ArcGIS

- You then used Portal for ArcGIS to create a web map

- You then created a Web AppBuilder Application from the web map in Portal for ArcGIS

Assuming these steps are correct, you have the following options:

Create a new feature class before publishing

- You can create a subset of data by first applying a Definition Query in ArcMap, and then exporting the data from the feature layer into a new feature class. You can then publish the data.

See: Displaying a subset of features in a layer

Publish with a Definition Query

- You can publish to Portal for ArcGIS with a Definition Query - the definition query should be honored in selecting what data is uploaded to Portal for ArcGIS

Create a view with a filter applied

- You can create a new view of a feature service which essentially becomes a subset of the data. This can be done from the Item Details page in Portal for ArcGIS under Visualization.

- Note that views are a relatively new functionality so depending on what version of Portal for ArcGIS you're using, this may not be an option yet.

See: Create hosted feature layer views

Filter the data in a web map

- You can apply a filter to the data in a web map to hide some of the data.

See: Apply filters

Apply a filter in the application

- You can use widgets to apply a filter to your data. For example, you can use the Filter widget or Group Filter widget in the Web AppBuilder application.

See: Filter widget and Group filter widget

Apply a filter prior to analysis or export

- You could use the Query widget to select only a subset of the data in a Web AppBuilder application prior to using any analysis or exporting the content.

See: Query widget

Ultimately, it depends on whether you want all the data to be hosted in ArcGIS Online, whether you want an adjustable filter for your users to hide or unhide content, or if you want a filter only for exporting certain data from a Web AppBuilder application.

Hopefully that answers your question!

- Rachel

Rachel Guttmacher
ArcGIS Online Technology Lead
Esri Support Services

View solution in original post

4 Replies
rachelg_esri
Esri Contributor

Hello Stewart,

Assuming I am understanding your workflow correctly, there are several points at which you could filter your data for a smaller subset.

First I'd like to confirm I understand your workflow. Let me know if any of this is incorrect?

- You started with data in ArcGIS for Desktop

- You published your content from ArcGIS for Desktop to Portal for ArcGIS

- You then used Portal for ArcGIS to create a web map

- You then created a Web AppBuilder Application from the web map in Portal for ArcGIS

Assuming these steps are correct, you have the following options:

Create a new feature class before publishing

- You can create a subset of data by first applying a Definition Query in ArcMap, and then exporting the data from the feature layer into a new feature class. You can then publish the data.

See: Displaying a subset of features in a layer

Publish with a Definition Query

- You can publish to Portal for ArcGIS with a Definition Query - the definition query should be honored in selecting what data is uploaded to Portal for ArcGIS

Create a view with a filter applied

- You can create a new view of a feature service which essentially becomes a subset of the data. This can be done from the Item Details page in Portal for ArcGIS under Visualization.

- Note that views are a relatively new functionality so depending on what version of Portal for ArcGIS you're using, this may not be an option yet.

See: Create hosted feature layer views

Filter the data in a web map

- You can apply a filter to the data in a web map to hide some of the data.

See: Apply filters

Apply a filter in the application

- You can use widgets to apply a filter to your data. For example, you can use the Filter widget or Group Filter widget in the Web AppBuilder application.

See: Filter widget and Group filter widget

Apply a filter prior to analysis or export

- You could use the Query widget to select only a subset of the data in a Web AppBuilder application prior to using any analysis or exporting the content.

See: Query widget

Ultimately, it depends on whether you want all the data to be hosted in ArcGIS Online, whether you want an adjustable filter for your users to hide or unhide content, or if you want a filter only for exporting certain data from a Web AppBuilder application.

Hopefully that answers your question!

- Rachel

Rachel Guttmacher
ArcGIS Online Technology Lead
Esri Support Services
StewartGalloway
New Contributor III

thanks Rachel. very helpful to have all of the options laid out. i ended up using Filter the data in a web map.

JKGIS08
New Contributor III

Are any of these options better than the other in terms of map service performance?

0 Kudos
TanuHoque
Esri Regular Contributor
Are any of these options better than the other in terms of map service performance?

Nope. As we know, it is always recommended to have indices on the fields used in definition query.

Just a side note: when you set a def query on a layer in the mxd or aprx, and publish a map service (aka map image layer), that def query is burned in the map with the layer. And you won't be able to overwrite/replace it from any web application. Overwriting/ replacing will require republishing. There are many cases, this is desirable. Other cases, it makes sense to publish without def query, and set def query/filter from the web app/map.