C# is a .NET programming language.

learn more… | top users | synonyms

0
votes
0answers
2 views

How to query all layers in ArcMap and get access to them by name or index?

I have next issue: I have ArcMap with tons of layers. Some of these layers may contain another layers with data (aka Composite layers) or they don't. Deep of composite layers in unknown. I need to ...
0
votes
0answers
32 views

Converting *.asc to *.shp without using ArcGIS for Desktop or QGIS?

I am trying to perform file conversion programmatically, using C#. I have read the ESRI Shapefile Technical Description (An ESRI White Paper—July 1998). I cannot calculate records for *.shp file ...
0
votes
0answers
20 views

Error Esri.FileGDB.FileGDBException Message=General function failure

Whats wrong? Code: Geodatabase geodatabase = Geodatabase.Open("C:/tmp/tmp.gdb"); Table table = geodatabase.CreateTable("StreetInfo", "C:/tmp/Table.xml"); xml: ...
-1
votes
0answers
23 views

Creating fileDialog for GDB using FileGDB_DotNet?

Is it possible to create fileDialog for geodatabase using FileGDB_DotNet? If so, how? I want same: if (Directory.GetFiles(newFileGeoDBpath).Count() == 0) { Geodatabase.Create(newFileGeoDBpath); ...
0
votes
0answers
24 views

How to work with gdb from c#?

I have installed PostgreSql 9.3, PostGIS(last version) and Npgsql. I have geodatabase(tmp.gdb) how to make conection for this DB from c#? And how to connect this DB to PostgreSql? It possible to ...
0
votes
1answer
15 views

how to use IUniqueValueRenderer for empty geodatabase point file with ArcObjects

I have empty geodatabase file with point geometry created programatically. I have style file with several symbols. I basically want to add all these symbols to my shape file before creating ...
0
votes
1answer
42 views

Change layer properties

How can I edit name of lines of layer in ArcMap from Visual Studio C#? E.g., change STR_NAME = "Pushkin street" to STREET = "Pushkin street"?
1
vote
0answers
15 views

How to emulate OpenLayers button click in C#

I'm trying to call a click of a user using C # with the following code ( " C # : GeckoWebBrowser.Navigate ( javascript : void ( Document.getElementById ( ' idOfElement ' ) .click ( ) ) " ) ; ...
2
votes
1answer
25 views

Check if tool is selected in ArcMap

How to check, if ArcMap custom tool is active? I have MyCustomTool and docWindow. docWindow opens when MyCustomTool is created. When I close docWindow and select another tool (hand - for example), ...
1
vote
1answer
39 views

Using QGIS libraries to write standalone program in C#?

I have investigate some liberaries which can help me to write stand alone applications. Is there any way to use qgis liberaries in an standalone application which is written by C#?
1
vote
0answers
14 views

Checking Annotation overlap with other features using ArcObjects?

I want to check annotation features overlap with any other feature and also have to give other overlapped feature list....please tell any method for this? Now i am using buffer around selected ...
0
votes
1answer
51 views

Layer cannot be found

public Int32 GetIndexNumberFromLayerName(String layerName) { IMxDocument doc = ArcMap.Application.Document as IMxDocument; IActiveView activeView = doc.ActiveView; ...
3
votes
1answer
22 views

Call attribute window with ArcObjects C#

I want to programatically call AttributeWindow using C# ARCGIS SDK. UID uidDockWin = new UIDClass(); uidDockWin.Value = "esriEditor.CreateFeatureDockWin"; dockWindow = ...
0
votes
0answers
30 views

Using ListTransformations function in ArcObjects, C# and ArcGIS Engine?

I need to call arcpy.ListTransformations function in C#. I have to pass 2 spatial References (ISpatialReference objects, I guess) and an envelope(IEnvelope object) to this function. This function ...
0
votes
3answers
49 views

Arcmap Refresh Button

I am working with ArcMap and C#. In the bottom left hand corner, there is a menu where you can toggle between Data view and Layout View, a Pause button, and a refresh button. I have created an Add-in ...
1
vote
1answer
20 views

gdalwarp '-tps' equilvalent in C# wrapper?

I am attempting to do the following from code: gdal_translate.exe --config GDAL_DATA "D:\gdal\bin\gdal-data" -of GTiff -a_srs EPSG:4326 -gcp 0 0 -108.724530873811 40.1376029956585 ...
2
votes
2answers
33 views

ArcGIS Rest performing query on feature service layers using within and intercepts

I am creating an application that needs to query a bunch of layers over REST to see which layers a point or line is within. At the moment I have a local ArcGIS server set up with some feature ...
0
votes
0answers
28 views

Common custom toolbar for several different arcgis desktop addins using C#

Suppose, I have two arcgis desktop add ins C1Addin and C2Addin developed in c# with the following components: C1Addin: Button_1 C2Addin: Button_2 When the 1st addin which may be any of the two ...
3
votes
2answers
36 views

How to save .mxd programatically?

How do I save a .mxd programatically? The project is never saved and on button-click, I want to save the project. I use SaveFileDialog to get the filepath and then use the following: IMapDocument ...
3
votes
0answers
61 views

ArcObjects Memory Leak with IWorkspaceEdit?

I have ArcGIS 10.1 installed. I have created a function for copying all of the features from one shapefile to another using IFeatureBuffer, now every time the function when it is called, it takes ...
2
votes
1answer
55 views

Create a custom Identify dialog

How can I check if a point belongs to a polygon? I want to create a custom identify tool with edit option. I am using C# and ArcMap 10. My idea is to click on the polygon (building/park/etc) in ...
1
vote
1answer
30 views

How to use IWorkspaceName2

I'm trying to make a little utility to generate encrypted passwords for MSD files (change the XML inside the zip). I found this example online, but I'm not familiar with esri's API, so I'm not sure ...
2
votes
1answer
30 views

How to calculate which zip code is closer to which in USA using C#?

I'm not living in USA, and I'm doing a small project for a company based in USA. The point is that, there are businesses and each of them have their address and zip code. Then, I have a form where ...
3
votes
2answers
112 views

Convert Lat/Lon Pair to Cartesian

I'm lost on how to correctly and accurately translate Lat/Lon coordinates to XY coordinates to draw them using OpenGL. The coordinate information I have is the following: Start Lon, Start Lat, End ...
2
votes
0answers
48 views

Draw Polygons by Longitude/Latitude

I am getting sql spatial results from my database query that consists of long/lat of polygons. I am using these results in my c# windows form application. Now the problem I am facing is that how can I ...
2
votes
1answer
36 views

Read DGN file in java or c#

I'm looking solution to read DGN file in java or c# without any success. Gdal makes many problem and doesn't support all element eg. complex element. Does anyone know of a library that supports the ...
0
votes
0answers
31 views

how to create map package programatically using C#?

I'm using .NET SDK to create ArcMap toolbar with arcgis 10.1. how do i create map package .mpk programatically? http://resources.arcgis.com/en/help/main/10.1/index.html#//006600000403000000
0
votes
0answers
41 views

ComboBox Addin to populate Layers .NET C#

I am using Arcgis 10.1 and created following class derived from ComboBox. class LayersComboBox : ESRI.ArcGIS.Desktop.AddIns.ComboBox I want Combo box Add-in to populate added layers(in table of ...
2
votes
0answers
24 views

split polyline at specific distance

I am working on a project that uses sql server for geometry datatype and arcgis server and asp.net website and entity framework for data access and arcgis javascript api for map viewer. I want to ...
0
votes
0answers
10 views

Feature Graphic will not Delete

I am trying to do the simple task of removing a graphic from my feature layer that is stored on arcgis online. I am using basically the same process to add a graphic as I am to delete a graphic. ...
1
vote
0answers
32 views

Create Polygon with inner polygons from KML or Shapefiles?

I am creating a windows forms application and I want to create a polygon from a KML or Shapefile as a layer on top of a Google Satellite map. Today I am using GMap.NET that got an polygon object but ...
0
votes
0answers
51 views

How to convert multipolygons to a single polygon

I have converted a set of gps points to polygon and then using .makevalid() I saved them in sql server.But It converted them to multypolygons.Is there any way to fix this problem and convert them to ...
1
vote
0answers
46 views

Can't get ESRI.ArcGIS.ADF.Connection.Local to work for 10.2.1

Not sure what I'm missing. I'm trying to use the ESRI.ArcGIS.ADF.ComReleaser and I can't get C# to recognize the ADF namespace. I can add the reference by going to Reference->Add ArcGIS Reference, but ...
1
vote
1answer
61 views

How can I delete relationship classes?

ArcGIS 10.2.2 Standard I'm looking for a code sample that can delete all relationship classes from a database, including inside Feature Datasets. I've searched ESRI's site and only found a ...
1
vote
0answers
15 views

Set Maximum Allowed Panning Area

I'd like to fix the maximal area, in which the user can fly around. Now its possible for the user, to pan everywhere he wants to go. For e.g. to XMin: 216.2. My map has got these "borders": ...
2
votes
1answer
144 views

Converting set of points to polygon using C#?

I want to convert a set of gps ponints to polygon.I used a simple loop to convert it to a WKT and than used makevalid() in sql server and save it in a gemetry column in databasae.Is this way right?or ...
1
vote
1answer
20 views

Why is this formatted string “n. def.”?

I'd like to show the user the current map scale. I update the current map scale in a textblock everytime the map size/scale has changed. This is my code, to show the map scale (in C#): private void ...
1
vote
1answer
35 views

How to set custom fullextent?

I have a WPF Map control whose extent I would like to restrict to a certain area (e.g. to the full extent of some layer). That is, a user should not be able to zoom out too far, or shift the map to an ...
1
vote
1answer
97 views

How to get Intersection point from two lines (coordinates)

I have tried for ages to find the algorithm for getting the coordinate of two intersecting lines from a given coordinate (latlong). As the picture below suggest. I have two coordinates (A and B). ...
1
vote
0answers
31 views

Exporting selected Features to CAD drawing using ArcObjects and C#?

I'm new to ArcObjects, and I have to export selected features to CAD Drawing using just ArcObjects and C#. The code below works well when I convert to a shapefile ShapeFileWorkspaceFactory, but ...
0
votes
0answers
16 views

Call ArcGIS Explorer Extension methods from ArcGIS Explorer Button Addin

I am wondering if anyone might be able to provide some guidance on accessing methods/properties from an ArcGIS Explorer Extension addin. Currently the addin is loaded when the applications runs, then ...
1
vote
0answers
24 views

Utility Network analyst - C#

This is related to Utility Network Analyst tool. I would like to build a button to accomplish the following: A Utility Network Analyst solve-function for downstream with flagging. Ofcourse, the user ...
3
votes
0answers
44 views

Temporary File GDB-based scratch workspace is not deleted after it is released

I have created a temporary File GDB-based scratch workspace as follows: var factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBScratchWorkspaceFactory"); var factory = ...
0
votes
1answer
36 views

How to set max map scale for a layer?

How can I set the maximum scale for a layer? Sometimes the layer is not visible (it disappear), when the map scale is >= 1:250000. I'd like to set it on max 1:125000. This code does not work: ...
1
vote
1answer
32 views

How to zoom to a specific point?

How is it possible to make the map zoom to a specific point like an address that the user wants to find? Codebehind: private void btnSearch_Click(object sender, RoutedEventArgs e){ var queryTask ...
1
vote
0answers
31 views

Utility Network Analyst

I want to write C# code for utility network analyst (downstream trace task). My code is: IUtilityNetworkAnalysisExt m_utilNetExt = new UtilityNetworkAnalysisExtClass(); ITraceFlowSolverGEN tfs = ...
-2
votes
1answer
64 views

Sending Shapefile to SQL Server 2012?

How can I send a shapefile to an SQL Server table? I have searched and found a tool called ShapetoSQL but I am developing a c# Windows application so I am looking for an Open Source solution.
1
vote
1answer
61 views

Problem with Converting XY Coordinates to LatLon

Here is the function that I use to convert from pixel x,y to lat,lon coordinate: public static Coordinate imageToWorld(Dataset gds, int x, int y) { double[] adfGeoTransform = new ...
0
votes
0answers
46 views

Shapefile to Rectangle Overlay/Intersect Test?

I have a shapefile and a repository of images that have corner Lat/Long points. I want to search that images who overlaps/intersects to shapefile. Here is the scenario that I am doing, creating a ...
-2
votes
1answer
92 views

Tutorial for c# and ArcObjects?

I am new to the ArcGIS. Can any one please refer a beginners tutorial for this tool. Referred the help, but couldn't able to get the basics to kick start.