Query with KMZ format output returns bad results

3725
4
05-09-2012 06:29 AM
OlegKachirski
New Contributor III
AGS Server 10 SP2, using REST endpoint to query based on attribute value, such as:

http://server/ArcGIS/rest/services/MyService/MapServer/1/query?text=&geometry=&geometryType=esriGeom...

Works great, returns 557 records. If I change the last parameter (format) to f=kmz, the KML returned contains all of the records in that layer (> 2000) - so WHERE clause doesn't seem to matter. A known bug?
0 Kudos
4 Replies
RaviNarayanan
Esri Contributor
It doesn't seem like a generic bug. For example, give this request a try.

http://servicesbeta.esri.com/ArcGIS/rest/services/Hurricanes/Hurricanes/MapServer/0/query?text=&geom...

Is there any join table in the layer that is queried?
0 Kudos
ThomasBarthes
New Contributor
Hello,

Old thread but I'm currently facing the same problem...

I've three layers in a MapService (bus stops, commercial paths and non commercial paths) and each layer is mapped with a table in an SQLServer GeoDatabase. Each field in thoses tables contains an "site id", so that we know to which City it belongs.

There are two relationship classes in my Geodatabase :
- One linking bus stops and commercial paths
- One linking bus stops and non commercial paths

The Map Service is published with the "KML" capability.

Everytime I launch a query request using REST interface on a layer (let's say for example the bus stops layer), using a Where clause to filter on a particular site_id :
- if the out format is "HTML" or "JSON", then the result contains only the bus stops of the desired site
- if the out format is "KMZ", then the results contains the bus stops of the whole database...

Looks like the where clause is not considered when the output format is set to KMZ.

Any idea on this ?


Regards,
Thomas
0 Kudos
StevenMoore1
Esri Contributor
Hi,

It looks like you are running into the following bug:

NIM075556 - REST queries do not honor the �??Where�?� clause for KMZ response if the map service is created from an MXD

The workaround is to publish your services from an MSD rather than an MXD.

Hope this helps.
0 Kudos
KevinGooss
Occasional Contributor

I am now seeing a similar issue. 10.04.

Anyone find a solution?

0 Kudos