POST
|
You can try using a ITopologicalOperator and just Union them together. in c++ assuming ipGeometryOne and ipGeometryTwo are valid IGeometryPtr's: HRESULT hr = ((ITopologicalOperatorPtr)ipGeometryOne)->Union(ipGeometryTwo, &ipGeometryOne);
... View more
09-25-2013
04:41 AM
|
0
|
0
|
208
|
POST
|
Goal is to eventually have access to the set of features that failed during the LoadNetwork portion of building out the geometric network. Currently I'm importing data, getting a nice network built out and via arcmap I can see the error table and more or less grasp which features aren't correct and why. My problem, and I wouldn't be surprised if I was going down the wrong path, is that the IGeometricNetworkErrorDetection isn't loading that table. Its actually failing to create the selection set. ipNetworkClass = featureClassPtr;
hr= ipNetworkClass->get_GeometricNetwork(&ipGeometricNetwork);
ipNetworkErrorDetection = ipGeometricNetwork;
hr = ipNetworkErrorDetection->CreateSelectionSetFromErrorTable(&ipSet); How do I access the features the BUILDERR table references? Thanks, Bennett
... View more
09-24-2013
10:52 AM
|
0
|
0
|
414
|
POST
|
Trying to retrieve raster values from a layer. Never seems to get the correct data. Am I forgetting to do something? Colpixel and rowpixel also seem to be wildly off.
ILayer2Ptr ned = GetLayerView()->GetLayerByName(ned_layer);
ISpatialReferencePtr mapSpatialRefPtr;
GetMapView()->m_MapControlPtr->get_SpatialReference(&mapSpatialRefPtr);
ned->putref_SpatialReference(mapSpatialRefPtr);
IRasterLayerPtr rastLayerPtr(ned);
IRasterPtr rastPtr;
rastLayerPtr->get_Raster(&rastPtr);
IRaster2Ptr rast2Ptr = (IRaster2Ptr)rastPtr;
if(rast2Ptr == NULL)
return;
while(curLine.GetCurrentPoint() != NULL){
CPoint *Pnt = curLine.GetCurrentPoint();
long colpixel = 0;
long rowpixel = 0;
rast2Ptr->ToPixelColumn(Pnt->x, &colpixel);
rast2Ptr->ToPixelRow(Pnt->y, &rowpixel);
_variant_t ret;
rast2Ptr->GetPixelValue(0, colpixel, rowpixel, &ret);
double val = double(ret);
Pnt->z = val;
curLine.NextPoint();
}
... View more
09-05-2012
09:40 AM
|
0
|
0
|
510
|
POST
|
For the most part you shouldn't have to. ESRI objects will generally selfdestruct nicely when the function/scope gets closed. I would check the logic and make sure the process ITopologicalOperator is performing, is working only when wanted.
... View more
05-16-2012
02:19 PM
|
0
|
0
|
417
|
POST
|
Before this I select a geometry within a specific layer IGeometryPtr ClassName::GetSelectedShape(CString layerName) { IFeatureSelectionPtr featureSelection; featureSelection = GetLayerByName(layerName); if (!featureSelection) return NULL; ISelectionSetPtr selectionSet; featureSelection->get_SelectionSet(&selectionSet); IEnumGeometryPtr enumGeometry; enumGeometry.CreateInstance(CLSID_EnumFeatureGeometry); IEnumGeometryBindPtr enumGeometryBind = enumGeometry; enumGeometryBind->BindGeometrySource(NULL, selectionSet); IGeometryPtr geometry; enumGeometry->Next(&geometry); return geometry; }
... View more
05-11-2012
08:27 AM
|
0
|
0
|
243
|
POST
|
Turned out to be an input error. The IGeometryPtr i was passing in wasn't correct some how so I changed my method of creating it and it works fine now. I'm not entirely sure why pulling a polyline from a layer didn't work, but building the line in memory does. Thanks
... View more
05-11-2012
04:02 AM
|
0
|
0
|
243
|
POST
|
Everything seems to work fine, up until I actually create the buffer, then it doesn't do anything and has 0 shapebuffers. the geometry collection does have 1 object as it enters ConstructBuffers. IGeometryPtr BufferGeometry(IGeometryPtr inShapePtr, double distance, esriBufferConstructionSideEnum side) { long buffCount = -1; IBufferConstructionPropertiesPtr bufferProp(CLSID_BufferConstruction); IBufferConstructionPtr bufferPtr = (IBufferConstructionPtr)bufferProp; bufferProp->put_SideOption(side); bufferProp->put_EndOption(esriBufferFlat); bufferProp->put_ExplodeBuffers(VARIANT_FALSE); bufferProp->put_OutsideOnly(VARIANT_FALSE); bufferProp->put_GenerateCurves(VARIANT_FALSE); bufferProp->put_UnionOverlappingBuffers(VARIANT_TRUE); bufferProp->put_DensifyDeviation(-1); if(!inShapePtr) return NULL; IGeometryCollectionPtr geometryBag(CLSID_GeometryBag); IGeometryBagPtr shapesBagPtr = (IGeometryBagPtr)geometryBag; ISpatialReferencePtr spatialRefPtr; inShapePtr->get_SpatialReference(&spatialRefPtr); ((IGeometryPtr)shapesBagPtr)->putref_SpatialReference(spatialRefPtr); ((IGeometryCollectionPtr)shapesBagPtr)->AddGeometry(inShapePtr, &vtMissing, &vtMissing); ((IGeometryCollectionPtr)shapesBagPtr)->get_GeometryCount(&buffCount); IGeometryCollectionPtr shapebuffer(CLSID_GeometryBag); ((IGeometryPtr)shapebuffer)->putref_SpatialReference(spatialRefPtr); HRESULT hr = bufferPtr->ConstructBuffers((IEnumGeometryPtr)shapesBagPtr, distance, shapebuffer); if(shapebuffer) shapebuffer->get_GeometryCount(&buffCount); return shapebuffer; }
... View more
05-09-2012
06:28 AM
|
0
|
4
|
568
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|