Questions tagged [c#]

C# is a .NET programming language.

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Is there a .NET ArcGIS Server REST Wrapper library that supports 10.6 or later?

I am looking for a .NET wrapper for the ArcGIS Server REST API. I have found several on nuget and github but they haven't been updated in several years. I didn't see a a REST wrapper on https://...
0
votes
1answer
19 views

Add Layer from Database or Datatable to Basemap using Esri.ArcGISRuntime in C#

How can I add/create Layer using Datatable or Database Query in C#.net instead adding through Uri using Esri.ArcGISRuntime sdk?
1
vote
1answer
25 views

KnownCoordinateSystems.Geographic.Europe.OSGB1936 showing as WGS84 in Visual Studio

I'm trying to get my head around DotSpatial. I'm specifically trying to convert the geographic points of a feature from OSGB1936 (27700) to WGS84. This is the line of C# that I was hoping would do the ...
0
votes
0answers
13 views

Consuming ArcGIS WMTS service in C#

I am looking for a way to use ArcGIS WMTS map service in C# (Actually it is a unity platform and most probably it be used on unity webgl). But I didn't find it yet. There are JavaScript API avilable, ...
0
votes
1answer
18 views

/workspaces/{workspaceName}, query param “quietOnNotFound” always throws an exception with 404 code

I am working with WebRequest Class in .NET and the url I have built is "workspaces/" + worspace_name + ".xml?quietOnNotFound=" + true" This works well if the workspace exists ...
1
vote
1answer
43 views

Windows cursor being outside of visible bounds of map using ArcObjects

What is the method to determine whether the Windows cursor is outside of the visible bounds (envelope) of the map? I need to know if the cursor is currently over another window frame and not the map ...
0
votes
0answers
27 views

ArcObjects C#.Net 'System.NullReferenceException'

I'm new to C# and ArcObjects. I just started a book and I'm getting introduced to it. My fist ever ArcObjects code is to create an extension that zooms to the full extent of an active layer. I have an ...
0
votes
1answer
16 views

Creating global Geoprocessor object for ArcObjects application?

I have an application that does many operations including some Geoprocessor tasks. Should I create a single Geoprocessor() object for the lifetime of the application or should I create a new one each ...
1
vote
0answers
31 views

How do you access PostGIS geometry data from .NET

I have a PostgreSQL / PostGIS database with both geometry and non spatial columns I created a new Console App .Net framework project and added these nuget packages EntityFramework pgsql ...
0
votes
0answers
3 views

Getting HRESULT E_FAIL error when trying to open database connection via connection file [duplicate]

I developed an Addin in AGP 2.5 where I am using connection files to open database connections at runtime. So far that worked perfect. The connection files are stored on a network drive, referenced in ...
0
votes
1answer
32 views

Getting HRESULT E_FAIL error when trying to open database connection via connection file

I developed an Addin in AGP 2.5 where I am using connection files to open database connections at runtime. So far that worked perfect. The connection files are stored on a network drive, referenced in ...
2
votes
0answers
35 views

Add altitude coordinates in Feature Collection then serialize to GeoJSON

I deserialized a GeoJSON file into a feature collection using GeoJson.Net. Then I get the feature from the feature collection. Inside the feature I can loop and get all the type of geometry. From ...
1
vote
0answers
44 views

Create Esri File GDB from DataTable .Net Core?

I have data stored in a database in PostgreSQL created and handled via EF with dbContext in .Net Core. I need to export some tables into FileGDB using opensource libraries (I don't want to restrict ...
2
votes
1answer
20 views

Determining if particular point is near country or state boundary

I'm developing an accessibility Add-On for flight simulators that allows a blind person to fly. The App is coded in c#. I can easily get the GPS location of the user's Aircraft. What I want to be able ...
2
votes
0answers
45 views

Releasing ArcMap memory by removing *.sr.lock files from shapefiles

Is there a method of removing *.sr.lock files from shapefiles to release memory consumption without closing out of an ArcMap application? I am attempting to run code that will cycle through 200+ ...
3
votes
1answer
45 views

Shift polygon along the coordinate axis

I am creating BaseTool using ArcObjects with C#. The tool should reduce the polygon and move along the coordinate axis. I managed to reduce the polygon. When I want to use the PutCoords() function to ...
1
vote
1answer
31 views

Cursor returns object reference not set when reading Annotation Layer in ArcMap

I have an annotation Layer of Geometry Type Polygon. There are few hundred features in it and I need to shrink each of them to a smaller size (for example reducing them by 50%). I am trying to use ...
1
vote
0answers
32 views

The project does not build. The command “esriRegasm.exe …” exited with code -1

I want to build the project to create a tool with ArcObjects in Visual Studio. I get this error: The command "esriRegasm.exe "...Project1.dll" /p:Desktop /s" exited with code -1. ...
3
votes
1answer
54 views

In ArcGIS how to create a polyline Feature programmatically locally?

Using most recent .net core SDK of ESRI ArcGis on a local application (not web). I try to create a wrapper class based on ArcGis:IFeatureSet which will take a collection of objects which implement ...
0
votes
0answers
35 views

Using subtype property of the esriaddinx for a AddIn button

I am trying to utilize the subtype property of an AddIn toolbar button in C#. In older versions of ArcObjects this could be accomplished using ICommandSubtype and extending the BaseCommand. However, I ...
0
votes
1answer
28 views

Is this WFS 2.0.0 specification example using a namespaced id attribute correct?

I am building c# models for the WFS spec, specifically the Filter in the fes namespace. The spec contains the following example: <?xml version="1.0"?> <fes:Filter xmlns:fes=&...
1
vote
1answer
36 views

Running MosaicToNewRaster tool fails. C#

I am currently trying to run the MosaicToNewRaster tool via C#, on a set of TIFF files. I am inputting all the required parameters but am still receiving: ERROR 000582: error occurred during ...
1
vote
1answer
35 views

ArcObjects update feature attribute

I want to update enabled field of feature in an asp.net MVC application. I have below code but it returned "No update session in progress" error public string Test() { ...
0
votes
0answers
26 views

Which algorithm is being used in NetTopologySuite-1.15-pre2 for polygonization?

NetTopologySuite-1.15-pre2 (GeoAPI-1.7.4) has an implementaion of Polygonizer() as follows: using System.Collections.Generic; using GeoAPI.Geometries; namespace NetTopologySuite.Operation.Polygonize ...
0
votes
0answers
68 views

Which algorithm can I use to detect polygons from a set of line segments?

Say, I have a set of line segments. I need to check to see if they intersect to form any polygon or not. If they form any polygon, I need to detect and return them as a list. Say, I represent a line ...
2
votes
1answer
28 views

Adding AddIn to ArcMap UI automatically after AddIn installed?

For example: I create a basic MainMenu "My Menu" AddIn by VS2010, and add "isRootMenu=true", complie and install the addin, open ArcMap, I have to open the customize dialog -> ...
1
vote
0answers
45 views

How to add style in GeoServer with restsharp

I can add new style application/zip with Postman into GeoServer, but I can't do it with C#-RestSharp. How can I do this? string url = "http://" + server + "/geoserver/rest/...
0
votes
0answers
242 views

Getting started with SharpMap in Visual Studio with C#

I am trying to use SharpMap in Visual Studio with C#. My first step was to go to the Tutorials on CodePlex. https://archive.codeplex.com/wikipage?title=SharpMap%20Tutorial&referringTitle=Home But ...
2
votes
0answers
121 views

GDAL WriteRaster as single band GeoTiff using C# saves as all black image

I am new to the community. I am fairly new to GDAL, and I'm using the C# library. I have a single band raster for which I ran multiple analyses on, and for each, I saved them using GDAL WriteRaster - ...
3
votes
0answers
19 views

ArcGIS Pro SDK forcing process windows to be minimized?

I'm running a Process from my add-in, and even if I use P/Invoke to force the window to be open and in the foreground, the process windows that appear will be minimized. Weirdly enough, they are ...
0
votes
1answer
22 views

Does MakeTableView work with field_info in ArcObjects?

gp.Execute(new MakeTableView() { in_table = $@"Database Connections\os@gisuat.sde\TESTGIS.SOME_POLY", out_view = "SOME_POLY", ...
1
vote
0answers
71 views

GDAL C# Bindings

I need some help on usage of GDAL C# bindings to convert geoJSON to MVT. How do I know that, below call is complete? We observed that below call is Async (All the code lines are executed and Parent ...
0
votes
0answers
15 views

Join utility using ArcObjects/ArcGIS runtime SDK and c#

I am working on creating a utility to join excel sheet with the shapefile using ArcObjecs and c#. I have ArcMap 10.4 installed at my machine and ArcGIS runtime sdk. Do I need to use ArcObjects to ...
2
votes
2answers
51 views

Cannot reuse output feature class in a custom geoprocess using ArcObjects

I'm developing an arcobjects 10.4.1 custom GeoProcess (fusion shift) which has to be able to run within a model builder. The GeoProcess seems to run smoothly, but the problem is it needs to be ...
0
votes
0answers
16 views

Catfood.Shapefile System.NotImplementedException: PointZ not implemented

I am trying to read a shapefile with catfood.shapefile. But it gives me a weird error when I run the code: System.NotImplementedException: 'Shapetype PointZ is not implemented' The code: using (...
3
votes
1answer
121 views

GDAL C# Error: “Failed to import coordinate system”

I've been struggling with building C# code that will do the equivalent of gdalwarp, specifically reproject a GeoTIFF file and save to an ESRI .bil file (EHdr) To that end, I thought the following ...
0
votes
0answers
9 views

How to create custom calculations with filters using C# when generating reports on ArcGIS Desktop 10.7.1

I have read the help page on calculating fields in reports which has shown me that calculating fields when generating a report is possible, however, I am unsure how to write a C# expression to be able ...
0
votes
0answers
28 views

Uploading KML or KMZ files on GeoServer via REST Service

I am developing a web application that can upload some files on GeoServer. public bool UploadShapeFile(Uri localZipUrlFile) { String fileUri = localZipUrlFile.AbsolutePath; ...
1
vote
0answers
37 views

Catching gdal errors in C#?

I have an operation: var warpTif = Gdal.wrapper_GDALWarpDestName(ecwTif, 1, dss, warpOptions, new Gdal.GDALProgressFuncDelegate(GdalProgressFunc), $"Warping {vrtName}:"); that ...
1
vote
0answers
105 views

MapWinGIS Create Buffer Using Data That Has WGS84 Coordinate System

I am using MapWinGIS with c#. I am trying to create a buffer for a polygon that has WGS84 decimal degree reference system, but it never get displayed. Here is my code: // Form load var gp = new ...
0
votes
0answers
39 views

gdal_calc in C#

I am writing a .NET core application and have been trying to utilize the Gdal libraries. I have added Gdal.Core and Gdal.Core.WindowsRuntime NuGet packages to my project. I have been able to ...
1
vote
0answers
29 views

AutoIdentifying spatial reference from shapefile fails on second attempt

I read a shapefile with GDAL 2.4.3 in C# and try to determine the used spatial reference. This works fine for the first time reading the file. When I close the file and read it again, the ...
1
vote
1answer
42 views

Arcgis Runtime .NET for WPF scene with elevation source shows flat instead

I tried the Arcgis tutorial from here. It shows how to add basemap and elevation so that the scene would show a 3D surrounding, but it doesn't. Can someone help me? This is my .cs file private ...
0
votes
0answers
41 views

DotSpatial reprojection introduces offset compared with QGIS

Im writing a converter from shape file to Geojson using C# and DotSpatial to do coordinate conversion. Currently this mostly works, with newly created shape files in QGIS the coordinates are perfect ...
0
votes
0answers
47 views

GDAL C# - ReWrite of PY function in C# to CHIP dataset

I am working on a small project that utilises GDAL and its C# bindings. TASK To chip a dataset given the top left and bottom right LAT/LNG coordinates. PROBLEM My resulting CHIP is offset by 40km ...
1
vote
0answers
132 views

Opening Attribute Table by using ArcGIS Pro SDK, WPF and C#

I am trying to display an attribute table for a selected layer. I have access to attribute table but I can not pass the ArcGIS table to the DataGrid I created in xaml. <DataGrid x:Name="...
2
votes
0answers
60 views

How to read the Microstation element attribute values from .Net C#?

I am using following code for read the element attribute from index.But it shown the error like Unable to cast object of type 'System.Object[]' to type 'MicroStationDGN.DataBlock[]'.Is there any ...
3
votes
1answer
51 views

How to get the bounding rectangle of the rectangle drawn in the ArcGIS using ArcObjects?

I am trying to draw the rectangle in the map and get the Rectangle bounds from it. I am able to draw it but I am not getting the rectangle bounds. I have followed this url :Follow URL And my code as :...
0
votes
0answers
83 views

Creating layer file using C#

Is there a C# library which can be used to programmatically create a .lyr file? (Compatible with Esri products) Using NetTopologySuite I've created a shapefile which contains some squares. I'd like ...
2
votes
1answer
157 views

Activate Map on the click of a button ArcGIS Pro SDK

In this case, when an ArcGIS Pro project is opened, non map panes are active. I would like the map pane to be activated on the click of the button as proceeding code requires the MapView.Active to not ...

1
2 3 4 5
27