4

I am working with ArcObjects SDK 10 for .NET. There is already a geospatial database at my disposal. So I am trying to map its spatial context to ArcObjects context.

We have objects like state, country, city, etc. Each object has one or more geometry definitions that are not necessarily the same type. For example, a state object for California contains the polygon for state shape and additionally a point for the state's center point (centroid).

After reading this article, what I understand is that a FeatureLayer is a UI concept to display layers of Features on ArcMap and FeatureClasses are a way to group same geometry type Features. In addition, there is a one-to-one mapping between a FeatureLayer and a FeatureClass.

So I have two questions:

  • There is no way a FeatureLayer could contain Features with different types, right?
  • It is impossible for me to create one layer per my object on ArcMap, because my object has multiple geometry types. Is that right?

Then, how could I come up with a layer definition that lets me select and operate on same object at the same time (such as select cities, select countries)?

  • 1
    You may have different feature classes within a feature dataset being different geometry types. You can edit each of these geometry types (eg. adding polylines to the polyline feature class, adding points to the point feature class table...etc). So, you are wanting to access a given feature class within a feature dataset? – artwork21 Feb 22 '16 at 19:30
  • 1
    I think the OP wants to find all geometry objects that represent the same "place." Example: state centroid point plus state outline polygon. – mkennedy Feb 22 '16 at 19:52
  • @artwork21 no, not that. I think mkennedy might have given good example. – mert Feb 22 '16 at 20:08
  • @mert I just edited the question a little bit to make the terminology a little clearer. Please revert if I've gotten it wrong. If I understand correctly, a feature layer in ArcMap is a construct to persist symbology for a feature class. See this question. – mkennedy Feb 22 '16 at 20:14
  • Go for feature class representation. You can have a geometry for representation and one actual geometry of the object! If you change the feature representation (e.g. transformation), the actual geometry remains intact! – Farid Cheraghi Feb 24 '16 at 21:42
0
  • There is no way a FeatureLayer could contain Features with different types, right?
  • FeatureLayer has a reference to FeatureClass. So, it can only contain Features of same FeatureClass.
  • It is impossible for me to create one layer per my object on ArcMap, because my object has multiple geometry types. Is that right?
  • That is right.

The solution I found is to use IGroupLayers. I create IGroupLayer for each of my object type (country, state, city etc). Within the group layer, I create three different FeatureClass: one for polygon, one for line and one for point. Using these FeatureClasses I create a FeatureLayer per geometry object such as state border (polygon) or city center (point).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.