Query Problems when using query.geometry (Stumped).

12703
12
04-26-2011 05:46 AM
by Anonymous User
Not applicable
Original User: cschafer5

Hi,

I am wanting to run a Query that only displays the results within a specified polygon. I am doing this using query.geometry. I am getting the results I am looking for from most of my URLs and some return an error back to me.

I have attached pictures to show the problem.

The two pictures with arrows shows what I want to happen. In the first picture I get the hit the cap of 500 and on the second picture I click my checkbox to add the WV polygon to the query.geometry and get results only within the state.

The other two pictures show what happens with some URLs. The one not bound to the state gives me the results I expect. The second, when bound to the state using query.geometry, returns an HTTP error.

I can't figure this one out. Is there a reason I would get an error when the only additional code between the two is the added geometry?

Here are the two URLs used in the example:
1 (works):
http://publicsafetytemplates.esri.com/ArcGIS/rest/services/EMCOP/PublicSafetyFeedSample/MapServer/0

2(Gives me an Error):
http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_usdata/MapServer/0
0 Kudos
12 Replies
by Anonymous User
Not applicable
Original User: watson_j

Not sure if this is related, but I am noticing that sometimes either the Flex API or the Viewer (at 2.3.1) is making an invalid URL when hitting REST services on my server.  It is asking for ".../mapserver/..." instead of ".../MapServer/..." as it should.

Might want to focus on the URLs being sent back/forth to your server to make sure they are not mal-forming the "MapServer" mixed-case to "mapserver" lower-case.
0 Kudos
CaseyBentz
Frequent Contributor
So, now that I am querying the proper service.  I now get the same error as you.  The fault content shows that it is an invalid url.  I am not sure what the xml style comment is all about.

The specified URL cannot be found<!--0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234-->

It is really weird, when I go back to attempting to draw a polygon to query that layer, I get some mixed results.  I can draw a simple rectangle and get a proper result every time.  I can draw a point to point style polygon with up to 36 vertices and it will work.  When I try 37 or more it fails everytime.  I can also draw a very small free hand polygon and it works, I am assuimg that it has less the 37 vertices.  It seems like there is something up with rmgsc.cr.usgs.gov's ArcGIS Server.
0 Kudos
by Anonymous User
Not applicable
Original User: caseybentz8

You could try this method, add a where tag to your query. It appears that the STANAME always ends with the state abbreviation. I then commented out the query.geometry = borderGeom line, and it brings back 118 features.


<esri:Query
[LEFT]id="query"

outSpatialReference="{myMap.spatialReference}"
where="STANAME LIKE '%WV'"


returnGeometry="true"/>

[/LEFT]
0 Kudos