Select to view content in your preferred language

Features with empty geometry

3262
2
07-19-2012 08:11 AM
OrlandoCarvajal
Deactivated User
Hi there,

I have a polygon feature class and need to store some times features with shape = null. If I insert an empty-geometry Feature from the Silverlight app, the next time I query features from that feature class, the Geometry of the other Features (with valid polygons) in the app is invalid. For example, extent displays values of NaN. I can see that the JSON response seems to be correct: the Feature comes only with Attributes.

I also wanted to update a Feature, such that its Geometry gets removed. So I set Geometry to null and call SaveEdits(), but the request doesn't send the Geometry attribute. I tried removing all rings from the polygon, and it didn't work either. Not sure if this actually screwed up my feature class.

How should I deal with this type of requirements?

Any help will be appreciated.
Orlando
0 Kudos
2 Replies
OrlandoCarvajal
Deactivated User
Hello there...
Perhaps someone from ESRI could give me an idea on what's going on here? Bug? Developer mistake? Lack of functionality? Cannot be replicated?
Thanks,
Orlando
0 Kudos
PreetiMaske
Esri Regular Contributor
Hi ,

I don't see any techinical issue in what you are doing. I tried both of your usecases on
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer... and didn't run into any issue. Both cases were successful.

For updating I did
(MyMap.Layers[1] as FeatureLayer).SelectedGraphics.ToList()[0].Geometry = null;

And for adding a new feature,
private void Button_Click(object sender, RoutedEventArgs e)
        {
          Graphic g = new Graphic();
          g.Attributes["collection_time"] = DateTime.Now;
          g.Attributes["description"] = "Empty Shape";
          (MyMap.Layers[1] as FeatureLayer).Graphics.Add(g);
        }

Try a simple usecase using service above and let us know if you find any problem.
0 Kudos