GeoRSS Editor alpha version is up and running
GeoRSS is a great way to share geographic information that updates all the time, sending simple geography (points, lines and polygons to a consumer.
GeoRSS is RSS with a collection of points, as flexible as RSS with the advantage of providing location to your information. A great tool that I personally use in a regular basis in my professional and personal life. If I may I would recommend to extend GeoRSS to add attributes for viewers to display. I would like to suggest to add <georss:icon>, <georss:backcolor> and <georss:forecolor>
By adding those attributes, viewers would be able to render the geography in a richer manner as well will provide the user different points legends instead of waiting for the tooltip to know what this point represents. I would like also to even suggest to add labeling on the feature displayed <georss:label> so does not need to open the tool tip to see the title and description. I personally started using the <georss:title> as the label for the geometry.
Last night I spend a few hours creating the first version of the GeoRss editor for you to create your own GeoRSS and publish it immediately.
This time I used the ESRI JavaScript API to accomplish the task, as the API comes with objects that can be converted to Json format. Very useful to serialized. Using the esri.geometry object I add all objects into a JavaScript Array and then with a little help from the dojo library I convert it to Json to send to the server:
var JsonString = dojo.toJson(_geometryCollection);
On the server side using the System.Web.Script.Serialization.JavaScriptSerializer I can create a collection of geometry to convert to GeoRSS.
public static object JSONDeserialize(string json)
{
JavaScriptSerializer ser = new JavaScriptSerializer();
object obj = ser.DeserializeObject(json);
return obj;
}
I recommend extensive using of generics to get all the objects from Json.
string sJsonQuery = Request.Params["geometry"].ToString();
object obj1 = JSONDeserialize(sJsonQuery);
object[] Items = ((object[])(obj1));
for (int i = 0; i < Items.Length; i++)
{
System.Collections.Generic.Dictionary<string, object> PreValue = ((System.Collections.Generic.Dictionary<string, object>)(Items[i]));
This is just the first cut, a quick proof of concept for me to enjoy after all the kids are in bed and I feel like writing some code instead of watching the Democratic National Convention. There are many things to polish and fix.
· Send the Json containing the geometry to the server using AJAX instead of opening another window to fire the postback.
· Adding too many polygons will cause Json to be corrupted.
· Lines are not implemented yet, but I left the button there
· Allow to change the title and description on the geometry as well as the color and pattern.
· Store it forever into the database instead of using the cache object.
· Show other peoples GeoRSS
· Allow users to start with their GeoRSS to start editing.
As always, looking forward to your feedback and comments.
Cheers
Al
Posted from
http://weblogs.asp.net/albertpascual