C# is a .NET programming language.

learn more… | top users | synonyms

1
vote
1answer
1k views

Using C# + Mapcript + Openlayers

Nowadays i'm using Mapscript and C# to generate and display a Mapfile, but in this way i need to create manualy the interface, is there any way to use Mapscript + Openlayers?
3
votes
2answers
253 views

How can I load .SID files in ArcEngine?

How can I load .SID files in ArcEngine? I think its possible, but I can't find any links. With Kirk's help I got it here's the code: public void add_SID_file(string dir) { ...
4
votes
2answers
1k views

Comparing two featureclasses using C#

I'm sorry, I know this is a pretty simple question but am having trouble getting this to work. Basically, I have 2 linear featureclasses and they both have the same fields and spatial reference. FC1 ...
3
votes
1answer
418 views

AGS10 Soap Geometry/Project function vanishes

So I am doing a pretty simple process that looks a lot like right out of the SOAP API/SDK for AGS10. My webservices takes a Lat/Lon coord from a mobile app, I reproject it to Web-Mercator to identify ...
6
votes
1answer
2k views

Zooming to first queried feature using ArcObjects?

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

Different behavior of ArcObjects for different languages

I have the same code in C++ and C# for ArcMap. This code loads a document from disk and trying to get a picture for PictureSimbol object. But in case of C++ error occurs(HRESULT = E_UNEXPECTED ...
3
votes
1answer
486 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 and/...
2
votes
1answer
3k views

Programmatically adding custom GP tool to a toolbox

I'm having issues add a custom GP tool to my toolbox programmatically using c#. The tool gets added to my toolbox OK but then when I try to open it it fails adding a red cross to the tool and ...
4
votes
2answers
1k 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
1answer
251 views

ArcGIS10: Publishing GPtools etc. in AddIns

I'm creating an ArcGIS 10 add-in in .NET C# which contains some tool commands and an extension class. This extension is being launched on application start-up. If I create any custom GP Tools, ...
2
votes
1answer
984 views

Interpolating heights in DEM using ArcGIS API's in C# [duplicate]

I am new to ArcGIS and not familiar with it. I want to interpolate heights in a DEM file using ArcGIS? Is it possible? Actually, I want to write a C# code that will read the height from DEM file for ...
1
vote
1answer
552 views

How to execute gp.execute ArcSDE tool in C#

So I created an ArcGIS 10 toolbox in ArcSDE and added a tool to it. There are enough examples out there on how to execute a tool.tbx that resides outside SDE or GeoDB. But in C#, how do you use gp....
3
votes
1answer
949 views

How can I programmatically project the Z value of a z-aware feature point, using ArcObjects in .NET/C#?

I discovered the following code leaves the Z coordinate of featurePt untouched: // if not WGS84 project it if (!SpatialRefsEqual(featureSpatialRef, srWgs84)) { // featurePt here is a Z-Aware ...
5
votes
2answers
466 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
1
vote
1answer
391 views

If a shapefile with geometry esriGeometryPoint is valid is it guaranteed to have a non null featureclass?

I have been given a point shapefile but it's feature class is null. I haven't seen this before so I'm wondering if the data is bad or if it's something I need to handle with code. //I was using this ...
2
votes
1answer
500 views

How can I get SOESupport to handle Polymorphism?

I've got some business objects below that I can serialize and deserialize successfully with Json.NET. I don't see a simple way to do this with Esri's SOESupport however. I'm happy with Json.NET, but ...
3
votes
2answers
3k views

Opening geodatabase files using Browse Dialog Command (VB.NET/C#) of ArcObjects?

I am currently using the following method with ArcGIS 10 to open raster files from a form: Public Function BrowseRaster(ByVal sTitle As String, ByRef sFolder As String, ByRef sName As String) As ...
0
votes
1answer
1k views

Safely replacing ArcSDE feature classes using transactions in ArcObjects?

I am using C#, ArcGIS Server 10, MS-SQL Server 2008, and I want to replace an ArcGIS SDE feature class inside of a transaction. After the deletion of the feature class, I have to create a new one with ...
1
vote
2answers
530 views

ArcGIS COM API Error

i am using the arcGIS api to make a plugin for arcFM, when i try to run this code Type t = Type.GetTypeFromProgID("esriFramework.AppRef"); System.Object obj = Activator....
3
votes
4answers
2k views

Help with QueryFilter

I have a query filter which works if pass a new instance of QueryFilterClass without setting any properties. But it breaks if I set the WhereClause. I get an error 0x80040358 queryFilter....
2
votes
1answer
719 views

GeoTIFF raster layer, c#

We have a map rendering engine (renders from MapInfo Interchange Format). This engine uses Mercator Projection. Now we have to insert a raster layer (orthophotos of a city), we have GeoTIFF files with ...
0
votes
1answer
474 views

How to print ActiveView to printer in ArcEngine 10

I am following a printing tutorial, but it's not working. The tutorial is here: http://edndoc.esri.com/arcobjects/9.2/NET/ViewCodePages/025b5da7-9b10-4623-a51e-c038c348ce29....
3
votes
1answer
213 views

How to release Events

I want to use the OnCreateFeature-Event to combine it with other actions. So I use Events.OnCreateFeature += delegate(IObject obj) { LoopTools_OnCreateFeature(obj); }; to listen to this event. ...
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
539 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... http://stackoverflow.com/questions/5479589/how-...
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
900 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
277 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
653 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
822 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
2k 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
805 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
613 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
542 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; field....
1
vote
1answer
469 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
808 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
118 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
403 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 many,...
1
vote
1answer
492 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 ...