Select to view content in your preferred language

Need to do spatial query when using Export Map operation

619
1
04-24-2013 06:57 PM
wangzhifang
Frequent Contributor
Hello everyone,
I have a need to do spatial query and attributed query when using export map operation on a map service resource. However, there is only "layerDefs" parameter on export operation.
While my map service only contains a point layer, so now I have a workround that do a spatial query(including where clause) on the point layer resource using query operation and fetch only lots of objectIDs, then push these result IDs to layerDefs of export, such as
"layerDefs=0:objectids in (1,2,3...9999,10000,....15000,....)".
This works but, as you see, the spatial query result may have more than 10 thousands IDs, and do such query only in database would be time consumed...
So I wonder is there any other ways to do my job? Or why not export map operation add a "geometry" parameter as query operation do?

Many thanks!
0 Kudos
1 Reply
wangzhifang
Frequent Contributor
OK, I found that "layerDefs" on export map operation do accept spatial sql function to perform spatial query, such like:
layerDefs = "0:sde.st_within (shape, sde.st_geometry ('polygon ((13033822 4374104, 13124324 4374104, 13124324 4438923, 13033822 4438923,13033822 4374104))', 3857)) = 't'"

The same to Query Definition tab on layer properties dialog in ArcMap.
0 Kudos