kyanuk1

Copying point location into new feature class

Discussion created by kyanuk1 on Dec 4, 2012
Latest reply on Dec 5, 2012 by chump4life
Hello;

I am trying to grab point features from an existing point layer (feature class), and add a new point feature into a different feature class at that location (based on irrelevant criterion).


What I have creates new features, however, It puts all the features on top of each other at a single location, far away from the actual points I got the geometry from.  My code:


IFeature newConflict = fc.CreateFeature(); //feature class to create feature

newConflict.Shape = mFeat.Shape;  //mFeat is where I am pulling data from into newConflict

newConflict.Shape.SpatialReference = mFeat.Shape.SpatialReference;

//check for field, then add values
if (newConflict.Fields.FindField(FieldName) != -1)
{
    if (Value != null) Feature.set_Value(newConflict.Fields.FindField(FieldName), Value);
    else Feature.set_Value(newConflict.Fields.FindField(FieldName), DBNull.Value);
}
newConflict.Store();


Does feature.Shape not have contain location?  I thought it was complete geometry.

Do I need to manually store the Shape into the Shape field?


Thank you

Outcomes