C# is a .NET programming language.

learn more… | top users | synonyms

0
votes
0answers
10 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 ...
2
votes
1answer
16 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
35 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
36 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
24 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
20 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
67 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
30 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
0answers
15 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
19 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
31 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
20 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
9 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
18 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
40 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
37 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
58 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
10 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
108 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
33 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
65 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
23 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
15 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
22 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
35 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
31 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
28 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
28 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
63 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
51 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
29 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
61 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.
3
votes
2answers
65 views

Selecting features by location based on selected feature using ArcObjects?

I am very new to ArcGIS and ArcObjects. I am writing a code for a button that will detect a selected feature and then select other features based on the feature that I had selected please take a look ...
1
vote
0answers
11 views

How to open an output set that is a list of double values in a geoprocessing service

we are trying to reduce the amount of data we are returning from the server by eliminating returning a polyline and instead returning a collection of values of type GPDouble. When the transaction is ...
1
vote
1answer
35 views

A library to edit geometry in C#

For my windows application, I am looking for a method to edit vertexes and geometry of features that are stored in a SQL Server database. I just want a simple function for dividing polygons into 3 ...
1
vote
0answers
37 views

Converting MDB File With Unicode Characters

I'm using C# wrapper of GDAL and I'm having a problem converting MDB file that contains unicode characters. Lets take for example conversion to KML file, non-English characters are replaced by '?' ...
1
vote
1answer
40 views

How to add an IFeature to the Map and zoom to it ?

I have an ITable i cast it to an IFeatureLayerDefinition after casting it to an ILayer then to an IFeatureLayer, then i used my IFeatureLayerDefinition to get only one IFeature using the ...
0
votes
3answers
56 views

Adding Field To feature class using ArcObjects and C#?

I want to add a new field to my featureclass.My code for that is: public IMxDocument mxDoc; public IMap map; IFieldEdit2 field = new FieldClass() as IFieldEdit2; ...
1
vote
1answer
24 views

Placing a cost raster in Arcmap Table of Contents in 10.2.2

We have a set of routines that have been used for writing rasters to the ArcMap table of contents from our tools. The code that always worked is this: /// <summary> /// Used for ...
0
votes
0answers
22 views

unique value rendering in C# code behind

I have the following code in my xml file where i specify the uniquevalue rendering as shown below: ` <FeatureLayerExtension> <WhereString> (ZONE ='A)' or (ZONE ='V') ...
1
vote
2answers
46 views

Is there any efficient way to create a raster with pixel value representing a unique id calculated based on pixel lat/lon?

I have 10m raster for each state in US. Current pixel value represents something. I want to have 'same' raster but pixel size representing a unique id calculated based on pixel lat and lon. I am ...
1
vote
1answer
43 views

C#/.Net Library that can draw a line across the date line

I want to be have an embedded map in my application that can handle drawing lines across the date line. I have tried out dotspatial and sharpmap and neither have been able to handle this. Edit: Here ...
2
votes
1answer
98 views

Accessing File Geodatabase to convert to shapefiles using ArcObjects?

The end result of what I'm trying to do is convert a FGDB into a folder of shapefiles. To do this, I need access to all the data I'd expect to see in a shapefile. Once I get all the information I need ...
0
votes
0answers
47 views

C# geometry hex decoder

When i am storing in the database things like: Point(90 90). I get back 010100000000000000008056400000000000805640 which is a hex encoding of the geometric type. Does anyone know a library for c# ...
3
votes
1answer
33 views

extract vertices from dbgeometry value

Who knows the elegant way to extract coordinates of polygon vertices from well known text representation of DbGeometry value? Here's my polygon for example: {POLYGON ((52.808019 -1.345367, ...
1
vote
0answers
40 views

ZoomTo is not working

I have a graphics layer. When the user selects an address from our software I want the map to ZoomTo that address. This works, but the user has to have an interaction for the map first. I thought this ...
4
votes
2answers
219 views

get map tiles for a polygon

Based on this tutorial, I can easily find out a tile for a point. But is there an algorithm to find all tiles that are covered by a rectangle or lineString or by any other feature? I would greatly ...
2
votes
1answer
114 views

Is there any way to fast read pixel value using gdal in C#

I create with C# a series of lat/lon value pair in the code(using i, j loop) and I want to extract the pixel value based on either lat/lon pair or pixel location (i, j). I know there is one gdal ...
2
votes
1answer
34 views

Access CommandItems programmatically with ArcObjects in ArcGIS Engine application

I'd like to programmatically execute a command in my ArcGIS Engine application with ArcObjects. I know in Desktop I would do it like this: ESRI.ArcGIS.Framework.ICommandBars commandBars = ...