require(["esri/tasks/geoenrichment/SubGeographyQuery"], function(SubGeographyQuery) { /* code goes here */ });
Description
(Added at v3.12)
(Currently in beta)
Represents StandardGeographyQuery parameters to search subgeographic areas that are within a parent geography. For example, you could return all the U.S. counties within a given U.S. state or you could return all the Canadian postal areas (FSAs) within a Census Metropolitan Area (city).
Samples
Search for
samples that use this class.
Class hierarchy
esri/tasks/geoenrichment/GeographyQueryBase
|_esri/tasks/geoenrichment/SubGeographyQuery
Constructors
Properties
Methods
Constructor Details
Creates a new instance of the SubGeographyQuery object.
Parameters:
<Object > json |
Optional |
JSON object used to set the properties of the object. JSON field names should match either the property names of the class, or the property names used in the REST API. |
Sample: Query for ZIP codes in the state of New York
require([
"esri/tasks/geoenrichment/SubGeographyQuery", ...
], function(SubGeographyQuery, ...) {
var query = new SubGeographySubQuery({
countryID: "US",
datasetID: "USA_ESRI_2013",
filterGeographyLayerID: "US.States",
filterGeographyWhere: "New York",
generalizationLevel: "6",
returnGeometry: "true"
});
...
});
Query for all towns in France containing the word "Paris" in their fields
require([
"esri/tasks/geoenrichment/SubGeographyQuery", ...
], function(SubGeographyQuery, ...) {
var query = new SubGeographyQuery({
countryID: "FR",
datasetID: "FRANCE",
generalizationLevel: "6",
filterGeographyLayerID: ["FR.Commune"],
filterGeographyWhere: "Paris",
returnGeometry: "true"
});
...
});
Property Details
Two-digit country code. For example: "US".
Optional string that denotes the ID of a dataset associated with a particular country.
Sample: query.datasetID = 'US.Census2010';
Optional integer value where you can limit the number of features that are returned from the geographyQuery. If null
, the server will default to 1000.
Parent layer geography IDs.
Optional integer that specifies the level of generalization of the geometries. A value of 0 returns the most detailed and 6 is most generalized. Some geography layers, like 'countries', do not support returning highly detailed geometries.
Known values: 0|1|2|3|4|5|6
Default value: 0
Determines spatial reference for output geometry if returnGeometry is set to true.
Use this parameter to return all the geometries as points. For example, you could return all U.S. ZIP Codes as centroids. Only applies if the returnGeometry property is also set to true.
Known values: true | false
Default value: false
Determines whether response will also include geometries.
Known values: true | false
Default value: false
Layer ID to return features from.
Optional boolean to enable fuzzy search. See the
REST API for details about using fuzzy logic.
Known values: true | false
Default value: false
Method Details
Converts object to its JSON representation. Field names in the JSON will match field names used by the
REST API.