Questions tagged [c#]
C# is a .NET programming language.
1,344
questions
0
votes
0
answers
36
views
GDAL Inverse Coordinate Translation
I have data in WGS84 and when I translate it to ED50 it doesn't appear in the correct place using GDAL and C#. I use CoordinateTransformationOptions.SetOperation using c# to set the specific ...
0
votes
0
answers
11
views
Setting to the same ViewPoint yields different result ESRI C#
I'm trying to implement some zoom-in/zoom-out feature in my program, for this I'm using two ViewPoints with WGS84 projection, one is default and other one is current, when I return to the default one ...
0
votes
1
answer
28
views
Having trouble with Mapbox Isochrone FeatureCollection return type
I'm making a call to the Mapbox Isochrone API to obtain a FeatureCollection with this code:
string getIso = lng.ToString() + ","
+ lat.ToString()
+ "?...
0
votes
1
answer
22
views
Open split view maps using ArcGIG Pro SDK
Related to this question : Adding new map to current project using ArcGIS Pro .NET SDK? , however this question is quite old and not exactly what I am looking for.
I want to create an add-in that ...
1
vote
1
answer
28
views
Geocoordinates to pixel value in GDAL?
I'm trying to read a GeoTIFF with one band which stores a value between 0 and 3 ( 255 is no maks ). My Goal is to write a little program which takes in a latitude/longitude and returns the fitting ...
0
votes
0
answers
32
views
ReadRaster returns wrong pixel value
I'm trying to read a GeoTIFF with one band which stores a value between 0 and 3 ( 255 is no maks ). I downloaded it from here :
https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/...
0
votes
1
answer
26
views
Extracting the pixel value of a geocoordinate from a GeoTIFF [closed]
I have a simple GeoTIFF file where I want to query the pixel value of a certain geocoordinate.
I have no experience in this topic and there nearly no tutorials or whatever about this topic.
All I know ...
0
votes
1
answer
71
views
Invalid JSON When loading Hosted FeatureLayer from ESRI Portal via ArcGISRuntime C#
First time using ArcgisRuntime in C#. I need to be able to query data from hosted feature layers from an internally hosted (enterprise) ArcGIS Portal. I'm using the Tutorial examples on ESRI's dev ...
1
vote
1
answer
133
views
Convert local coordinates to WGS84 in C#
Some people working on a the construction site use a local custom coordinate system. I have been given a proj4 string like this:
+proj=omerc +lat_0=46.325454996 +lonc=7.99050231 +alpha=60.4026421358 +...
1
vote
1
answer
43
views
How would you configure Brutile to use Macrostrat.org as a tile server
I am wanting to create a active tile layer in a C#, WPF application that uses Mapsui and Brutile. Using Brutile, can geology map available MacroStrat.org be used as a map tile source?
Macrostrat.org -...
3
votes
1
answer
52
views
Can you create a standalone program using the QGIS API? (Not QGIS Plugin.)
Can you create a standalone program using the QGIS API? (Not QGIS Plugin.)
The functions of QGIS that our team uses are limited, so I would like to create a GUI by collecting only the functions that ...
0
votes
0
answers
9
views
How to convert hrp format to hrpt16
I have an hrp file, I want to process it in the AAPP software package, for this it needs to be converted to hrpt16 format?
This is the Noaa satellite data encoding format. We need an example to write ...
1
vote
0
answers
100
views
How to calculate the daylight saving time given a latitude and longitude [closed]
I've been using an algorithm (https://gist.github.com/assaflavi/fc8cf83c167558ebf3ab159b5c5b0df2) to calculate sunrise and sunset times given a latitude and longitude and it works fine but this ...
1
vote
1
answer
148
views
C# transform coordinates using specific transform code using GDAL
I have an application that can import / export geospatial data to / from an ESRI SDE Database (SQLServer). The data is transformed to WGS84 before it is inserted into the DB and again from WGS84 to ...
0
votes
1
answer
45
views
How to successfully project the map extent into a different spatial reference with C# and ArcGIS Pro SDK
I am having a really difficult time trying to project the map extent (WGS84) into an envelope of a different spatial reference (Web Mercator or UTM). I have tried multiple ways of changing the ...
0
votes
1
answer
47
views
Converting screen pixels to map units with C# using ArcGIS Pro SDK
I am looking to create polygons (halos/rings) around the mouse cursor programmatically with C# using the ArcGIS Pro SDK. I have figured out how to create the halos by using System.Windows.Forms....
0
votes
1
answer
76
views
How to move the center (centroid) of a circle programmatically using C# and the ArcGIS Pro SDK
Is there any way to move the center (centroid) of a circle/polygon to a new X/Y on the map, such as the current mouse location in C# using the ArcGIS Pro SDK?
I have a solution that I found that ...
0
votes
0
answers
51
views
Highlight a feature in ArcMap from a web page
I have a web page that calls a PowerShell script to switch to ArcMap. I only want one instance of ArcMap running. If I open a new instance of ArcMap I can easily pass the PlotId as an Argument. ...
0
votes
0
answers
64
views
Saving edits via session manage in ArcFM using C#
I am trying to save edits using Session manager. But, does not let me save the data, instead it continue show saving session (in taskbar).
Sample Code :
protected override void OnClick()
{
...
0
votes
0
answers
154
views
Converting multisurface geometries to multipolygon with GDAL/OGR
While processing a multisurface geometry for storage in an older system using the C# bindings of GDAL/OGR, both Ogr.ForceToMultiPolygon and ToLinearGeometry(0,null) return a multipolygon with ...
0
votes
0
answers
24
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
0
answers
102
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
1
answer
21
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
1
answer
90
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
0
answers
65
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
0
answers
38
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
1
answer
53
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
0
answers
114
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
0
answers
18
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
1
answer
66
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
0
answers
128
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
1
answer
86
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
1
answer
210
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
1
answer
103
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
2
answers
192
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. ...
1
vote
0
answers
147
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
0
answers
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
0
answers
74
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
0
answers
103
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
0
answers
38
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
0
answers
133
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
1
answer
109
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
1
answer
129
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
0
answers
481
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
0
answers
193
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
0
answers
50
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
1
answer
112
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
1
answer
102
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
0
answers
80
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
1
answer
56
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 ...