C# is a .NET programming language.

learn more… | top users | synonyms

3
votes
1answer
2k views

how to connect to ArcGIS server with c#

I would like connect to ArcGIS server, but I have an error message "la référence d'un objet n'est pas définie à une instance a une objet". I have many examples: string serverName = "adresse"; ...
2
votes
1answer
534 views

Drag and Drop with Arcengine MapControl within WindowsFormsHost in WPF

I have an application that requires dragging and dropping onto Arcengine's Mapcontrol in a Windowsformhost. I have set the Allowdrop property on both the host and the control itself and it still does ...
6
votes
2answers
1k views

how to cluster points of interest by lat lon for my WP7 app

I have alread asked this question on SO, so I appologies if duplicating this is bad form. I will link to each of the sites if I get the right answer... ...
4
votes
4answers
1k views

Exploring ArcObjects through C# or VB from Python background

While I understand that this may be off topic to an extent, I am in a bit of a bind and could use some help directing my thought process and research. I have little programming background aside ...
1
vote
1answer
105 views

Configure SoundEx in ArcEngine

Is there a way to configure SoundEx properties in ArcEngine? This query: "100 Fairvew Rd returns "100 Fairview Rd" But this query: "100 Farview Rd" returns no results Is there a way to make the ...
2
votes
1answer
836 views

Symbolizing layer with graduated colors using ArcObjects?

Can anyone tell me how to use isimplerender interface to symbolize a polygon layer with graduated colors according to a value of a field such as "population"? I've used the interface ...
9
votes
5answers
8k views

Activating custom ITool from form without adding it to ArcMap AddIn toolbar?

I'm working on an add-in for ArcMap 10.0 that adds a toolbar to ArcMap. One command (OpenModelessDialogCommand) button on that toolbar opens a modeless WinForms dialog, from which a tool (MyTool) can ...
3
votes
2answers
2k views

Finding fields in Feature

I have a program that has to loop throug a very large amount of features. I have created a wrapper for the feature. This made me think: How expensive is the Fields.FindField method? Would it be faster ...
5
votes
1answer
275 views

Stubbing IFeature for unittests

I am trying to stub an IFeature with RhinoMocks, but I am having so much trouble doing it. Does anyone have experience with it?
2
votes
1answer
2k views

IFeatureWorkspace.CreateFeatureClass() error

I am trying to read a csv file straight into a set of new feature classes within a new file geodatabase, but I am getting the following stack trace when it fails: Attempted to read or write ...
9
votes
1answer
3k views

Editing shapefile in ArcMap programmatically?

Is this something that can be done? For instance if I created an overlay on a map and saved it as a shape file, I want to go and edit this (pre-existing file.) overlay...Either add points/remove ...
3
votes
1answer
650 views

save IGeometry to disk as a Layer file

How can I save an IGeometry to disk as a Layer file? ArcEngine 10, C#, VS2010 Edit 1: With Jason Scheirer 's suggestion I managed to convert a point into a shapefile - and I'll post the code here ...
1
vote
1answer
795 views

Is there any pseudocode for MFD (multiple flow direction) algorithm available?

Still stuck with the simulation system, is there any good pseudocode for the multiple flow direction (MFD) algorithm? I read a pseudocode example and implemented it, however the simulation was linear: ...
2
votes
2answers
1k views

ArcMap TextSymbol in ArcObjects?

I'm looking to do the following. Create a point on a map at a given coordinate (x,y) and then display text at that point. Right now I can create a shape file but nothing is displayed on the map. ...
2
votes
1answer
790 views

Selecting object(s) by mouse using ArcGIS Engine?

I've got a standalone program using ArcGIS Engine, showing a map on the screen like this: AxMapControl _mapControl; AxToolbarControl _toolbarControl; // in constructor: _mapControl = new ...
3
votes
2answers
2k views

Zooming & panning to selected objects using ArcGIS Engine?

I'm writing a program using ArcGIS Engine, and need to zoom & pan into the map to show the selected content. Loading and displaying the map does work using something like this: AxMapControl ...
2
votes
2answers
590 views

Make a single layer multiple colors

I have a layer file that has a few polygons in it, each of these polygons is required to be a different color based a column in the DBF file. I normally color layers like this: ISimpleRenderer ...
3
votes
1answer
534 views

