C# is a .NET programming language.

learn more… | top users | synonyms

12
votes
6answers
3k views

ArcObjects Resources

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. Thanks
2
votes
2answers
703 views

ArcObjects: Alternative workflow to using a SQL query with over 1000 values in IN statement

I have a ListBox listing the unique values of a column in a feature class; the user can select any number of values and click a button to then zoom to the set of features matching those values. A ...
1
vote
1answer
1k views

How do I calculate ECEF X,Y,Z velocities for GPS if I have no satellites

I'm attempting to simulate a GPS message where know variables are starting location, ending location, speed (m/s), and a bearing (0 - 359 degrees). How can I calculate the ECEF X, Y, Z velocities ...
12
votes
5answers
2k views

How can I programmatically get the path of “Python.exe” used by ArcMap

I am working with an add-in of ArcMap in c#. From c# code, i have executed some python scripts. Now, to run those script, I have hard-coded python path. But this is not portable. So, I want to get the ...
3
votes
1answer
994 views

ESRI Flash Command in custom code

I would like to implement the same flash feature command that ESRI uses when accessing the context menu on a table row. I have used the following successfully to flash a selected feature: ...
6
votes
4answers
2k views

Programmatically edit/update metadata in ArcGIS 10

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 ...
14
votes
3answers
2k views

ArcObjects: Memory leak in IFeatureClass.Search (only on SDE with direct connect)

UPDATE 6/30/11: ESRI Support say they have reproduced the issue and have opened a bug report (NIM070156). I have determined that there is a memory leak (in unmanaged heap memory) that occurs when a ...
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 ...
3
votes
1answer
1k views

Calculate polygon area inside extent

We're using ArcMap 10.0 sp5, creating a tool in c# using the ArcObjects sdk. Is there a built in function or simple set of steps that calculates the area of each feature of a polygon layer within a ...
5
votes
2answers
340 views

Near analysis with mixed feature types in ArcObjects

I am trying to emulate the Near (analysis) ArcGIS tool in ArcObjects. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000001q000000 I want to use Mixed Feature Types. I have a ...
6
votes
6answers
5k views

How do I activate a custom ITool from a form without having to add it to a toolbar? (ArcGIS 10 add-in development)

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 ...
1
vote
1answer
453 views

GeoReference tiff image into the Google map?

I want to Geo-reference a tiff image contain a Map for a specific region, I need to add this region(image) and Geo-reference it on the Google map, SO I can see on the map for the region I select the ...
6
votes
1answer
1k views

ArcGIS 10 add-in: ComboBox add-in component focus issue

Update 9/9/11: Here is a minimal example project that will reproduce the issue for me (VS 2008 solution): http://wfurl.com/09061bf I have an ArcMap 10 add-in with a ComboBox class that I place on a ...
4
votes
4answers
8k views

How to Read a Shapefile using C#?

I am new to ArcGIS and trying a few things.. I'm trying to read shape file(which is supply as an input) using c# and I want to generate a .pdf file which contains underlying metadata information ...
4
votes
4answers
2k views

Determine overlapping points using a spatial filter in ArcObject

I have a point layer with thousands of points. Using a spatial filter, I have to find out those points which are intersecting each other. Then the objectid's of the intersecting points should be ...
4
votes
2answers
990 views

Translating grid to USGS .dem in C# via GDAL

I am attempting to translate ArcInfo binary grids to USGS DEM format (.dem). I have installed the GDAL .NET bindings thru this build installer. I can get to GDAL in my C# add-in I am working on. ...
3
votes
2answers
532 views

Using ArcObjects, how to convert an Access table into a proper geodatabase table?

I have inherited an ArcGIS application that creates a number of access database tables. I'd like to use ArcObjects to convert them to proper geodatabase tables, which I understand to mean simply ...
3
votes
1answer
989 views

C# Library for converting Shapefile Projection

Is there any C# library which can take a shapefile as an input with projection information defined (e.g, EPSG 3011) and return a new shapefile with user specified projection (e.g, EPSG 4326) ?
3
votes
2answers
2k views

Create Polylines from arrays of points

Let me describe the data setup. A line has been provided as an array of coordinate pairs, one for each vertex. This array is variable in size, anywhere from 2 to 200 coordinate pairs per line. What I ...
2
votes
1answer
596 views

How to control which Fields are exported in ArcObjects? (via Field Mapping)

In ArcMap 10.x, if you use the Export Data command on a layer that has hidden/disabled fields, those fields will not be present in the created feature class/table. My question is simple: how do you ...
1
vote
1answer
225 views

GeoServer - set declared SRS with rest api

I am using a c# application that creates and update featuretypes in Geoserver via REST. I need to set the declared srs, but I couldn't find how to do so.
1
vote
1answer
866 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: ...
0
votes
2answers
203 views

How to add command developed with C# to ArcToolbox

I have a command that develop with c# . I want to add this command to the arctoolbox . is there any way to add command to arctoolbox in arcgis programmatically ?
17
votes
9answers
5k views

How can I implement ESRI REST API?

ESRI announced that they are releasing the ArcGIS REST API as open technology. I've got an ISP running Sql Server 2008 with IIS7. Does anyone know of a good walk through showing how I can write C# ...
10
votes
6answers
615 views

How do I iterate through every cell in a continuous raster?

See this link for more details. The Problem: I want to loop through a continuous raster (one that has no attribute table), cell by cell, and get the value of the cell. I want to take those values ...
6
votes
2answers
667 views

C# Abstraction for Web Feature Service (WFS) Call

