Looking for a widget for spatial queries.

2065
9
09-29-2010 11:01 PM
ErwanCaradec
New Contributor II
Hi,
if you had to create a widget witch could query a layer (selected with a combo like in the searchWidget) and return the entities in spatial relation (intersect, contains ...) with a second layer (selected by combo too) and show results on the map with attributes like the searchWidget.
Example with Louisville sample services : Searching the parcels witch contains a Police station.
Is there an existing widget ?
If not, what would be the easiest way ?
- Select entities on the two layer, then intersect with a geometry service
- Select Geometries of the second layer, then query the first layer with a spatial relationship
- Create a Geoprocessing service witch take the two layers and the Spatial relationship as parameters
- other idea

Erwan
Tags (2)
0 Kudos
9 Replies
ErwanCaradec
New Contributor II
self relpy 😉

i'm trying to customize the search widget, adding a new tab for spatial search.

draft :
http://erwan.caradec.pagesperso-orange.fr/flexViewer/index.html?config=configs/tests/config.xml

click the search button to view Louisville's parcels contained in police facilities buffered by 400 meters.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Erwan,

    That is a great addition to the search widget. Good work!
The only thing is you need to set the currentState="yourSpatialState" in the main viewer:BaseWidget tag and wTemplate.selectedTitlebarButtonIndex = 2;. As it stands right now the widget opens to the spatial but says it on the graphical.
0 Kudos
xandermavrides
New Contributor II
Fantastic!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Erwan,

    Do you plan on making this widget available to the public? Would you consider collaborating and having this part of my enhanced search widget? I have been looking into things that I would add to my enhanced search widget while I am migrating it to FlexViewer 2.1 and have been considering buffering. I completely understand if you would like to just publish this widget on your own. If you have no plans on publishing it than I will likely replicate this capabilities my self and add then to my enhanced search widget. In case you are not familiar with my work on the enhanced search widget you can see it here http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=16599
0 Kudos
ErwanCaradec
New Contributor II
Robert,
of course i'd be very happy to collaborate. It would be very kind of you to make this addition a part of your enhanced search widget. If you need my coding, i can comment it out and post.

(sorry for my broken English ^^)

Erwan
0 Kudos
ErwanCaradec
New Contributor II
I've got two problems with the buffer task, of the GeometryService on the sampleserver.

1st : The same query (link below) somtimes returns an empty array.

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/buffer?unionResul...

2nd : 0 value for buffer distance parameter return an error so i can't use it for only make the union of geometries
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Erwan,

   Try using a ArcGIS 10 Server instead like

http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer

The 10 Server has a union method and other features that may help. Also If you don't mind could you post your code for the spatial query portion (no need to comment it).

Thanks
0 Kudos
ErwanCaradec
New Contributor II
The zip file attached contains uncompiled modified version of searchWidget.
Lines are taged // 2010/10/09 #1
<!> For tests usage <!> you can compile it, have a look at ReadMe file first.

Erwan
0 Kudos
ErwanCaradec
New Contributor II
The Rar archive attached contains the uncompiled version of the searchWidget modified with spatial search tab added.
you can compile it <!> for tests only <!>, have a look at the ReadMe file.

Erwan

*Edit* : Thanks Robert, you're right for the union method, but our ArcGIS server is still in 9.3.1.
0 Kudos