Null values in plugin data source

How do you appropriately setup a plugin data source to allow for null values (in .NET - C# preferred)? I'm currently setting up a field using: field.Type_2 = esriFieldType.esriFieldTypeSingle; ...
1
vote
1answer
463 views

Grass GUI integration

Is it possible to embed the GRASS map display to a C# application? I know that a PNG image can suffice but to make the application more interactive it could perhaps be integrated. In essence I would ...
1
vote
1answer
784 views

Change annotation font size on a IGeoFeatureLayer

I would like to change the font size for the annotations on an IGeoFeatureLayer. I tried to set it in the lpLabelEngine.Symbol.Font.Size below but the set doesn't persist. IGeoFeatureLayer ...
0
votes
1answer
117 views

Give Universal BaseCommand a custom Icon

If I add ControlsMapZoomInTool like this: AddItem("esriControls.ControlsMapZoomInTool", -1); To a Basic Context Menu I get the magnifying icon in my context menu right next to the words "Zoom In". ...
1
vote
1answer
400 views

Hosting Geodatabase on ArcGIS Server?

I have a simple Geodatabase in access format. I'd really like to host this database on an ArcGIS Server through one of their services. The idea is that my users would be able to connect to this ...
6
votes
5answers
1k views

Troubleshooting ArcObjects performance problems

We have developed a relatively complex geoprocessing routine using a C# / ArcObjects (COM) / ArcGIS Server 9.3.1 / ArcSDE 9.3.1 / Oracle 11g stack. Running the routine on a complete dataset takes ...
1
vote
1answer
481 views

How to link an application to grass?

I am creating an application (C#) and I want to connect it to GRASS, mainly run grass scripts from my application. This might seem to be a repeated question however I am thinking of the possibility ...
1
vote
1answer
1k views

Change The Label Field In GeoFeatureLayer

I currently have a basic shapefile that's a map of the United States. It has the name of the states, populations, and other pieces of information that I can get the names of via the following code: ...
4
votes
2answers
1k views

Publish MXD to server in ArcObjects C#

I have an MXD that I would like to publish to an ArcGIS server using C# ArcObjects (preferably as an MSD). I have been unable to find anything regarding this. Essentially I would like to implement the ...
6
votes
5answers
4k views

Programmatically edit/update metadata in ArcGIS?

Has anyone succeeded in programmatically updating metadata in ArcGIS 10? Considering using Python/arcpy but ArcObjects (C# or Python/comtypes) is also a possibility. I need to update both the FGDC ...
3
votes
0answers
254 views

Alternative to IMapServer2.ExportScaleBar

Does anyone know a good alternative to the IMapServer2.ExportScaleBar function? I want to do essentialy the same task, but outside the ArcGIS Server environment. For a given map scale, predefined ...
1
vote
2answers
630 views

How to create GRASS scripts in C# in Windows

Most of the tutorials that I have seen are under Python and Linux. Is it Possible to create GRASS scripts in C# or atleast in Windows. I can create scripts using a different language as a compromise ...
7
votes
4answers
1k views

US One Address locator style missing city, state and zip code fields?

I am using the file: C:\Program Files\ArcGIS\Desktop10.0\Locators\US One Address.lot To do address resolution on a parcel / polygon layer. I'm trying to understand why the file doesn't contain ...
5
votes
2answers
4k views

No constructor defined?

In my C# Console Application, Visual Studio 2010 highlights new FeatureClassNameClass() in my below line of code and states "ESRI.ArcGIS.Geodatabase.FeatureClassNameClass has No constructors defined" ...
6
votes
2answers
2k views

Create a closed polygon from a series of edges given a point

I have a series of points fed into a voronoi graph class that returns a series of edges defining the bounds between these points, the process works it returns a series of edges. I now need to do a ...
3
votes
2answers
870 views

Way to Ensure that the Image Centroid is Within Image Bounds

My application uses the ArcGIS Silverlight API to select polygons from a map layer. It uses the Geometry.Extent.GetCenter() method to get the centroid of the shape and add a thumbtack image at those ...
3
votes
0answers
376 views

How to Create Custom ZoomIn Button that is Windows Tools Button with Custom Cursor?

I want to create large zoomin Button without toolbarbutton. I created a 'Zoomin Script' on axMapContorol. It worked is fine but I can't set cursor. My code is as follows: IMapControl3 mapControl = ...
3
votes
1answer
4k views

Create centreline from a polygon

I am working on a project to create a centerline from a polygon automatically. The user select a polygon and click a button, the centerline will create for him. I have tried the build-in function ...
1
vote
1answer
631 views

Setting color of a feature “street” with a FeatureRenderer

I have a layer with streets and I'm trying to change the color of the streets. I know I asked a similar question, How do I change the colors of my layer file?, and the answer worked for points. ...
3
votes
1answer
1k views

Identify sample doesn't work

I'm trying to follow the Identify snippet from the ESRI ArcEngine SDK http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/Do_Identify_Snippet/00490000000n000000/ The third ...
4
votes
1answer
232 views

How do you convert a SOAP PolylineN from one namespace to another?

I'm doing a proof-of-concept to try to speed up a data service that accesses DB2 databases and a GeometryService on an ArcGIS server using the ADF and the SOAP API. I'm trying to speed up data access ...
3
votes
1answer
704 views

ARCGis LayerToKML Skips Feature Layers and Doesn't Process Layers in Group Layers

I am using ARCGis desktop and have written a quick conversion program to convert my layers to kml but I ran into some issues. It seems the only layers it can process correctly are group layers. ...
2
votes
1answer
750 views

Georeferencing help (GeoTiff into MapWindow6)

I'm a newbie with MapWindow6 and I would like to figure out a couple of things. 1 - Whenever I drag and drop a GeoTiff into the map (MapWindow6) I can not see that image at its place, I mean that ...
2
votes
2answers
897 views

Problems closing dbf-table edited with ArcObjects

To change values and add new values to a dbf-file, I connect to the dbf and use the ITable interface to make the edits. At the end I release the COM-objects of the table and the workspace. But when I ...
5
votes
1answer
455 views

Passing WorkspaceName to another thread for opening?

My winforms app gets an IWorkspaceName from an IDatasetName via the GxObject selected in a GxDialog. I want to pass it across to a worker thread for opening. I know how to write multithreaded ...
12
votes
8answers
5k views

ArcObjects Resources [closed]

What are the best books/web sites for C# development with ArcObjects? The ArcGIS Resource Center is very helpful, but I am trying to find sources with more examples.
2
votes
0answers
161 views

How can I upload an annotation featureclass to ArcSDE using C#?

I can upload the shape files to ArcSDE database successfully,but I fail to upload annotation featureclass.
3
votes
1answer
651 views

Opening a shapefile with roads, how to display the roadnames?

I am using ((AxMapControl)myMap.AddShapeFile( directory, shapeFileName) To display a shape file which has road data. Now the roads display properly, but the road names aren't displaying. How can ...
1
vote
1answer
490 views

How to Save a Raster or Polygon to ArcMap Table of Contents in C#?

Just as the title says, I want to save the Raster to the table of contents. I have a Raster displaying on the ArcMap IDisplay, but I can't figure out how to save it to the Table of Contents in ...
7
votes
2answers
3k views

Deploying Application With C# GDAL/OGR Bindings

I developed a relatively simple web app that uses the C# OGR bindings to do a couple of simple geometric functions; buffer, clip...etc. I developed this application on my local machine, which has ...
8
votes
3answers
2k views

Creating floating-only (non-dockable) window in ArcMap using ArcObjects?

I'm looking for a way to create a floating window in ArcMap. To give an example just look at the window of the Identify tool. Floating means that it stays in front of the map document at all times ...
4
votes
2answers
791 views

Maturity of Mapserver mapscript C# bindings?

I've been thinking about possibly porting an internal custom GIS application built on top of Python / PyQt / Mapscript / GDAL-OGR / PostGis to C#. I was wondering about the maturity of the C# ...
2
votes
1answer
2k views

With Geographic Coordinate systems, why does my spatial query select all features from a feature layer?

Background: Add-In for ArcGIS 10 Desktop via ArcObjects for .NET The below code returns ALL features for the layer when the map is specified with any Geographic Coordinate System. However, the below ...