Questions tagged [c#]

C# is a .NET programming language.

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

Oblique azimuthal stereographic projection: deriving the point-of-tangency

As a small part of a larger analysis problem, I have a set of Cartesian coordinates (x, y in meters) that define a grid of points on a projected plane. I need to convert these points to (lon, lat). ...
2
votes
0answers
27 views

How to query a file geodatabase using GDAL/OGR C# for records with an invalid geometry

Presently, I have a snippet of code that works well when iterating over a file geodatabase. The problem I'm currently having is that, on occasion, a geometry is supplied that is invalid, such as a ...
0
votes
1answer
15 views

UIDClass and enumerate layers (IEnumLayer), PRO equivalents?

In ArcGIS Desktop, it was very easy to: -create a UID Class -set a value -enumerate through FocusMap layers, filtering by said UID Class value This is what it looked like in ArcGIS for Desktop: ...
0
votes
1answer
13 views

ArcGIS Pro Wait Cursor in C# - Mouse Cursor Class

It was very easy to set a wait cursor for an add-in tool in ArcGIS for Desktop. It looked like this: ESRI.ArcGIS.Framework.IMouseCursor appCursor = new ESRI.ArcGIS.Framework.MouseCursorClass();...
1
vote
0answers
27 views

Sending vector tile PBF content as response from HTTP Azure function

I wrote Azure function (based on HTTP trigger) and need to return vector tile PBF as response. I used following piece of C# code to send response from Azure function return new FileContentResult(...
1
vote
0answers
16 views

How to write ST_Project method in C# using NetTopologySuite [closed]

I would like to write a method in C# (+NetTopologySuite) which works like ST_Project in PostGIS (https://postgis.net/docs/ST_Project.html). So the argements are: input coordinates, distance, azimuth ...
0
votes
1answer
23 views

How can I Embed BaseTool to winform in ArcObjects?

I am new to C# and still doing research. I open a windows form from a dockablewindow menu in ArcMap. I also have a button in WindowsForm, and when I click this button, I want to draw a feature on the ...
0
votes
0answers
49 views

GDAL Error "Incompatible geometry for operation"

I have 2 GeoJSON files. Both files are valid json files. File 1 { "geometry": { "coordinates": [ -37.2726722686872, -9.91252509027536 ], "type": ...
0
votes
0answers
9 views

There is "Opacity" in GdalRasterLayer? SharpMap

I am currently trying to display my raster layer with some opacity but I have not been able to do it despite changing the ARGB, as I want bing maps to be displayed in the background, is there any way ...
0
votes
1answer
31 views

ProjNet4GeoAPI calculates with mistake

I need to convert from one geocs to another. I took wkt strings from https://spatialreference.org/ref/epsg/4284/ and https://spatialreference.org/ref/epsg/4326/. Code is dead simple: string ProjSk42 = ...
0
votes
0answers
59 views

Turn point cloud into rasterized mesh with PDAL-C and it's API

I'm triyng to turn a point cloud into a mesh that's rasterized like the code in c# below describes but I have come to the problem that the filter delaunay does not work with a raster, only with a ...
1
vote
1answer
35 views

Downloading file asynchronously within ArcMap using C#

I am writing an AddIn for ArcGIS 10.x using C#. I want to asynchronously download a file within ArcMap using HttpClient. My test code works in a hello world app but just hangs when I debug it in ...
0
votes
1answer
52 views

Calling field within geodatabase table using C# and ArcGIS Pro SDK

I am trying to create a script in C# that would look into a geodatabase in ArcGIS Pro, which has multiple geodatabase tables and do some simple math using the fields in these tables. I want to be able ...
0
votes
1answer
38 views

How to add secured layer from ArcGIS service to new map in ArcGIS Pro with C# SDK

I am trying to add a secure layer of an ArcGIS Server. But even with the user / password, ArcGIS Pro shows me a login window to add my layer. How to get there directly without this login window? My ...
0
votes
2answers
68 views

Wrong coordinates after converting GML to GeoJSON

I'm using OSGeo.OGR (C#) library to perform GML to GeoJson conversion. Parsing works perfect except extracting incorrect coordinates. After conversion map objects appears in another place on the map. ...
0
votes
0answers
31 views

How to get ArcGIS Portal user content using Runtime .Net

So we have a Portal set up, and everytime I try to get the Portal contents, or the User content I get the following exception "Esri.ArcGISRuntime.Http.ArcGISWebException: You do not have ...
0
votes
0answers
99 views

libtiff.net how to read elevation data from non-tiled GeoTIFF files using C# [duplicate]

I am using libtiff.net to read elevation data from GeoTiff files and it works fine with tiled files but I can't obtain the elevation data from either stripped or scanline-based files especially the ...
0
votes
0answers
12 views

Rotate Raster at some point

I am trying to rotate the Raster Layer loaded by GDAL plugin. var layer = MainMap.Layers.SelectedLayer as IMapRasterLayer; layer.DataSet.RotateAt(angle, CenterCoordinate); This did not rotate keeping ...
0
votes
0answers
89 views

FileGDB In GDAL Docker container with dot net core

Currently, I am using this docker image pepperlk/gdal that has FileGDB built in and working via command line. Details here: gdalinfo --version GDAL 3.3.0beta1-b75f14ab12155c6b6f4544a9894c41f2f9a7d241, ...
2
votes
0answers
11 views

Export TIFF from ArcGlobe viewer

I'm attempting to export the current view to a TIFF (I attempted JPEG as well) image in ArcGlobe, but it seems most paths to this are broken in ArcGlobe even though the first two of these work in ...
0
votes
0answers
44 views

Geometry offset function is not working correctly

I'm trying to add offset in polygon feature and I'm using Esri a GIS software in C#. The issue that I'm facing is after I create a polygon and click on functionality for creating offset inside polygon ...
0
votes
0answers
91 views

Insert OLE/ActiveX objects (Excel) into ArcMap Layout using ArcObjects c#

I am trying to create an ArcMap Add-In in which I need to insert a sheet of an Excel file into the Layout using SDK.net ArcObjects. I can't find the slightest example of how to implement this. The ...
0
votes
0answers
66 views

C# DotSpatial Distance MultiLineString from Point - weird distances

I have a shapefile with 1 feature of type multilinestring. When I run the below, I get distances that seem off. var test = new DotSpatial.Topology.Coordinate( -95.085489,30.341320); ...
0
votes
0answers
34 views

C-sharp Add-in button issues

I have C# code for an Add-in button in ArcMap (10.8). An ArcGIS add-in would be built if no errors found in the C# code when building solutions. In the beginning, I resolved some errors by installing ...
1
vote
0answers
94 views

ArcMap stops working after installation of add-in [closed]

I developed an extension for ArcGIS Desktop 10.8.1 using ArcObjects and C#. After a colleague tried to install the Add-In using the ESRI ArcGIS Add-In Installation Utility, his ArcMap could not be ...
1
vote
1answer
70 views

Remove .sr lock on shapefile after removing layer from map using ArcObjects and C#

I am having difficulty figuring out how to remove .sr lock files from shapefiles using ArcObjects and C# after removing the associated layer from the map. I notice that using the straight UI in ...
0
votes
1answer
79 views

Draw line perpendicular to other line in ArcGIS Pro core host application

I am trying to draw a line perpendicular to a line segment in an ArcGIS Pro core host application. There used to be a construct point in the ArcMap SDK but it is not there any more. This is being ...
0
votes
0answers
45 views

Is there a way to search raster files with a bounding box using GDAL in C#?

So far I have tried this GdalConfiguration.ConfigureGdal(); var outputFile = "C:/Users/abcd/RPF/output.vrt"; var rasterFiles = Directory.GetFiles("C:/Users/abcd/...
0
votes
0answers
293 views

Seeking GIS Library for C# Applications using WPF

This question has been asked multiple times before, but not in the last 5+ years so I think it's worth asking again as I'm struggling and the answer way well be different now. I want to create a C# ...
1
vote
0answers
125 views

Obtaining real world long/lat from GeoTIFF file using GDAL and C#?

I am trying to obtain and convert latitude and longitude values into British National Grid coordinates from GeoTIFF using GDAL C# file, I managed to read the coordinate system and corner coordinates ...
0
votes
0answers
28 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
80 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
68 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
55 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
33 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
56 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
69 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 ...
1
vote
1answer
19 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
153 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
1answer
125 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
156 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
167 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
38 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
61 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+ ...
4
votes
2answers
105 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 ...
3
votes
1answer
63 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
75 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
157 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
1answer
57 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
53 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
2 3 4 5
27