Skip to main content

Questions tagged [c#]

C# is a .NET programming language.

Filter by
Sorted by
Tagged with
1 vote
0 answers
28 views

Access Violation following rasterdataset.Close() after GdalWarp, GDAL C# bindings

I have the following C# code to mosaic multiple rasters using GDAL C# bindings and GdalWarp method: try { Gdal.AllRegister(); // Open all the raster files in ...
Mehmet Erdoğdu's user avatar
0 votes
0 answers
13 views

How to group a List<LineString> which are connected to each other to a “MultilineString” in NetTopologySuite

I'm using NetTopologySuite and have a lot of lines in a List<LineString> and would like to group them in List<MultiLineString>. Every MultiLineString should contain the LineStrings which ...
NewbieInCSharp's user avatar
0 votes
0 answers
22 views

Transform S-JTK coordinates to WGS84 ProjNet

double x = 1114492.28; double y = 544711.47; double[] xy = { x, y }; var cf = new CoordinateSystemFactory(); var f = new CoordinateTransformationFactory(); string wkt25831 = "PROJCS[\"S-...
Ondřej's user avatar
0 votes
0 answers
13 views

Exception while getting versioned table differences from an SOE

I have an SOE "Server Object Extension" The exception happens when I call versionedTable.Differences(). Exception message "Value does not fall within the expected range." No idea ...
ZZZ's user avatar
  • 573
0 votes
0 answers
22 views

Making C# transformation using gdal referencing python-based pyproj

Recently, I have been migrating code from python to c#. One of the things that is necessary is for coordinate transformations of large amounts of data. The python script looks like the following: ...
Miss_Orchid's user avatar
0 votes
0 answers
29 views

MaxRev.Gdal.Core - OSGeo.OGR driver.createdatasource fails with System.NullReferenceException

I try to create a new GeoPackage file and write some point data into it. But my code already fails, when I try to create the new GeoPackage file. I try to create this file within an unix/C# ...
Marcel Gangwisch's user avatar
0 votes
0 answers
11 views

How to make a FeatureClass from a FeatureClassToken?

I need to create various objects - FeatureClasses, Tables, CodedValueDomains and like. I've found several guides on creating a Description object (like FeatureDatasetDescription) and a Token (e.g. ...
Pavel V.'s user avatar
  • 1,517
0 votes
1 answer
21 views

SOE file not built

I have quite a few C# projects, REST SOEs based on ArcObjects (.NET 4.5) or ArcGIS Pro (.NET 6.0). Visual Studio (2019) shows no errors, and warnings appear in the ArcGIS Pro projects only. Everything ...
Pavel V.'s user avatar
  • 1,517
0 votes
2 answers
35 views

How to start a Python script from a ArcGIS Pro AddIn?

I use C# for creating an AddIn for ArcGIS Pro 3.1. I got a feature request to start a python script (which is part of a toolbox) and pass some arguments. Unfortunately I found only descriptions about ...
Gener4tor's user avatar
  • 135
0 votes
0 answers
26 views

Updating about 700000 feature of featureclass using ArcGIS Engine & C# but memory breaks

Why does this code get a memory overflow error for datasets with more than 20k of data? int nMax = (int)numFIDTo.Value; int nMin = (int)numFIDFrom.Value; IStepProgressor ...
Zhaochenxu's user avatar
1 vote
1 answer
78 views

"Service failed to start, CLSID for Type MapServer is not registered" Enterprise SOE

In ArcGIS Server Manager, I'm trying to add an SOE for our Enterprise env based on this walkthrough: https://developers.arcgis.com/enterprise-sdk/guide/net/walkthrough-for-rest-soes-net/ However ...
no thank you's user avatar
0 votes
0 answers
83 views

ArcObjects C# ArcMap toolbars to ArcGIS Pro

I have some ArcMap toolbars written in ArcObjects C# using windows desktop controls/forms. They are very precise in terms of clients requirement. How would I replicate them in ArcGIS Pro? I have heard ...
GBh's user avatar
  • 381
0 votes
1 answer
96 views

How to load Parquet driver in GDAL with c# wrappers?

I am using .Net nugets for GDAL and GDAL.Plugins. In GDAL documentation, in order for Parquet drivers to work, GDAL needs the Apache Arrow C++ library (https://gdal.org/drivers/vector/parquet.html). ...
gktval's user avatar
  • 1
0 votes
0 answers
31 views

Camera Footprint on ground plane using Quaternion

I am following this thread http://rijesha.com/2018/aerial-cam-footprint/ What I want to do is Plot drone camera footprint on basemap using information utmX,utmY,vFOV,hFOV,camera roll,camera pitch,...
8-DK's user avatar
  • 101
0 votes
0 answers
24 views

Add .lyrx to map based on ProWindow xaml checkbox C# error with threads

I am trying to create an addin where the user can check the layers they want added to the map, this should be invoked via a button in a Pro Window, which then adds the appropriate .lyrx to active map. ...
Daz's user avatar
  • 365
2 votes
2 answers
161 views

Populating a combobox in ProWindow SDK C# ArcGIS Pro Addin

I am trying to populate a combobox in a ProWindow item in Visual Studio based on the Layer list in TOC. I add the combobox using the Toolbox pane. The Combobox is viewable but I can't seem to find a ...
Daz's user avatar
  • 365
0 votes
0 answers
18 views

Add Image next to Mouse Cursor with ArcMap Add-in Button

I am working on an add-in program for ArcMap 10.5. Here is the goal: When the user clicks the add-in button, an image displays in the winform picture box. (For this example, that image comes from ...
lep's user avatar
  • 117
0 votes
0 answers
174 views

Converting XYZ tile request to govmap.gov.il requset which use EPSG:2039

How to convert tile (x,y) as is the case with Google Maps, which is based on a regular Mercator. To columns and rows for the govmap website that the coordinates are Israel Transverse Mercator (ITM) ...
FIX ERROR's user avatar
0 votes
1 answer
79 views

Gdal Translate with scaling option in C#

I am trying to scale an image with Gdal using Gdal.wrapper_GDALTranslate. However, I have the options input for the scaling incorrectly formatted. The error I receive is "Too many command options ...
gktval's user avatar
  • 1
0 votes
1 answer
26 views

Using SimplifyPolygon Class in ArcObjects

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. How do I apply the SimplifyPolygon Class in ArcObjects 10.6?
momo's user avatar
  • 1
0 votes
0 answers
170 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 ...
Tommie Jones's user avatar
1 vote
1 answer
134 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 ...
lep's user avatar
  • 117
0 votes
0 answers
68 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 ...
lep's user avatar
  • 117
0 votes
0 answers
42 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> ...
ayaz's user avatar
  • 1
0 votes
0 answers
49 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 ...
user17952421's user avatar
1 vote
0 answers
188 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 ...
vquixote's user avatar
0 votes
1 answer
174 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....
Richard O's user avatar
0 votes
1 answer
241 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 ...
vquixote's user avatar
1 vote
0 answers
70 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....
Stephan's user avatar
  • 11
0 votes
2 answers
131 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 ...
Gener4tor's user avatar
  • 135
1 vote
2 answers
122 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(...
Gener4tor's user avatar
  • 135
1 vote
0 answers
80 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....
Luiz's user avatar
  • 11
0 votes
0 answers
18 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 ...
Michael Rut's user avatar
0 votes
0 answers
203 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' #...
ayaz's user avatar
  • 1
1 vote
1 answer
124 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")}&...
Walter's user avatar
  • 249
0 votes
0 answers
60 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 ...
KJSR's user avatar
  • 101
1 vote
2 answers
184 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 / ...
predefined_'s user avatar
1 vote
0 answers
60 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 ...
Andy Arismendi's user avatar
2 votes
1 answer
285 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 ...
Ruud A.'s user avatar
  • 21
0 votes
1 answer
185 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 ...
TJames's user avatar
  • 29
0 votes
1 answer
65 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 ...
Dan Narsavage's user avatar
-2 votes
1 answer
82 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.
Mihir Choudhary's user avatar
0 votes
0 answers
282 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: ...
Frau Schmidt's user avatar
  • 1,181
2 votes
2 answers
393 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[] { "...
yixing's user avatar
  • 21
2 votes
1 answer
809 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 ...
BAGZZlash's user avatar
1 vote
0 answers
383 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 ...
Kirk Kuykendall's user avatar
0 votes
0 answers
204 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 ...
OoopseyDoodle's user avatar
0 votes
1 answer
161 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() + "?...
hatchetaxesaw's user avatar
0 votes
1 answer
125 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 ...
B.Quaink's user avatar
  • 455
1 vote
1 answer
293 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 ...
genaray's user avatar
  • 121

1
2 3 4 5
28