Questions tagged [c#]
C# is a .NET programming language.
1,371
questions
0
votes
0
answers
13
views
SimplifyPolygon Class in ArcObjects10.6
I want to use the SimplifyPolygon Class that existed in ArcObjects 10.3 in ArcObjects 10.6, but I cannot find it in 10.6.
Does anyone know how to apply the SimplifyPolygon Class in ArcObjects 10.6?
0
votes
0
answers
25
views
Rasterizing GeoJSON in C# to generate TIFF file
I'm trying to use gdal and C# to rasterize a GeoJSON object to TIFF. I can get my code to compile and run but the image is coming up blank.
I'm not sure what I'm doing wrong. Maybe I need to specify ...
1
vote
0
answers
30
views
Programmatically check if editing session in progress for ArcGIS Pro SDK
I have a C# Add-In program for ArcGIS Pro.
I would like to check if the user is currently editing, or no.
I recommend my users carefully toggle their edit sessions, following the recommendation in ...
0
votes
0
answers
21
views
How to make a Dynamic Resource ESRI Button as small as needed in an ArcGIS Pro Window?
How to make a button, on a ProWindow in an ArcGIS Pro Add-in, as large or small as I need?
To create an Add-In for ArcGIS Pro, that adjusts for both dark mode and light mode, one needs to use the xaml ...
0
votes
0
answers
13
views
Add point name and style point layer C# NetTopo DotSpatial
How can I add point name and style? The point layer as blue and ellipse. My code is below:
for (int i = 0; i < featureCollection.Count; i++)
{
List<Coordinate> ...
0
votes
0
answers
28
views
Problem with Triangulation
I have a polygon:
POLYGON((10 12,10 8,9 8,9 13,10 13,10 15,11 15,11 13,12 13,12 15,14 15,14 13,15 13,15 8,13 8,13 12,12 12,12 9,11 9,11 12,10 12))
and I need to triangulate it, so what I'm doing is ...
1
vote
0
answers
66
views
Create a Pixel-Is-Point GeoTIFF using GDAL C# Bindings
What is the appropriate way to create a GeoTIFF using GDAL such that the georeferencing is done based on the Pixel-Is-Point interpretation?
My assumption is that this is the best bet at ensuring that ...
0
votes
1
answer
59
views
Open a vector .TAB (MapInfo Pro) file using C# (Net6.0) and GDAL
I'm trying to open a vector file using GDAL's C# bindings. However, running the below code keeps returning null instead of a Dataset for some reason for the dataset variable.
I've installed GDAL (v 3....
0
votes
1
answer
76
views
View a single band floating-point GeoTIFF (generated with GDAL) in QGIS
I am a novice with GIS and geospatial data, so I may be missing something basic.
I am working on a process which takes an input PNG, performs a calculation on each input pixel and writes the result to ...
1
vote
0
answers
39
views
Improving performance when loading data in current Map using ArcGIS Pro SDK and C#
I want to load data into a current map in ArcGIS Pro 2.9. For this purpose, I want to use a .lyrx file. Currently, I have implemented it with:
Uri uriLayerPath = new Uri(strLayerPath);
LayerFactory....
0
votes
2
answers
40
views
How to set and read a version in an ArcGIS Pro AddIn-File?
I am creating a c# AddIn for ArcGIS Pro 3.1. As there are a lot of users I want to use our deployment tool.
This tool works with the version of the file to check if there is a need to deploy a new ...
1
vote
2
answers
77
views
Using temporary layer in ArcGIS Pro
I use C# for creating an AddIn for ArcGIS Pro 3.1. One of the features of the AddIn is to jump to a position.
var wgs84 = SpatialReferences.WGS84;
var pointInWGS84 = MapPointBuilder.CreateMapPoint(...
0
votes
0
answers
32
views
C# - Add GroupLayer to Active Map (ArcGIS Pro)
I'm trying to add a groupLayer to active map using C# and ArcGIS Pro. Devloping a plugin.
This is my sample code or what I've tried so far:
Esri.ArcGISRuntime.Mapping.Map myMap = new Esri....
0
votes
0
answers
14
views
Hitting REST Feature services via console app (C#)
I have a console app that currently leverages arcObjects through a desktop license.
We are going to need it to transport data to and from a traditional versioned gdb to and from feature services along ...
0
votes
0
answers
107
views
Creating line on map using DotSpatial C#
To create a line on map using DotSpatial, I wrote below code but it returns
Error CS0029 Cannot implicitly convert type 'NetTopologySuite.Geometries.Coordinate' to 'DotSpatial.Topology.Coordinate'
#...
1
vote
1
answer
60
views
AddGeometryColumn not creating column on new Spatialite database
I'm creating a new Spatialite database using c# and .net through the following code:
using var connection = new SqliteConnection($"Data Source={Path.Combine(outputDirectory, "data.db")}&...
0
votes
0
answers
33
views
SqlGeometry STBuffer producing abnormal polygon shape
I am currently not able to figure out what is causing the abnormal shape when drawing a polygon onto the map as shown below.
Instead of being a complete polygon, there seems to be a triangle in the ...
0
votes
0
answers
39
views
No layers in the exported image of the MXD project using C#
I have created a console application to export the active view of an MXD document using C# ArcObjects. The app works, but for some reason the exported image is missing all the layers in the map and ...
1
vote
2
answers
99
views
Points and MultiPoints while generating SHP file with NetTopologySuite
I'm trying to generate an SHP file from geometries I have in Postgres DB. Everything goes well with LineString / MultiLineString and Polygon/MultiPolygon, but there is and issue with Point / ...
0
votes
0
answers
7
views
How to pass a URL into a dockable window?
How to pass a url into a dockable window?
'''
public static IDockableWindow GetDockWin(string windowID)
{
UID dockWinId = new UIDClass();
dockWinId.Value = windowID;
...
1
vote
0
answers
51
views
More than one ArcEngine GeoProcessor run at a time (concurrent)
I'm trying to run more than one AddRastersToMosaicDataset geoprocessor at the same from a test .NET 4.8 C# console application. So far I tried the below approach running in threads but it seems as if ...
2
votes
1
answer
126
views
Incorrect coordinate conversion results from ProjNET when converting across horizontal datums
Been fighting this for almost a week now, so I'm hoping that someone here has some insight or can tell me the obvious thing I'm missing. I am trying to add programmatic coordinate conversion on the ...
0
votes
1
answer
107
views
Incorrect coordinate translation using GDAL.NET compared to gdaltransform and epsg.io
I am working on a project to convert between one coordinate system, provided by an EPSG code, and EPSG:4326 or EPSG:4979 (WGS84 CS to include heights above ellipsoid).
Testing the following ...
0
votes
0
answers
70
views
Your login name has no roles assigned for the loaded extensions. ArcFM
i am trying to access process framework module in ArcFM using C#.
connString = $"DRIVER= {driver}; SERVER= {server}; DATABASE= {database}; PORT= {port}; UId= {userId}; Password= {password}; ...
1
vote
2
answers
151
views
Leaflet script error
I use Leaflet in my WPF C# program. I want to draw polygon on the map. I use System.Windows.Forms.WebBrowser for showing the map:
<Grid>
<WindowsFormsHost Name="wfhSample">
...
0
votes
0
answers
51
views
Errors in GP Tool when executed within C# application
I have a custom geoprocessing task written for me in python that takes 2 inputs - input_rows.csv and event_rows.csv - and creates a file gdb with a feature class of a join of these 2 tables.
...
0
votes
0
answers
86
views
Issue with GDAL Translate of a PDF to JPG and subsequent Gdalwarp EPGS:3338 (Alaska) to EPGS:3857 (Mercator)
I am quite new at GIS (GDAL and QGIS) but I was able to do 90% of what I need until I got this issue.
I have downloaded two files of FAA (one PDF and one TIFF attached here) for the same area of ...
0
votes
0
answers
178
views
How to load spatial data from PostgreSQL to Visual Studio Window Form
I am a beginner in Visual Studio.
I want to load spatial data from PostgreSQL to a GMap Windows form. I have no idea how to load that data, though now I can add normal coordinates direct (longitude ...
0
votes
1
answer
48
views
Creating DbGeometry instances that honor SRID
I maintain an ArcMap Add-in tasked with allowing people to see & edit some native SQL shapes in ArcMap, which of course require working with SqlGeometry and DbGeometry types. Converting between ...
-2
votes
1
answer
55
views
Upload and Display Image with Location coordinates [closed]
I want to upload an Image on Map and the image should contain some coordinates that when uploaded should display in the same location as the coordinates, I am working on C# and Wpf.
0
votes
0
answers
226
views
Open OracleSpatial Layer via Ogr2ogr in C#
I want to transport an OracleSpatial Layer to Postgis. From within OSGeo4W-Shell this works very well. But from C#-Console-App the DataSource is null but no error occurs.
Here is what I have tried:
...
2
votes
2
answers
235
views
Set snap raster in GDAL(C#) rasterize functions
I want to set snap raster for the function rasterize of GDAL, but I can not found. The options parameters are as the following code (C#). What is wrong?
rasterizeOptions = new string[] { "...
2
votes
1
answer
510
views
C# GDAL spatial transformation (reprojection) always fails
I have a C# project that may load several vector data files and then needs to transform the spatial reference system (whichever used) to WGS84. I tried mostly the way described here, and also cannot ...
1
vote
0
answers
267
views
How can I access PostGIS Topologies with C#?
I would like to access a PostGIS Topology with C#.
I looked through the nPgSQL PostGIS/NetTopologySuite Type Plugin but didn't see anything. With the word topology appearing in so many places, I may ...
0
votes
0
answers
144
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
1
answer
138
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
105
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
208
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
62
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
509
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
306
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
958
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 +...
0
votes
1
answer
277
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
261
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 ...
1
vote
0
answers
243
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 ...
2
votes
1
answer
1k
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 ...
1
vote
1
answer
352
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
293
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
259
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
58
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. ...