SQL Query and display of results on the map
I have a Workflow that queries a SQL Server View and makes the result available as a CSV download. The resulting CSV has X, Y coordinates and can be manually uploaded to the site and displayed on the map. So far, so good.
However, we would like to duplicate the WebADF behavior so that after the query runs, the corresponding points are automatically uploaded and displayed on the map. In other words, remove the step where the user has to download the CSV and upload it manually. Is that possible to do with a Workflow?
Thanks,
Steve
-
Hi Steve,
The "SQL Query" activity gets you a DataTable. You can then use "DataTable to FeatureSet" to create a FeatureSet that doesn't contains any geometries. Now the tricky bit... you'll need to loop through the Graphics of the FeatureSet and assign the Geometry property of each Graphic a new MapPoint based on the current X, Y attributes. Now you can call "Select Features" and you'll be able to see your points as if it were a regular search/identify result.
There isn't a facility in workflow today to create a new standalone layer that appears in the Layer List (like a user added CSV layer) from a FeatureSet.
--Ryan
0 -
Thanks for the reply, Ryan. Conceptually I understand what you are saying. Practically speaking, I don't even know how to start. Is this something I could get help with if I place a support call?
0 -
I'm about to venture down this path and am curious if there is any further development on this... Perhaps a snippet to share.
Thanks!
0 -
Hi Erik,
We ended up using some support time on this. What we found is we could highlight a point on the map, but that was simply a highlight and not actually a feature.
We ultimately abandoned the idea and replaced it with a SQL query that generates a CSV (with X-Y coordinates) that can be dropped on the map.
Steve
0 -
Hi Steven
when you say it was simply a highlight , do you mean it was a temporary, drawing only graphic?
By a feature, are you really wanting a new record in a spatial dataset that will be available for future use? If that is the case then you need to set up a feature service to receive and add those highlights to it.
Regards
Ralph Price
0 -
Hi Ralph,
It really was only a highlight that was displayed. It wasn't drawing a graphic. We wanted it to draw a graphic. Calling it a "feature" was a poor choice of wording on my part. I should have refered to it as a "graphic", such as you get when you load a .csv file with X-Y coordinates to the web map.
The explanation I received from tech support was this would require the ability to create a Graphics layer from workflow, and add graphics with attributes to it. I was also told a feature request would be entered for the ability to add identifiable graphics from Workflow, though I haven't checked the latest version to see if it's there yet.
So, with that, we moved on to a different solution.
Steve
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
6 Kommentare