Select to view content in your preferred language

Why does the intersect from Geometry service doesn't return attributes?

2406
4
04-14-2011 01:55 PM
weiliang
Deactivated User
Hi,

I try to use a polygon to intersect an underlying polygon layer by using the Geometry Service. However, the returned graphics results has no attributes associated. Is that designed on purpose? From the returned intersect result,since I can still get the same number of graphics from the returned intersect result as input underlying polygon layer, can I assume they are sequentially matched (which means the first graphic in the intersect result should have the save attributes with the first feature in the input underlying polygon layer)?

Thanks for your answer!

Wei
0 Kudos
4 Replies
SanajyJadhav
Deactivated User
I have also face the same problem.It is by design I guess.
0 Kudos
dotMorten_esri
Esri Notable Contributor
GeometryService only works against geometries, and have no concept of attributes. Therefore attributes are not preserved. Grab the geometry you get back and reassign the geometry on the Graphic you parsed in, if you want to modify the graphic instance. Or copy the attributes over to the new graphic feature you get back.
0 Kudos
MichaelSnook
Frequent Contributor
Morton...do you have a quick sample on re-assigning the attributes from the original graphics back to the Geometry service intersect results?

Thanks!
0 Kudos
MichaelSnook
Frequent Contributor
Ahh....nevermind.  I was trying to go the wrong way around.

Since you can't assign attributes to a geometry I needed to start with my origina listing of graphics and assign the geometry out of the intersect. (like Morton said):

           List<Graphic> results = (List<Graphic>)e.Results;

            foreach (Graphic g in pointList)
            {
                g.Geometry = results.Geometry;
                SimpleMarkerSymbol symbol = new SimpleMarkerSymbol();
                g.Symbol = symbol;
                GraphicsLayer.Graphics.Add(g);
                i++;
            }

Hope that helps anyone else.
0 Kudos