Tag Info

New answers tagged

1

It is very unlikely that the in memory workspace is implemented in similar fashion to an on-disk one. Instead of having a persistent storage with IWorkspace, IFeatureClass etc mapped to on-disk structures IName.Open creating new ArcObjects that map to them, they will just be implementations in memory. IName.Open could just return a reference to the existing ...


0

This might be your question, too. They are very similar. The suggested code answer there is: ShapefileDataWriter writer = new ShapefileDataWriter(filename, Factory); writer.Header = new DbaseFileHeader(); writer.Write(new IFeature[0]); Credit goes to the person who answered this in the other form. I am just citing it to help complete this one.


-1

How about trying the esri whitepaper on the shapefile technical description?


0

The following function will add a field to a feature class: private void AddField(IFeatureClass fClass, string name, string alias, esriFieldType dataType) { IField newField = new FieldClass(); IFieldEdit fieldEdit = (IFieldEdit)newField; fieldEdit.Name_2 = name; fieldEdit.AliasName_2 = alias; fieldEdit.Type_2 = dataType; ...


0

IMap.Layers returns an enumerator over all layers in the map document. This includes group, raster, vector, graphics layers, and non-root layers in the TOC (i.e. it recurses into group layers). If you have any non feature layers in the map document, casting the ILayer to IFeatureLayer will throw an exception. To handle this, either do a dynamic cast and null ...


1

Try using IEnumLayer interfase: IEnumLayer pEnumLayer; pEnumLayer = map.Layers; layer = pEnumLayer.Next(); while (layer != null) { flayer = (IFeatureLayer) layer;


0

As I've always understood it as your feature object is local to the GetFirstValue function it should be destroyed and memory released when the code is returned to the calling code. But I have found COM objects don't always behave as expected and in this case I can't see a problem with you explicitly setting it to Nothing. But how about this as an ...


0

You need to clear the WMS Service Group Layer before adding the single WMSMapLayer. wmsMapLayer.Clear(); wmsMapLayer.InsertLayer(newLayer, 0); Note that this will remove all group/map layers from the WMS Service Group Layer, so if you're adding more than one, it might be advisable to not call wmsMapLayer.Clear() in the body of your loop. I haven't tested ...


0

You can use GeoJSON.Net. I'm planning to work with it. I'll let you know it's usefulness when I do.


0

An alternative option for your first question would be to use IProgressDialogFactory Interface for the processing dialog. The link above has a sample code for your reference.


1

I hit the same error message and even though my code is python (using GDAL python bindings) the behaviour is exactly the same, "Cannot Find GPTS Object" is thrown on an attempt to open the file and there is no obvious way to silence it or get around it. It looks like the error is thrown, because gdal makes an assumption about the PDF format that is not true ...


0

Unfortunately I do not have a 50 reputation yet to comment on posts so I had to post this here. category="" <-- will place your command or tool under the Misc. category under Customize>Commands. I do not know how to fully hide a custom tool like you are wanting to do.


0

ESRI.ArcGIS.Controls.ToolbarControl class is for ArcEngine Application and you shouldn't use it in ArcMap with ArcObject. To Remove a command from a toolbar: You just need the name or UID of the command you want to remove from a toolbar. Suppose you want to delete fullExtent command from the Tools toolbar: var fullExtent = ...


0

You have to initialize the axToolbarControl like below //Add a toolbardef by passing a UID UID uID = new UIDsClass(); uID.Value = "esriControls.ControlsMapNavigationToolbar"; axToolbarControl1.AddToolbarDef(uID,-1,false,0,esriCommandStyles.esriCommandStyleIconOnly); After that you can get the object as IToolbarControl2 and thereby edit the toolbar.


2

The best option is to use a query to get back the corresponding feature: IQueryFilter queryFilter = new QueryFilterClass(); queryFilter.WhereClause = "NAME = '<featureName>'"; using (ComReleaser comReleaser = new ComReleaser()) { ICursor cursor = table.Search(queryFilter, true); comReleaser.ManageLifetime(cursor); IRow row = null; while ((row ...


1

IEnumLayer will build an index for you when you initialize it. It indexes all layers in the order that they appear in the TOC (the top layer will be index 0, the next down will be 1, etc). You can use this index as your key as it will always be unique to the layer. Here's the code to initialize and access in ArcGIS Desktop: ...


1

polyline.splitAtDistance doesn't actually split a polyline. All you have to do is cast your IFeature as IFeatureEdit and use the method IFeatureEdit.Split(). This will create two separate features.


4

IQueryFilter is the best option for your problem.You can put your name value in the whereclause of the queryfilter and thereby you can get the desired feature. ESRI.ArcGIS.Geodatabase.IQueryFilter queryFilter = new ESRI.ArcGIS.Geodatabase.QueryFilterClass(); queryFilter.WhereClause = "NAME LIKE 'LIGHT_POLE'; ESRI.ArcGIS.Geodatabase.ICursor cursor = ...



Top 50 recent answers are included