C# is a .NET programming language.

learn more… | top users | synonyms

17
votes
9answers
6k 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# ...
15
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 ...
13
votes
1answer
1k views

How to get selected Features/Geometry from Windows Clipboard in ArcMap/C#?

I have a custom tool in ArcMap 10. The Workflow is the following: Select Features in a Layer with the "Select Features by Rectangle" tool Copy the Features to the Clipboard using STRG+c Select the ...
12
votes
6answers
4k 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
12
votes
5answers
3k 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 ...
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 ...
10
votes
6answers
854 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 ...
10
votes
2answers
905 views

ArcGIS 10 add-in: Top-level exception handling

The ArcGIS 10 add-in I'm working on is pretty simple -- just a tool control and a dockable window. I'm handling the specific exceptions I anticipate occuring at the source and throwing everything ...
10
votes
1answer
939 views

Implement ArcGIS Custom Features with C#?

Is it possible to implement custom features in .NET? If so, how? I suspect the issue is being able to do COM aggregation with .NET, but I can't find anything on that ... Does anyone know if it is ...
9
votes
2answers
1k views

What is the best way of refreshing the view after drawing graphics?

I draw a polygon on button click to highlight a feature. Then I need to refresh the ActiveView to show the new polygon. This lines do work: ...
8
votes
2answers
889 views

C# version for ArcObjects 9.3

Can I use C# 4.0 with the target framework set to .NET 3.5 to develop an extension for ArcMap 9.3? Or does it have to be C# 3.0 or earlier?
8
votes
2answers
1k views

Can custom map tiles be consumed via ArcObjects within my ArcGIS 10 Desktop AddIn?

Can I programmatically consume and render custom map tiles in ArcMap via our ArcGIS 10 Desktop AddIn? The AddIn is built using the ArcObjects SDK for C#/.NET and ArcGIS 10. Pulling and rendering map ...
8
votes
3answers
3k views

ArcObjects (ArcGIS for Desktop and C#): How to cast between the ArcMap COM UI and my custom .Net UserControl objects?

I'm creating a utility to run in ArcGIS for Desktop using ArcObjects (9.3.1 SDK) and C#.Net. My prototype involves a toolbar with two comboboxes and a tool. The first combo selects a layer in the TOC, ...
8
votes
3answers
473 views

New to ArcGIS and want to compute distance between two points “as the fish swims”

We have a layer named Hydrography which is the water area for a given assignment. I have a station point and a target point. I need to compute the distance between those two points but inside of the ...
8
votes
1answer
2k views

Editing a shapefile in ESRI 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 ...
8
votes
1answer
659 views

Automatically display related records for selected feature in tablewindow with ArcObjects

Is there a way through ArcObjects to automatically display the related table(s) for the selected feature in ArcMap in the attribute window (tablewindow) without the user having to click on it and ...
8
votes
1answer
565 views

Custom panning using ArcGIS Engine

Due to some constraints, that I will not go into, I have found myself needing to implement custom panning in my application. The ArcGIS API reference suggests using the following methods: ...
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 ...
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 ...
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 ...
7
votes
2answers
1k views

How to start using the SharpMap library?

I am a very newbie on GIS and also programming especially c#. I am trying to develop a program to: display map from geotiff, dted (level 2 i guess), shapfiles and jpeg type of files. display ...
7
votes
3answers
807 views

E_FAIL when calling ESRI.ArcGIS.Carto.IImageServer.Initialize()

I am using ArcGIS Engine and Developer Kit 10 on Windows 7. Specifically, I'm writing an ArcObjects console program using Visual C# Express 2008. I am attempting connect to an image server via a URL ...
7
votes
1answer
570 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 ...
6
votes
5answers
962 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 ...
6
votes
5answers
3k 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 ...
6
votes
2answers
2k views

ArcObjects: How to insert data into a table?

I have a table in ArcCatalog named WorkOrderAss. This table contains 3 columns: (OBJECTID, FeatureName, Name). I want to insert data to this table from the code behind in C#. Any help would be ...
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 ...
6
votes
2answers
858 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
2answers
136 views

What event is fired when a feature is edited?

When the user draws a new feature (line, point, etc.) in ArcMap, there are null attributes. If the user enters values in these null fields what is the event that is fired? I want to control the ...
6
votes
1answer
490 views

What is an IFeatureClassName?

I'm currently attempting to export a selected set of data from a feature class in a database to another database as a new feature class. I understand everything perfectly right up to the ...
6
votes
2answers
711 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 ...
6
votes
2answers
929 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... ...
6
votes
1answer
2k views

Arcobjects: Zoom to first queried feature

I'm attempting to query a feature class for all features that meet a certain criterion (in this case, the Status field is NULL). However, I'm not getting very far into the attempted method before ...
6
votes
1answer
3k views

Geometry from multiple selected features into one geometry

Lets see if I can explain what I'm trying to do. First of all I have developed an AddIn for ArcMap that can take one selected feature (Polygon) on a layer, grab the geometry of that feature, and save ...
6
votes
2answers
408 views

Error: can't display dash lines (broken lines) when zooming PageLayout

I am working with PageLayoutControl, its mapframe include elements: lines, texts. And I am getting an error when zooming: If I zoom the pagelayout to 100% ( smaller than 110%), it can display "Dash ...
6
votes
3answers
571 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
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 ...
6
votes
3answers
795 views

Server Object Extension doesn't work

I built a server object extension in C# and Visual Studio 2010, using the ESRI sample for the Spatial Query SOE as a starting point. (see the page on resources.esri.com) The SOE never displays a ...
6
votes
2answers
805 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
3answers
922 views

How is a “Map Package” created programmatically?

Given a loaded map document (mxd) how do I find the geodatabase objects related to the contained layers? I want to copy them with the map document so the map can be moved onto each user's local ...
6
votes
2answers
1k 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
1answer
489 views

Clearing map cache - ArcGIS Engine

Is there a programmatic way to clear the cache of a map in ArcGIS Engine 10.0? It is apparent that there is some caching scheme operating under the covers, and I'd like to clear all of its cached ...
6
votes
1answer
406 views

Display Feedback “Stutters” When Moving Features

I have a custom tool for moving features that implements IDisplayFeedback and geometry-specific CoClasses to show the user where they are moving the feature. IMovePolygonFeedback polygonFeedback; ...
6
votes
0answers
149 views

ArcObjects running in Addin slower?

I have created a class library which does some geoprocessing. The addin calls a class that is an async process. I have ensured the thread is STA and the arcobjects are thread safe (ie. not passed from ...
5
votes
5answers
7k views

How to convert coordinates from Gauss-Krueger to Longitude/Latitude?

I'm a newbie in the GIS world so please advise me :) In my .NET/C# project I need to show some shapes/points on the Bing Map. The problem is I have the Gauss-Krueger coordinates and need to convert ...
5
votes
4answers
11k views

Convert latitude and longitude into northings and eastings

Hi I have the following UK postcode dy8 3xt and know that the latitude and longitude is:- 54.452772 -2.156082 I also know that the Eastings, Northings for the postcode is:- 389490 283880 ...
5
votes
2answers
3k 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" ...
5
votes
2answers
1k views

How can I write a GEOTIFF in C#?

I want to upload a jpeg or some raster image into a C# form and then on entering the latitude and longitudes I need to be able to create an GEOTIFF file of the same image. How can this be done in ...
5
votes
4answers
2k views

Using GIS / Map inside c# WPF

How could i create e mapping applications that displays a custom map from this URL: (Capabilties with a mapview) ...