Query Layer For Data

826
5
09-17-2012 04:50 AM
MattFeeney
New Contributor
[ATTACH=CONFIG]17719[/ATTACH]
- Black Grid is a 1km sq Grid over the Uk mainland (the grid contains data about the land area within in eg: urban, rural or moorland)
- Red polygon is a user drawn shape
- the yellow area is the feature Set need to return (including the partial grids)

The returning feature set should return each full/partial grid square with it's type of data column (urban, rural, moorland) and the area size it takes up.

i have tried using a QueryTask with a simple Insect query, but that is only going to return all the full grid squares, that the red shape will interact with.

Any help would be very greatful.

Regards

Matt Feeney
0 Kudos
5 Replies
JohnGravois
Frequent Contributor
you can't query for a feature unless its already been published on the server.  if you want to create features with new geometry, you'll have to run an intersect using a geometry service instead.

check out the following sample to see an example of utilizing a geometry service and drawing the result on the clientside.
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/util/util_convexhull.html
0 Kudos
MattFeeney
New Contributor
Sorry, i should have said. This data which forms the 1km2 grid of the UK is published as a Map service. i am enable to query map service, but only able to get just all the complete 1 km2's, not the full and partial areas within the requeted area.

The reason for this, is so that i can calculate how much a user's should be charged for downloading mapping data, each square will be one of three types (urban, rural, or moorland), with each type having a different charge per km2. So partial km2 are required to achieve a accurate cost. The cost is calculated after the user has drawn the area of interest on the map, so the user can decide which layers they want before the complete the order.
0 Kudos
JohnGravois
Frequent Contributor
i'm not sure i follow your question, but it sounds as if you would like to return the features that fall partially within the search extent and then calculate the sq. footage for the proportion of area which is included.

the query task is a technique of retrieving certain features from a map service (either their geometry, attributes or both) and working with them clientside.  since you won't have an attribute field which has already processed the sq. footage of a search extent which is created dynamically in your web application, you can't execute a query to retrieve the result.

in this case you will have to use a geometry service to clip some new features based on this dynamic extent and then calculate the area yourself.
0 Kudos
MattFeeney
New Contributor
i really grateful for your help, it's a difficult one to explain. I will try and explain it more if i can. It's just like the Clip Tool in the toolbox of ArcMap. Using the picture i uploaded, i need a snapshot of the yellow area (like how the clip works), but only need the data that it returns. Looked at using the Clip toolbox tool, and making a geoprocessing service, but found it far to slow and was doing to much for what i was trying to achieve

i would send the layer, but it's a bit large to send through.

Regards

Matt Feeney
0 Kudos
JohnGravois
Frequent Contributor
it sounds as if i understood your request in my previous response and i agree that a custom geoprocessing task would be overkill.  in order to generate geometries for only the areas which are contained in the search extent, you will have to use a geometry service rather than attempting to query your map service.
0 Kudos