I'm currently working on a WFS client-side implementation in C# for a thick client application (Windows desktop application). The goal is to be able to choose some "layer" combinations to be shown ...
6
votes
3answers
524 views

How to generate geodesic linestring from two points in C#

I'm looking for a FREE C# class, library or set of functions that will allow me to generate a geodesic linestring (or array of vertices, whatever) from two decimal degree points. I've found ...
6
votes
2answers
651 views

Is it permissible to update features after the feature cursor has been released?

In ArcObjects, is it permissible to modify and update a feature after the feature cursor (which was used to retrieve the feature) has been released? That is, do features in any way retain a link to ...
12
votes
2answers
3k views

API documentation for Gdal/Ogr with C#

I want to assign projection to shapefile in my web C# application, for this i am using Gdal/OGR/OSR C# bindings and add osr_csharp.dll and ogr_csharp.dll references. But i am facing some difficulty ...
7
votes
2answers
1k views

Why do these annotations appear stacked/overlapping?

I've encountered a strange problem while trying to populate an annotation feature class programmatically (ArcObjects, C#). As you can see in the image below, the characters in each text string seem to ...
6
votes
2answers
679 views

ESRI ArcMap Add-in Config.esriaddinx

I'm in the process of converting an older ArcMap extension to an Add-In in C# and I am trying to best take advantage of the XML based configuration. Config.esriaddinx works great for the basic set up ...
6
votes
2answers
918 views

How to find all ICommandItem instances of a custom button command in an ArcMap add-in?

I have an ArcMap 10.0 add-in in which I have a button that the user can place (using the Customize dialog in ArcMap) on any toolbar including user-created toolbars as well as standard ones or even 3rd ...
6
votes
5answers
940 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 ...
5
votes
2answers
1k views

ArcObjects - find nearest feature to a point - has to be FAST

I've seen lots of discussion on this, especially using IIndexQuery.NearestFeature() on a FeatureIndex instance. Something like this: private IdDistancePair FindNearest(IGeometry g, IFeatureClass fc, ...
7
votes
1answer
493 views

Find the nearest point on a line

I have a line that exists between two latlon positions, and a point on a certain latlon position. What I want to know is what the nearest point on that line is (in respect to the other point). So a ...
7
votes
2answers
1k views

How do I implement outbound arcobjects interfaces in C#?

I would like to write a class in C# that implements one or more outbound interfaces, for example ILayerEvents and IActiveViewEvents. Does anyone know how to do this with C#? Update Following @Chaz's ...
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
1answer
366 views

How can I pass a 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 ...
4
votes
2answers
813 views

Split a Polyline into small segments

I am writing an addin, which needs to split a polyline into a number of segments taking the number of segments as an input from user. How can I accomplish this?
4
votes
2answers
455 views

ArcObjects: How to measure the draw time of a layer in ArcMap?

I'd like to quantitatively measure the display performance of mosaic datasets, image service layers, raster layers, feature layers, etc. in ArcMap 10. How can I measure the draw time of a particular ...
3
votes
2answers
398 views

Get the geometry from the lasso selection tool

I'm building an Add-in solution in ArcGIS 10 that contains a custom tool. I'd like to borrow the functionality of the lasso selection tool without reinventing the wheel. Is there a way to intercept ...
3
votes
1answer
2k views

ArcObjects - Adding ArcGIS Server Layer to MXD Programtically

I am trying to add a layer from ArcGIS online to a mxd programatically with no luck. See code sample below. The error is happening at pAGSServerConnectionFactory.Open(props, 0); Anyone been able to ...
3
votes
1answer
436 views

Choice approaches for passing a selected feature to a method in ArcObjects? (C#)

It pains me to ask such a basic question, but after several hours (not exaggerating) of trying to figure this out and failing, I come to GIS.se What I am trying to do is pass a selected feature ...
2
votes
1answer
610 views

ArcObjects 10.1 .NET Convert Point from WGS1984 to OSGB1936

Please can someone help me convert a point in WGS1984 to OSGB1936, I have followed all the documentation (or so i think...) and yet have not made any headway into this problem. This is my code : Type ...
2
votes
1answer
957 views

WGS point to WGS line segment (great circle) distance

How would I go about resolving this in C#? I have a line segment (great circle distance) defined by two Lon-Lat pairs (call them points A and B). A third point somewhere on the Earth sphere. The ...
2
votes
1answer
732 views

Schema Lock issue when using ITable.AddField via ArcObjects

During a process I am running, I sometimes need to create a field that is missing in an attribute table. Unfortunately, the program is complaining that the table I am adding the field to has a schema ...
2
votes
3answers
547 views

Select “interior” lines of a polygon-to-line layer

I have a polygon featureclass that has adjacent features. Using Arc10, I am turning those polygons into lines using the "Featureclass to Lines" tool. Now I would like to select ONLY THE INTERIOR ...
2
votes
1answer
320 views

CodeDom.Compiler fails in Arcmap add-in, but works from console app

The Test method in the code below succeeds in a console test app, but fails when I call it from within an Arcmap add-in, throwing a ReflectionTypeLoadException with a loader exception saying: ...
1
vote
2answers
184 views

Shapefile to GeoJson conversion using C#

I have some shapefile which I want to convert to GeoJSON and store in MongoDB for querying. Is it possible to take a shapefile and convert it to GeoJSON format in C#? I have been able to convert ...
1
vote
1answer
455 views

Implementing WFS within .NET

There are several discussion about implementing (or not implementing) WFS with .net from scratch. However, if I do need to, how do I get started? I know it's a broad question. I apologize for that. ...