C# is a programming language.
17
votes
9answers
4k 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# ...
13
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
672 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
5answers
804 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 ...
10
votes
6answers
2k 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
10
votes
2answers
608 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 ...
9
votes
2answers
1k 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 ...
8
votes
2answers
712 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
966 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
1answer
588 views
What is the best way of refreshing the view after drawing graphics?
I draw a polygon on button click which to highlight a feature. Then I need to refresh the ActiveView to show the new polygon. This lines do work:
...
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
472 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
2k 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
657 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
3answers
2k 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, ...
7
votes
4answers
780 views
Why doesn't US One Address locator style have city, state or 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
642 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
3answers
548 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
232 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
1answer
369 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 ...
6
votes
5answers
792 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
6answers
3k 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
99 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
2answers
617 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
1k 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
2answers
158 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
328 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
3answers
650 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
1answer
777 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
596 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
332 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
560 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 ...
6
votes
1answer
341 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
315 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;
...
5
votes
4answers
1k 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 ...
5
votes
2answers
737 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
2answers
2k 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
1answer
316 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 ...
5
votes
2answers
407 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 ...
5
votes
1answer
220 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?
5
votes
2answers
454 views
Detect Table of Contents Changes in ArcMap using ArcObjects
What is the preferred and/or most efficient method for detecting a change in the table of contents in ArcMap using ArcObjects? My current implementation relies on a dictionary with the names and ...
5
votes
1answer
2k views
.NET Entity Framework with PostGIS?
Is it possible to use the .NET Entity Framework with PostGIS?
I've reviewed a few options, including hookup it up with Npgsql using ...
5
votes
1answer
709 views
How to persist a polygon to SQL Server database and vice versa?
How do I extract all the points from a Polygon drawn in ArcMAP and then persist that data into a SQLServer database table containing a geometry column and then when I've got the data persisted read ...
5
votes
2answers
325 views
Query a georss feed
I'm trying to consume a georss feed from a C# project. Can I have queries against a #georss feed? For example 'nearest item to Lon/Lat' or 'items contained in bounding box X' .?
Thanks
5
votes
1answer
224 views
Select By Location in ArcGIS using C#
I am creating a tool which the user will select point or line features from the map and it will display their names in a list then after clicking on any of these features from the list, it will show ...
5
votes
2answers
670 views
How to insert data to a table?
I have Table in ArcCatalog, table name: (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 ...
5
votes
1answer
1k views
ArcObjects: modifying feature field value
I'm developing an ArcMap extension and looking for a way to change feature attributes knowing its feature class and OID (and, presumably, everything else that there is in IFeature). All layers use ...
5
votes
1answer
310 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 ...
5
votes
1answer
212 views
When a class in an ArcGIS extension should be an ArcGIS class
Visual Studio templates provided by the ArcGIS SDK offer a "ArcGIS Class" which is a simple C# class that has the attributes Guid, ClassInterface, and ProgId before the class declaration.
While adding ...
5
votes
2answers
153 views
Is it possible to modify the ArcObjects IProgressDialog2?
It turns out that the best way to run long tasks in ArcMap is to use the IProgressDialog2. The BackgroundWorker in combination with ArcObjects (STA Threads) is a mess.
However, it seems that the only ...