Select to view content in your preferred language

Flex Widget Help : Spatial Query

5881
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
18 Replies
RobertScheitlin__GISP
MVP Emeritus

Brian,

  Is the data a true esri date field type? Is it coming from and enterprise geodatabase or etc, etc.?

0 Kudos
BrianO_keefe
Honored Contributor

ALARMDATE ( type: esriFieldTypeDate , alias: ALARMDATE , length: 36 )

Yes. It is.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Is it coming from and enterprise geodatabase or etc, etc.?

0 Kudos
BrianO_keefe
Honored Contributor
0 Kudos
AnthonyGiles
Honored Contributor

Robert, Brian,

Sorry to jump in, but is the following valid due to the greater than sign:

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

should it not be:

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

Regards

Anthony

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Anthony,

   No this time it seems to be the underlying DB type required the "date" designator

0 Kudos
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>

0 Kudos
BrianO_keefe
Honored Contributor

I actually tried something that like. I was using "TRIM" in front of Value thinking that the user entry was padded maybe. and I researched someway to cast that variable to a date, I hadn't found the simple "DATE" command.

I am completely grateful, I get to add that field back in, but I have to ask. HOW.

Is this just DB experience, Flex experience, ArcGIS experience, or what? I would like to know how you got to that answer. If only so I can quit asking questions like this and just get to map making! lol

Thanks again...

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brain,

   Well I start with getting the query to work in the REST endpoint. ArcGIS Dektop help has a great section about searching date fields. Once I knew the proper format for your services DB then it was simply plugging in the right SQL Statement in the xml.

0 Kudos