3

Within the ESRI SDK resources there is an example of combining polygons by use of a geometry bag. The following code appears:

 'Define the spatial reference of the bag before adding geometries to it.
 geometryBag.SpatialReference = geoDataset.SpatialReference

That makes sense, based on some of the other documentation surrounding geometry bags, but when I tried it myself, I got a compile error saying that the method didn't exist. After looking at the geometry object model diagram, it appears as if the spatial reference property of a geometry bag is read-only... so what gives?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked May 9, 2011 at 12:36
1
  • If this really is VBA, don't you need to use "set"? Commented May 9, 2011 at 13:39

1 Answer 1

5

Cast the geometry bag to an IGeometry first, then try setting its SpatialReference property.

The behavior you describe is weird, though, since IGeometryBag descends directly from IGeometry. Are you sure you are trying to set the spatial reference on the correct interface?

answered May 9, 2011 at 12:54
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.