C# is a .NET programming language.

learn more… | top users | synonyms

1
vote
1answer
139 views

How to distinguish SRTM from DTED using C#?

Does anyone know how to easily distinguish between SRTM vs DTED programmatically without opening file metadata header? both are .dt1 or .dt2 extensions.
1
vote
1answer
327 views

Cannot register assembly

So I am trying to control Arcmap with my addin and I tried to add a command. So I did and i got this error: Error 6 Cannot register assembly "C:\Users\Administrator\documents\visual studio ...
2
votes
2answers
459 views

How to draw one rectangle in ArcObjects?

Is there button in ArcObjects "draw rectangle" such as in openlayers? Update Well, I use this code for drawing: ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = Map1.ActiveView.ScreenDisplay; ...
1
vote
0answers
24 views

How to send variables from gis addin own web browser to gis file

I am a complete beginner with GIS. So I want to be able to go to the coordinates in arcmap I fill in in my php page. I've got this now: The variables inserted in the textfield should be the ...
0
votes
2answers
1k views

How to use Sharpmap to display spatial data from MS SQL Server 2008

Can anyone show me a step by step example on how to use Sharpmap to display MS SQL server spatial data using C# as the programming language? Please note I have exploit some of the example online but ...
2
votes
1answer
52 views

Cannot get the LocalFeatureService to start when transporting code and data

I have a C# project that uses a LocalFeatureService, a LocalGeoprocessingService and a LocalMapService. Everything runs fine when I run it at my own machine. However, when I transport the code and ...
8
votes
3answers
442 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 ...
0
votes
0answers
121 views

Add Layer into existing GroupLayer in map c#

