Select to view content in your preferred language

Editing and Writing to Rest without editing tools

2117
1
Jump to solution
01-03-2014 02:47 PM
GISProgrammer
Deactivated User
I'm trying to figure out how to write/edit a new feature to the rest without using the silverlight tools.  Can some one show me an example of this using C#.

Basically if I go to the rest point

http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0...

Then I add something like this in the add box.

[{"attributes":{"OBJECTID":null}}]


Choose JSON format.

It writes a records and returns a result of

{
  "addResults" : [
    {
      "objectId" : 9731707,
      "globalId" : null,
      "success" : true
    }
  ]}


I was wondering if there is an example of how to do this with code. (C #).  I want to create features (records) on a massive scale and don't want to use the editing tools.

Can someone point me in the right direction.

Thanks
0 Kudos
1 Solution

Accepted Solutions
GISProgrammer
Deactivated User
Got it.  I ended up creating a graphic, passing the graphic to my feature layer (which points to my rest) and calling SaveEdits



var g = new Graphic();

g.Attributes["CLEANID"] = Convert.ToInt32(qg.Attributes["OBJECTID"]);

l.Graphics.Add(g);

l.SaveEdits();




Would be interested if there is another way.

Thanks

View solution in original post

0 Kudos
1 Reply
GISProgrammer
Deactivated User
Got it.  I ended up creating a graphic, passing the graphic to my feature layer (which points to my rest) and calling SaveEdits



var g = new Graphic();

g.Attributes["CLEANID"] = Convert.ToInt32(qg.Attributes["OBJECTID"]);

l.Graphics.Add(g);

l.SaveEdits();




Would be interested if there is another way.

Thanks
0 Kudos