|
POST
|
var selected_Poly = response.features.geometry.rings[0]; // e.g. i =0
... View more
03-06-2018
11:49 AM
|
0
|
7
|
2263
|
|
POST
|
Robert: Thanks for your response. I use a similar approach to get the polygon feature (termed selected_Poly here). Then I use var b = selected_Poly.contains(pt); get Object doesn't support property or method 'contains'. How can the selected feature be cast as a polygon? Thanks.
... View more
03-06-2018
11:26 AM
|
0
|
9
|
2263
|
|
POST
|
Thanks for you to quickly point out my careless mistake.
... View more
03-06-2018
11:15 AM
|
0
|
0
|
1115
|
|
POST
|
Got error on <script type="text/javascript" src="http://js.arcgis.com/3.23compact/"></script> ... var pt = new esri.geometry.Geometry.Point([-76.99, 38.88]); Message: JavaScript runtime error: Object doesn't support this action What's wrong on this piece of code? Thanks.
... View more
03-06-2018
10:41 AM
|
0
|
2
|
2006
|
|
POST
|
Dear Robert: Thanks for your response. In order to use the contains method, I need to get the polygon feature through a URL on a map service. I tried to query a feature on a map service layer. I type attributeName like 'ABC%' in the Where Box, and then * in the Out Fields Box, and make Return Geometry checked. The URL generated looks like: http://myArcGISSite/rest/services/theFolder/theLayer/MapServer/1/query?where=attributeName+like%27ABC%01%25%27&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=html I am not sure the returned object is a feature (e.g. polygon). Could you guide me how a feature can be returned through URL? Thanks again.
... View more
03-06-2018
08:16 AM
|
0
|
11
|
2263
|
|
POST
|
Robert: Thanks for your response. What I want to Do a topology validation and see if a point is in a polygon.
... View more
03-05-2018
12:44 PM
|
0
|
1
|
2263
|
|
POST
|
Does current JS API provides topology functions? Thanks.
... View more
03-05-2018
12:30 PM
|
0
|
18
|
4339
|
|
POST
|
I have the code below for testing whether a feature class is editable or not. In this piece of code, I use bool b_Delete = false; // true for Delete, false for Update to control if the test is for Delete or for Update scenario. The results that it works well for Delete Scenario, but not successful for the Update Scenario. The error received is Error HRESULT E_FAIL has been returned from a call to a COM component. on the line: featureCursor.UpdateFeature(feature); What's wrong in my code? Thanks if you can help. public bool isFeatureEditable(string fcName, string versionName, ESRI.ArcGIS.Geodatabase.IWorkspace ws, ESRI.ArcGIS.ArcMapUI.IMxDocument mxDoc) { ESRI.ArcGIS.Geodatabase.IVersionedWorkspace verWorkspace = (ESRI.ArcGIS.Geodatabase.IVersionedWorkspace)ws; ESRI.ArcGIS.Geodatabase.IVersion editorVersion = (ESRI.ArcGIS.Geodatabase.IVersion)verWorkspace.FindVersion(versionName); ESRI.ArcGIS.Carto.IFeatureLayer fLyr = LayerHelper.GetFeaturelayerFromTocByName(fcName, mxDoc); if (fLyr != null) { ESRI.ArcGIS.Geodatabase.IWorkspaceEdit workspaceEdit = (ESRI.ArcGIS.Geodatabase.IWorkspaceEdit)ws; ESRI.ArcGIS.Geodatabase.IMultiuserWorkspaceEdit muWorkspaceEdit = (ESRI.ArcGIS.Geodatabase.IMultiuserWorkspaceEdit)editorVersion; muWorkspaceEdit.StartMultiuserEditing(ESRI.ArcGIS.Geodatabase.esriMultiuserEditSessionMode.esriMESMVersioned); if (workspaceEdit.IsBeingEdited()) { try { // **** Updating **** workspaceEdit.StartEditing(true); workspaceEdit.StartEditOperation(); ESRI.ArcGIS.Geodatabase.IFeature feature = fLyr.FeatureClass.GetFeature(1); bool b_Delete = false; // true for Delete, false for Update if (b_Delete) feature.Delete(); else { ESRI.ArcGIS.Geodatabase.IFields fields = fLyr.FeatureClass.Fields; int idx = -1; string sFieldName = ""; for (int i = 0; i < fields.FieldCount; i++) { ESRI.ArcGIS.Geodatabase.IField field = fields.Field; if (field.Editable && field.Type.ToString() == "esriFieldTypeString") { idx = i; sFieldName = field.Name; break; } } string sValue = feature.get_Value(idx).ToString(); feature.set_Value(idx, sValue + " New"); // Create a new query filter. ESRI.ArcGIS.Geodatabase.IQueryFilter queryFilter = new ESRI.ArcGIS.Geodatabase.QueryFilterClass(); queryFilter.WhereClause = "OBJECTID = " + feature.get_Value(feature.Fields.FindField("OBJECTID")); // Get an update cursor constrained by the query filter. ESRI.ArcGIS.Geodatabase.IFeatureCursor featureCursor = fLyr.FeatureClass.Update(queryFilter, false); featureCursor.UpdateFeature(feature); System.Runtime.InteropServices.Marshal.ReleaseComObject(featureCursor); } workspaceEdit.StopEditOperation(); bool hasEdits = false; workspaceEdit.HasEdits(ref hasEdits); if (hasEdits) workspaceEdit.UndoEditOperation(); workspaceEdit.StopEditing(true); return true; } catch (Exception ex) { string sMsg = ex.Message; } } } return false; }
... View more
11-22-2017
06:47 AM
|
0
|
1
|
915
|
|
POST
|
Revised the code as: if (m_Map.Layer is IFeatureLayer) { ... } No need to use typeof(...) Thanks.
... View more
10-31-2017
11:00 AM
|
0
|
0
|
785
|
|
POST
|
I need a piece of code to check if a layer in ArcMap is a FeautureLayer. IMap pMap = m_mxDoc.FocusMap; for (int i = 0; i < m_mxDoc.Maps.Count; i++) { ILayer pLayer = pMap.Layer; //if (typeof(pMap.Layer) is IFeatureLayer ) ??? How to code here? Appreciate if you can help.
... View more
10-20-2017
11:16 AM
|
1
|
3
|
980
|
|
POST
|
Refer to https://community.esri.com/thread/92279 I added a line to get the IWorkspace. Therefore, this problem can be closed. Thanks for your review.
... View more
10-18-2017
10:52 AM
|
0
|
0
|
580
|
|
POST
|
I want to use an ArcObjects function to retrieve the SDE Connection through the .sde file. I appreciate if you can help.
... View more
10-18-2017
07:11 AM
|
0
|
1
|
1446
|
|
POST
|
My project is an Add-In project. Therefore, I have to use C#. Thanks.
... View more
08-15-2017
09:18 AM
|
1
|
1
|
1472
|
|
POST
|
I need to find a piece of ArcObjects code to Iterate/Loop through all layers of a map service. Appreciate if you can provide the source.
... View more
08-15-2017
08:17 AM
|
0
|
4
|
2793
|
|
POST
|
The reported error was gone with the code below: IZAware zAware = (IZAware)f_Source.Shape; if (zAware.ZAware != false) { zAware = (IZAware)f_Source.Shape; zAware.DropZs(); zAware.ZAware = false; } IZAware zAware2 = (IZAware)f_Target.Shape; f_Target.Shape = f_Source.Shape; Thanks for your review.
... View more
07-24-2017
11:31 AM
|
1
|
0
|
2287
|
| 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
|