Select to view content in your preferred language

Flex Widget Help : Spatial Query

5824
18
Jump to solution
01-12-2015 08:20 AM
BrianO_keefe
Honored Contributor

I've been stepping so far away from Flex maps lately due to the Web App Builder and Javascript maps. Now I've got a map that management wants me to keep in Flex right now and add a spatial query element.

I have Council Districts (on one layer) and Incidents (each year has it's own layer). I need to create a way for Fire to query incidents by Council District. What the best widget for this?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Brian,

  Here is what I got working with your data:

<value prompt="1/1/2014" isvaluerequired="true" autosubmit="true">ALARMDATE >= date'[value] 00:00:00'</value>

View solution in original post

0 Kudos
18 Replies
RobertScheitlin__GISP
MVP Emeritus

Brian,

  This is what the eSearch is designed for

0 Kudos
AnthonyGiles
Honored Contributor

Brain,

If I am reading your question correctly you want to perform a spatial query i.e. select the points from one layer that intersect with a polygon from another layer, have a look at the Roberts e-search widget that allows you to perform spatial searches from the results of another search:

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e 

Regards

Anthony

0 Kudos
BrianO_keefe
Honored Contributor

Then I guess my experience with the eSearch widget is incomplete because I've never tried to do a spatial query like this with it. Is there a good example somewhere?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brain,

   Here are some steps to follow in the Live Preview Site

  1. Leave the search layer as "Louisville Zoning" and the search layer field as "Zoning Code"
  2. Click the search drop down list and choose "OTF" and click search.
  3. Click the search search button at the top of the widget.
  4. Change the buffer distance to one mile (you need to do this on the live preview site as there is no spatial search layer that is actually contained in the search result there) and click the buffer button.
  5. Now in the search entities of drop down choose "Traffic Cameras"
  6. Now click the "entirely contained in" button.
  7. Choose buffer graphic. Now you have all the traffic cameras that are within on mile of the parcels that have a zoning code of "OTF".
0 Kudos
BrianO_keefe
Honored Contributor

Ok...

I see how this could work. But how do I configure this IN the widget? Is there an example? I can't wrap my head around the XML necessary to get this rolling. One working example would be perfect. I am able to deconstruct from other REST services and such... cut-n-paste would do it.

Anyone?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brian,

   I think that you are over thinking this. You just add both layers that you are interested in searching (Council Districts and Incidents) like you would any other search layer and the only difference is on Incidents layer you make sure that the spatialsearchlayer is set to true (this is what will add "Incidents" to the Spatial Search drop down list):

<spatialsearchlayer>true</spatialsearchlayer>

0 Kudos
BrianO_keefe
Honored Contributor

*facepalm*

Yup. Overthinking. My co-worker claims I do that ALOT. (I think he's right)

Of course now I'm having issues with a date search inside of one of the REST services.

I'm using...

<value prompt="Example: 1/1/2014-12:56" isvaluerequired="true">(ALARMDATE) = trime('[value]')</value>

And getting squat. I've used "ALARMDATE = '[value]'" and (ALARMDATE} LIKE ('%[value]%') and nothing is working... I'm not certain on the DATE requirements for fields in the eSearch widget so it's probably something simple... any ideas?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brain,

   There is an example of a date search in the eSearchWidget.xml

<value prompt="Example: 2012/04/16">datetime >= '[value] 00:00:00'</value>

0 Kudos
BrianO_keefe
Honored Contributor

I had already tried that and it wouldn't work with my date field. I've tried a few variants on the field and finally just gave up. I don't know why it wouldn't work.

0 Kudos