|
POST
|
In my ArcObjects projects, there is a function to Insert a polygon feature from a Source FeatureClass into a Target FeatureClass (fc_Target). The related code is below: IFeature f_Target = fc_Target.CreateFeature(); f_Target.Shape = f_Source.Shape; // f_Source - feature of Source FeatureClass; Got error However, it throws an error: The geometry is not Z-aware. Then, I found that the fc_Source is a type of PlogonZM, while the fc_Target is type of Polygon. How can this problem be fixed? Thanks.
... View more
07-24-2017
07:06 AM
|
0
|
1
|
2903
|
|
POST
|
I have solved this problem. The trick is that the .Store() CANNOT be used. The proper solution is using feature.Insert(true). My code is below: IFeature InsertFeature(IFeature f_Source, IFeatureClass fc_Target) { IFeature f = Assign_TargetFeature(f_Source, fc_Target ); // Assign values only IFeatureBuffer pFeatureBuffer = (IFeatureBuffer )f; IFeatureCursor pFeatureCursor = fc_Target.Insert(true); pFeatureBuffer.Shape = f_Source.Shape; pFeatureCursor.InsertFeature(pFeatureBuffer); return (IFeature)pFeatureBuffer; } Thanks for your review.
... View more
07-19-2017
11:17 AM
|
0
|
0
|
536
|
|
POST
|
I tried one of our ArcGIS Server Manager. I can delete the existing .soe, but can't load a .soe, which takes more than 15 min. but is still frozen. What should I do on it? Thanks.
... View more
07-19-2017
06:16 AM
|
0
|
1
|
591
|
|
POST
|
I have an ArcObjects project. In this project, FeatureClass Source (termed as fc_Source here) is compared with FeatureClass Target (termed as fc_Target). The general logic is described below: 1) Loop through fc_Source, get a feature, termed featureS. 2) Check if the featureS. exists (or overlaps with a feature in fc_Target. 3) If the return is true on 2), set featureS as fc_Source.NextFeature. If the return is false in 2), featureS will be inserted into fc_Target, and then set featureS as fc_Source.NextFeature till all of the features in fc_Sourceare looped through. In 3)'s Inserting a feature into fc_Target, I got such problem: the feature inserted does carry the featureS values but NOT its right geometry. The inserted one's geometry is actually the NextFeature of fc_Source. The simplified related code is below. What is wrong in my code? I do wish someone can point out. Thanks a LOT. // Loop though fc_Source featCursor = fc_Source.Search(qfQuery, true); IFeature featureS = featCursor.NextFeature(); // Loop featureS though fc_Target. If found featureT != null; else Not Fount, featureT = null; IFeature featureT = getFeature_GeometryCompare(featureS, fc_Target); while ( featureS != null) { if (featureT != null) { ... } else { featureT = Assign_TargetFeature(featureS, fc_Target); featureT.Store(); } featureS = featCursor.NextFeature(); } // "Assign Geometry & Values" IFeature Assign_TargetFeature(IFeature f_Source, IFeatureClass fc_Target) { IFeature f_Target = fc_Target.CreateFeature(); f_Target.Shape = f_Source.Shape; // Assign values ...... return f_Target; }
... View more
07-19-2017
04:35 AM
|
0
|
1
|
733
|
|
POST
|
I also realized before reading your response. I added another condition check-up like that below: if (pOverlapGeometry != null && (pOverlapGeometry as ESRI.ArcGIS.Geometry.Polygon).PointCount > 0) return true; Thanks a lot. Your response is credit as CORRECT.
... View more
07-19-2017
03:58 AM
|
0
|
0
|
599
|
|
POST
|
Below is a piece of code used in my program to determine if a polygon feature is overlapped with another polygon feature by referring to A feature overlapped with another feature public bool feature_Intersect_feature(ESRI.ArcGIS.Geodatabase.IFeature f1, ESRI.ArcGIS.Geodatabase.IFeature f2) { // Create a geometrybag for f1 ESRI.ArcGIS.Geometry.IGeometry geometryBag = new ESRI.ArcGIS.Geometry.GeometryBagClass(); geometryBag = (ESRI.ArcGIS.Geometry.GeometryBag)f1.ShapeCopy; // set the topology operator ESRI.ArcGIS.Geometry.ITopologicalOperator pTopOp; pTopOp = (ESRI.ArcGIS.Geometry.ITopologicalOperator)f1.Shape; // new ESRI.ArcGIS.Geometry.PolygonClass(); // set for f2 ESRI.ArcGIS.Geometry.IGeometry5 pInGeometry = (ESRI.ArcGIS.Geometry.IGeometry5)f2.ShapeCopy; //ESRI.ArcGIS.Geometry.IGeometry pInGeometry = (ESRI.ArcGIS.Geometry.IGeometry)f2.ShapeCopy; if (pInGeometry.Dimension == ESRI.ArcGIS.Geometry.esriGeometryDimension.esriGeometry2Dimension) { if (f1.ShapeCopy.GeometryType == ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon) { ESRI.ArcGIS.Geometry.IGeometry pOverlapGeometry = pTopOp.Intersect(pInGeometry, ESRI.ArcGIS.Geometry.esriGeometryDimension.esriGeometry2Dimension); if (pOverlapGeometry != null) return true; } } return false; } However, when it is executed for 2 far-away and not interacted polygons, the returned result is true, which means they are interacted. What is wrong in my code? Thanks if you can point it out?
... View more
07-18-2017
03:54 AM
|
0
|
2
|
898
|
|
POST
|
How can the Layers Frame (Not Group Layers) get Expanded dynamically using a piece of ArcObjects code? Thanks.
... View more
07-14-2017
07:06 AM
|
0
|
0
|
675
|
|
POST
|
When I open an ArcMap session (even though it is empty), the Identity box and the Table frame are open (if in previous operation, both are open). How can they be closed using a piece of ArcObjects code? Thanks.
... View more
07-14-2017
07:03 AM
|
0
|
0
|
765
|
|
POST
|
Please ignore my Q since it was found that the source feature class has something wrong in its coordinate system setup. Thanks.
... View more
07-14-2017
05:03 AM
|
0
|
0
|
980
|
|
POST
|
I created an Add-In tool, which insert a feature from Source FC (S) into a Target FC (T). The inserted feature's SHAPE.AREA and SHAPE.LEN values are automatically calculated. In my code, the Area value is also calculated as shown below: IArea area = f_Target.Shape as IArea; double d_Area = area.Area; The results show that d_Area / SHAPE.AREA = 4.10754 I used the Measure Tool and found that the SHAPE.AREA value is CORRECT. I could not figure out why the ArcObjects code is wrong. Appreciate if you can help with your knowledge.
... View more
07-13-2017
11:45 AM
|
0
|
1
|
1139
|
|
POST
|
The problem got solved by adding the code below: //Post to the target version. if (versionEdit.CanPost()) versionEdit.Post(targetVersion.VersionName); Thanks for your review.
... View more
07-13-2017
04:40 AM
|
0
|
0
|
464
|
|
POST
|
When an ArcMap session is launched, the TOC could be either List by Drawing Order, or List by Source, etc. How can the TOC be set programmatically using ArcObjects? Thanks.
... View more
07-12-2017
12:31 PM
|
0
|
2
|
1067
|
|
POST
|
I created child version from an myEdit version. Then, I edited a featureLayer of the child version in ArcMap. Then I tried to reconcile the child version to its parent version: myEdit (by referring to the source code: How to reconcile versions ) using the code below. However, after implementing this piece of code, the FeatureClass in the target version does not show any edits I made. I am not sure I have missed anything. Appreciate if you can share your experience. // the related code bool Reconcile_ToParentVersion() { bool conflicts = false; IVersionedWorkspace versionedWorkspace = (IVersionedWorkspace)m_userWorkspace; if (sParentVersionName == "") { if (m_editorVersion.HasParent()) { IVersionInfo versionInfo = m_editorVersion.VersionInfo; sParentVersionName = versionInfo.Parent.VersionName; } } IVersion targetVersion = versionedWorkspace.FindVersion(sParentVersionName) ; IVersionEdit4 versionEdit = (IVersionEdit4)m_editorVersion; if (m_muWorkspaceEdit.SupportsMultiuserEditSessionMode(esriMultiuserEditSessionMode.esriMESMVersioned) && targetVersion != null) { m_muWorkspaceEdit.StartMultiuserEditing(esriMultiuserEditSessionMode.esriMESMVersioned); //Reconcile with the target version. conflicts = versionEdit.Reconcile4(targetVersion.VersionName, true, false, false, false); } return conflicts;; }
... View more
07-12-2017
12:16 PM
|
0
|
1
|
658
|
|
POST
|
I want to dynamically create a version (named myTest here) from a previous created one rather than from SDE.DEFAULT. Referring to Create Version Example , where the code like that below: IVersion version = versionedWorkspace.DefaultVersion;
version.CreateVersion("my Work Version");
How can the
IVersion version = (set as myTest version)? Thanks.
// ---------------
Just solved by
version.CreateVersion("myTest");
Thanks.
... View more
07-11-2017
11:58 AM
|
0
|
0
|
689
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-18-2023 10:02 AM | |
| 3 | 07-14-2023 12:29 PM | |
| 1 | 04-02-2021 12:16 PM | |
| 1 | 07-24-2017 11:31 AM | |
| 1 | 04-04-2016 03:59 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-01-2025
11:58 AM
|