I can't add Layer into existing GroupLayer in map. I'm trying this code below, but it does not work! I need code looks like this: public void AddLayer(AxMapControl mapControl, ILayer pLayer) { ...
4
votes
2answers
735 views

How to efficiently determine if a collection of coordinates (polygon) is an ellipse?

I'm attempting to determine a geometry type based on a collection of coordinates and have come across a situation where I'd like to differentiate between what is a "polygon" and what is an "ellipse". ...
4
votes
2answers
311 views

How to create new legend using ArcObjects?

I am trying to add simple legend to the map. I wrote some simple test code below to see what happens but it did not work. var map = activeView.FocusMap; IGraphicsContainer ...
2
votes
2answers
482 views

How to copy selected features from one sde to another using ArcObjects?

Assuming I have two SDEs or other datasources with the same datamodel. One contains features the other one is empty. In ArcMap I have layers from both datasources in my table of contents. Now I would ...
2
votes
1answer
109 views

How to determine if an image file is georeferenced

I have a task to scan a folder for georeferenced images. There might be a lot of images, some quite large, and some not georeferenced. The spatial information can also be either embedded or in a world ...
10
votes
6answers
743 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 ...
0
votes
0answers
121 views

How to create a raster dataset from a known decimal extent?

I have an input raster pInputRaster. I want to create a new raster dataset called pOutputRasterDS that is the same width, height and cellsize as my input raster dataset (I'm not worried about ...
1
vote
1answer
222 views

MapInfo / MapXtreme is it possible to get the Features from a Table

I'm trying to get the Features from a table with MapXtreme 7.0.0. I use winforms with the MapControl from MapInfo. Is it possible to get all the Features from a table? Something like: ...
0
votes
0answers
303 views

ERROR 001269 : Compressing the service definition failed.ArcGIS 10.1,Python 2.7

I am trying to publish an mxd using python script. I invoke this pyhton script from c# application, after creating the sddraft file, the system throws up this error "001269 : Compressing the service ...
0
votes
1answer
97 views

What is the most efficient way to check if coordinate didn't change for 10 minutes (c# or mssql) from a list of coords

I have a list of GPS coordinates (lat,lon) with a timestamp that I got from GPS logger. I want to find the first points that didn't change in a buffer of 100 meter for 10 minutes. What will be the ...
1
vote
1answer
98 views

Is it possible to disable an Extension Addin on Startup

I am currently creating an Addin, that can be toggled on/off from the extension manager. What I want to do is when ArcMap is being loaded, to check the license level being used (which I have done), ...
1
vote
1answer
246 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
238 views

How to add a new data frame to an MXD using C#

Does anyone have code in C# to add a new data frame (map) to an MXD? I have an MXD created in ArcMap 10.1 that has an existing data frame. I need to programmatically add a new data frame and ...
1
vote
1answer
165 views

“The Fields collection did not contain an expected geometry field” (ArcGIS 10)

I am writing a fairly simple application to build simple polylines. I got most of the application working for the most part, but this part is just baffling me to no end and there is nothing I can ...
2
votes
1answer
299 views

How to connect to ArcGIS Server on the other machine?

There is the ArcGis Server on the machine 192.168.**.22 Machine name is MAPSERVER. User name and password for ArcgIS Server are "test" and "testtest" (for example) ArcGis Server options are: ...
2
votes
0answers
115 views

How to call ArcPy script from Windows Service? [closed]

I'd like to call arcpy script from Windows Service. Here (Calling arcpy/python from .NET?) I read that I can load python script. What do I need to load arcpy script?
3
votes
1answer
105 views

How to apply WHERE clause to relationship class using ArcObjects?

I'm trying to query objects related to objects and satisfying some query in ArcObjects. IRelationshipClass interface contains methods for getting all related objects but how can one filter them? I ...
2
votes
1answer
116 views

How to close the current mxd document through arcmap add-in

First, I open a mxd document named A in arcmap, then i use my add-in to generate another mxd document named B, then I use ArcMap.Application.OpenDocument(arcmapMapFileName); to open the ...
2
votes
0answers
160 views

Can I update the service on ArcGis Server programmatically?

There is Windows Service. This service adds user raster data to the Raster Dataset in sde database. The Raster Dataset registred on the ArcGis Server. This Raster Dataset also was publishing on ...
2
votes
1answer
2k views

Trying to convert coordinates from WGS84 Web Mercator Auxiliary Sphere to WGS84

I've been struggling with this for way too long now. I've got some data that was georeferenced in the WGS84 Web Mercator Auxiliary Sphere that should have been done just in WGS84. The Auxiliary ...
0
votes
1answer
115 views

How to delete raster dataset from sde base programmatically

I use sde database, registered with ArcGis Server 10.1. Sde connection is direct. Database container is postgres. There is a raster dataset in this sde base. I can open this sde database ...
1
vote
3answers
319 views

Invoke FME batch process/Process using c#

I want to invoke FME batch process and general FME processes using c#, I have no idea about FME, can anyone please let me know if anything like this is possible?or is it possible in python, any help ...
0
votes
2answers
549 views

Detecting invalid polygons (self-intersecting or touching)

An invalid polygon can be defined as one that intersects itself, or one where the lines make contact, ie, the two shapes at the top of this picture. Given the XYPoints of a polygon, what logic ...
0
votes
1answer
172 views

How to change rasterlayer color?

I have rasterdataset in gdb. I create layer from this rasterdataset. private static void CreateLayer() { ... IRasterLayer rlMosaicDataset = new RasterLayer(); ...
1
vote
0answers
133 views

Are there any exisiting .NET implementations for WFS that are extendable?

I've been told its a bad idea to implement WFS from scratch: Implementing WFS within .NET Does anybody know of any exisiting .net implementations that I can extend?
1
vote
1answer
199 views

How to remove some features of a feature layer in the mobile cache

I have a Hand-Held (HH) device in which I have downloaded to the MobileCache a limited amount of Features from a FeatureLayer. Now I need to remove from the cache all features of a certain type. We ...
2
votes
1answer
240 views

IBufferConstruction create buffer with different geometry types (C# ArcObjects)

I am using the following method in C# public void ConstructBuffers ( IEnumGeometry pInputGeometries, double distance, IGeometry CollectionpOutputBuffers); to create buffers. In the ...
2
votes
2answers
326 views

Writing shapefile metadata (shp.xml) programmatically

I want to write the Metadata for a Shapefile, which are saved in the ".shp.xml"-File. I know, I can look at and write those Metadata with ArcCatalog, but I want to do this programmatically. Is this ...
1
vote
1answer
502 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. ...
2
votes
1answer
229 views

Entity Framework & Sql Server 2012 spatial

I'm struggling to find any concrete performance of Entity Framework paired with SQL server 2012. We're looking at storing nearly a million points in a database an right now the most common scenario ...
0
votes
1answer
245 views

Connect to Web Feature Service using python/C#

I want to connect to WFS using either python or C#, it would be great if anyone can tell me how to connect and extract features from the service. I'm very new to this. Any help on this is most ...
1
vote
0answers
73 views

How to achieve the statusbar as the same effect with the arctoolbox‘s tool called in ArcMap add-in?

How to achieve the statusbar as the same effect with the arctoolbox‘s tool called in ArcMap add-in? i do not know how to use the progressbar as a result of my project involves in a large mount of ...
1
vote
3answers
512 views

How to change feature color?

I have feature (polygon) was gotten by spatial query from the map. How to change its color? I used this code but it didn't work IMxDocument mxDocument = application.Document as IMxDocument; ...
0
votes
0answers
291 views

Code to compute weights for Inverse Distance in C#

I want to test my data using IDW in C#. As I am new to C#, can someone please help me by providing the code to compute the weight for the point?
1
vote
0answers
63 views

Using the esri analysisTool Erase class in C#

I am trying to use eSRI.ArcGIS.AnalysisTools.Erase class but I keep getting blank layers. I can get the layer that can be used for the input and the layer for the erase. I don't really understand the ...
1
vote
0answers
133 views

Why use C# rather than Java API of ArcGIS Engine (or vice versa)?

I'm going to lead a development of an ArcGIS Engine application and facing the choice mentioned in the title. We have all licenses to develop our application in C#, so Microsoft's licences are out of ...
0
votes
2answers
194 views

How to add a Data Frame to mxd in a c# stand-alone application?

I am writing a stand-alone application in c# (using vs2010). I have ArcGis Desktop license. I only need to insert a new data frame in an mxd file and save this mxd. So: I create MxDocument coclass. ...
2
votes
1answer
379 views

Programmatic conversion between GML and GeoJSON

I am modifying a .Net (C#, MSSQL) system to add some geography that I'd like to display on a leaflet map. I had originally expected to save GeoJSON directly into text strings in the DB, but after ...
1
vote
1answer
241 views

How to use the IRelationalOperator interface to check if a point feature within a polygon feature?

I use the following code to check if a point feature is within a polygon feature pFeaBlock is a polygon feature and Fea is a point feature int blockID = -1; IFeatureCursor pBlockCursor = ...
3
votes
1answer
245 views

Geoprocessor object won't execute

I've tried several different approaches to getting the simple geoprocessing package that I created to execute from my C# project . . . ESRI.ArcGIS.Client.Tasks.Geoprocessor _localGPService = ...
1
vote
1answer
67 views

How to add a raster to ArcMap if file name is unknown?

I have a raster file for which I know the the workspace, but not the filename (it is a temporary file generated by operations from my program that randomizes its name on creation, i.e. "ras457"). I ...
0
votes
2answers
285 views

How to move an endpoint of a polyline feature to specific coordinates

What looked like a simple task has kept me busy for a while now. I would like to snap the endpoint of a polyline feature to a known point of which I know the coordinates. My first try was the ...
1
vote
2answers
365 views

Parallel Computing and Raster Operations in ArcObjects gives cryptic error

This is a problem I have been struggling with for awhile. The code below takes 1-3 input feature layers (pFLayer) that were stored into a list called pFeatureLayerCollection, casts them into ...