C# is a .NET programming language.

learn more… | top users | synonyms

1
vote
1answer
225 views

Get Polygon or IGeometry from Envelope in ArcObjects

I would like to create a Polygon Feature from the geometry of an IEnvelope in C# ArcObjects SDK 10. Is there an easy way how to do it?
6
votes
2answers
928 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 ...
0
votes
1answer
756 views

Coordinate conversion - Lat Long to State Plane, ArcServer-Silverlight

I am trying to project a Lat/Long value I get from a table to a x/y value that I can use to plot a graphic. I have seen one way to do this may be to use something like this: feature.Geometry = ...
2
votes
1answer
70 views

How to get a collection of georeferencing control points in an ArcMap document?

I have created control points (i.e. links) using ArcMap's Georeferencing toolbar. How can I programmatically retrieve a list of these points? I'm looking for something like an enum of the links you ...
1
vote
0answers
59 views

Issue on IFeatureDataConverter.ConvertFeatureClass

Does anyone know if it's possible to reuse this method with a "feature dataset" already present ? I'm trying to import multiple shapefiles under a featuredataset inside a fgeodb. Everything it's ...
3
votes
1answer
210 views

Importing shapefile to file geodatabase feature dataset using ArcObjects and C#?

I'm trying to import a shapefile into a featuredataset under a geodatabase using FeatureDataConverter.ConvertFeatureClass. All the examples that I found are not concerning the import under an existing ...
2
votes
0answers
297 views

Calculate Width and Height of a Google Static Maps Image

Do you know how to calculate the width and height (in degrees minutes) of a Google Static Maps image? I’ve found it extremely difficult. The only information you have is: - The centre of the image ...
2
votes
0answers
79 views

How to refresh a IDockableWindow with a DGV

I am having a IDockableWindow which will display a row of data which is a DATATABLE on DGV. below is my code. Page1.cs: private void toolStripMenuItem_Open_detail_page_Click(object sender, ...
0
votes
0answers
64 views

Command doesn't show up on ICommandBar

I'm trying to put a custom command into the Help menu on startup if it isn't already there. This is my code to do so: private void OnCreate() { // other stuff in OnCreate()... // registering ...
0
votes
1answer
46 views

Handle string or int in server object extension

How would you also check to see if the value you are passing into into an SOE is an integer as well? This checks for string, but returns 0 when passing number: string searchValStr; int ...
5
votes
2answers
2k 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, ...
1
vote
1answer
129 views

What is the correct approach to handle mouse events for a tool that is called by a button?

I have a dockable window with a 2 buttons that call 2 different tools (Draw Marker and Select Features), What i want to happen is when the user clicks on the relevant button on the dockable window and ...
2
votes
2answers
189 views

display GeoReferencing image through MapServer

I have a tiff image and got the world file which contains the needed information for GeoReferenceing, how to start add this image on Mapserver ? if I use C# and use GMAP API to call the google server ...
1
vote
0answers
46 views

Is it possible to add dynamic controls to a dockable window?

I am writing a small application that uses the dockable window. What will happen is that for each layer in the TOC a label and checkboxes will appear within the dockable window. However what do i need ...
3
votes
1answer
372 views

How do I draw transparent polygons with ArcObjects?

How do I draw transparent polygons in ArcObjects? I mean is it possible to set alpha channel?
3
votes
0answers
176 views

converting a distance to a map distance

I have a point and a polyline. I need to find the perpendicular distance between each segment of the polyline and the point. By each segemnt of the polyline I mean that, each polyline may contain more ...
1
vote
0answers
43 views

Issues using Arc 10.0 extension recompiled for 10.1

I have a written an ArcGIS extension in C# .Net for version 10.0. I have attempted to recompile this extension for 10.1 and that works. But running the extension in 10.1 is causing ArcGIS to crash. ...
0
votes
2answers
107 views

How to convert an IGeometryCollection into a Polyline

I am using the CostPathAsPolyline method which returns the Polyline as an IGeometryCollection. I now need to get this converted back into a polyline. But it seems to be more complex than just a ...
1
vote
0answers
69 views

arcmap open map via add in using C#

I just started working with arcmap and I have a question: How can I make the add in I made in C# to open a map automatically in arcmap? Just want to know what function to use or if it's even ...
1
vote
1answer
594 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 ...
0
votes
0answers
215 views

How to get the top left and lower right coordinates of polygon in ArcObjects?

First of all, draw the rectangle ESRI.ArcGIS.Display.IScreenDisplay screenDisplay = Map1.ActiveView.ScreenDisplay; screenDisplay.StartDrawing(screenDisplay.hDC, (System.Int16) ...
1
vote
0answers
208 views

How to implement Google Earth style zoom in/out and pan animation in ArcGIS Engine applications?

I am developing an application using ArcGIS Engine 10 and the C# language. I wish to add some more animation capabilities into my application. In other words, I want to add animation to zoom in, ...
1
vote
1answer
149 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
388 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
533 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
56 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
496 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
133 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) { ...
5
votes
2answers
861 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
389 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
598 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
114 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
930 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
136 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
260 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
338 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
99 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
106 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
268 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
283 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
178 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
320 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
118 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
112 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
146 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
183 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
129 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 ...