Questions tagged [c#]

C# is a .NET programming language.

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

Code to show locator balloons with location name [closed]

I need to show a text like "Hello world" at some point on the map. How can I do that in SharpMap using c#?
-1
votes
0answers
14 views

Getting features from a feature server using C# in unity [closed]

I'm making a game using unity game engine. I'm trying to get some features published on a feature server using C#. I've installed the .NET runtime SDK for .NET and installed the NugetPackage related ...
2
votes
0answers
19 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
vote
1answer
22 views

GDAL failing to recognize OSM pbf file

I'm using the GDAL .Net library to open a PBF file I've downloaded from the GeoFabrik website. The file opens fine in QGIS. However when I call the Gdal.Open method on the file, it throws an ...
0
votes
1answer
20 views

How to set the angle of an Annotation when use a shared symbol

I am creating annotations in an add-in and am trying to rotate the annotation using the Angle field while using a shared symbol, however when I try and set the Angle field directly it always sets back ...
0
votes
1answer
24 views

ArcObjects C# memory management - Out of memory exception

I'm a noob in C# and ArcObjects (started two weeks ago). I'm trying to write a stand-alone console program that will change label placement quality in all data frames for all MXD files in a given ...
2
votes
1answer
35 views

Can't convert a WKT with a Z value into a SQL Geometry value

I'm using nettopologysuite in c# to build a nettopology geometry object, and then save it as a geometry object in SQL. Generally this works fine, except i recent came up with (from a shapefile) the ...
0
votes
0answers
19 views

Unable to enable sync on AGOL via REST api3

I feel I'm doing something fundamentally wrong here - the update doesn't seem to be taking effect (when I look in the console afterwards it's still false). I'm writing a process in C# to update a ...
1
vote
0answers
13 views

Transfer fields from one layer to another ArcGIS Pro SDK

I am creating a new layer and I would like for the new layer to take on the fields schema from the input layer. How can I accomplish this in ArcGIS Pro SDK C#? This is the code that I have to ...
1
vote
1answer
31 views

How to bootstrap an MSI to Esri .NET Add-in

I support an old COM extension to ArcMap built using ArcObjects, and I'm exploring the possibility of porting it to an Add-in. The main benefit I'm seeking with the add-in is its ease of deployment: ...
1
vote
0answers
99 views

Update Esri SOAP to REST

I'm new to ArcObjects, not a GIS professional so please be patient with my lack of GIS knowledge. I have an .Net Web application with ESRI.ARCGIS.SOAP references, looking to update them with rest. ...
0
votes
0answers
20 views

ArcObjects Load features that don't exist

I'm trying to write a method in ArcObjects .NET that will load features from a file GDB into another geodatabase but only if they don't otherwise exist. Records are considered existing if there is a ...
1
vote
0answers
28 views

C# - Transform feature's geometry to WKT?

I have a GeoJSON FeatureCollection in C#. This is the first feature structure: { "type": "Feature", "id": "xx", "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ ...
1
vote
1answer
22 views

Modify the same feature multiple times ArcGIS Pro SDK EditOperation

I am atttempting to modify a feature twice using EditOperation in a loop. I am redacting certain subcurves from a given polyline at different sections of the line. The output polyline should be the ...
0
votes
1answer
27 views

How to normalize elevation of GeoTIFF file data stored as unsigned integers?

I have a GeoTIFF file where the pixels are stored as unsigned 16 bit integers. I am using C# Gdal bindings to read the GeoTIFF file, using the Band.ReadRaster method, in order to produce an array of ...
0
votes
0answers
40 views

Seeking API (Free) to retrieve simple base map

I am currently using the OpenWeatherMap Weather Maps 1.0 API and the RainViewer API in order to retrieve cloud and precipitation layers based on a provided x and y coordinate. Unfortunately these ...
2
votes
1answer
31 views

Using IAddDataDialog2 to obtain layer from .gdb with ArcObjects and C#

I am using ArcMap 10.4.1. I cannot figure out how to properly initialize/create IAddDataDialog2 in C# to access a .gdb file in which I'm suposed to find a layer that I want to add in my TOC. I tried ...
1
vote
1answer
21 views

RowChangedEvent doesn't catch every change

I'm using C# to create ArcGIS Pro add-ins. Until now I've been able to catch changes made directly on the attribute table. This is modify, create or remove a row. But, when I use a geoprocessing tool ...
2
votes
0answers
59 views

How to use GDAL from Nuget in C#?

I have created a C# WPF (.NET Framework 4.6.1) application in Visual Studio 2017 and installed latest stable GDAL 2.4.2 from Nuget. In the App.xaml I have added the GDAL configuration call: ...
0
votes
1answer
32 views

Getting ArcGIS Online token through C#

I'm trying to get a token for ArcGIS Online using C# (well, more specifically SSIS). I've got a URL I can use which works well, and I can hit it and get what I need in Chrome, but it won't work ...
2
votes
1answer
67 views

OpenLayers vector tile rendering problem on .NET Core 2.2

I working on OpenLayers vector tile. I am using PostGIS ST_AsMvt function for render my geom data. I sending query like this to PostgreSQL in my .NET Core server SELECT ST_AsMVT(mvt, 'geom', 4096, '...
0
votes
1answer
29 views

CartoType - set min/max on map view while Panning

Working with the .NET CartoType SDK on Windows. How can I restrict panning? In the "Windows Maps" app I am able to pan outside of the map boundaries. I would like to prevent this. The C# demo program ...
1
vote
0answers
39 views

Reading ushort and uint data using gdal C# Band.ReadRaster method

I am using C# bindings for gdal in order to get elevation data from GeoTIFF files. The API contains a Band.ReadRaster method. This method supports a lot of data types, but for reading unsigned ...
1
vote
1answer
67 views

CartoType - set min/max on map view while Zooming Out

Working with the .NET CartoType SDK on Windows. How can I set a limitation on Zoom Out? In the "Windows Maps" app I am able to Zoom Out to a very little map size. How can I prevent this?
1
vote
0answers
42 views

Opening Raster with “bad” vertical coordinate system crashes program

I have an elevation TIFF file that comes from another program that seems to have something wrong with its Vertical Coordinate System. The coordinate system is EGM96 Geoid. I cannot open this TIFF in ...
3
votes
1answer
73 views

Multipolygon to single polygon

I am trying to merge the three polygon to make a single Polygon. The WKT of the polygon is as below //TMP_6 POLYGON ((626480.63252975536 3069129.8280593003, 626489.846006365 3069133.60864098, 626490....
1
vote
0answers
29 views

Retrieving individual pixel height data given color table/relief data and color shaded relief map using C# and GDAL?

I am using C# GDAL/OGR/OSR bindings. I have a GeoTIFF file where each pixel is stored as a color in a Red, Green, and Blue raster band. I have a color table/color relief file (.csv) which I am able to ...
0
votes
1answer
65 views

Loading color table (.csv) file to interpret raster data using C#?

I have a raster (GeoTIFF .tif file) that is stored in three bands (Red, Green, Blue), with each band's data type as a byte. I have a separate color table in the form of a .csv file, that stores a ...
1
vote
1answer
126 views

Converting GeoTIFF to array of normalized (0 - 1 range) values using C# GDAL Nuget Package

I currently have a Unity3D tool that allows users to import different heightmap files into the Unity3d Game Engine, in order to produce Unity Terrain objects. The tool currently has limited support ...
0
votes
1answer
82 views

Getting string attribute from a shapefile with GDAL Feature.GetFieldAsString(name) returns incomplete value

I read a shapefile (zipped) with GDAL library in C#. Shapefile contains .cpg file with "UTF-8" encoding specified. When I call Feature.GetFieldAsString(attributeName) some of the attribute values get ...
0
votes
0answers
25 views

GDAL C# Bindings ogr2ogr's clipsrc

I am trying to call ogr2ogr's clipsrc command from C#, but I can't find any reference other than implementing what the command does from scratch. I can imagine Using gdalwarp with c# bindings? is ...
0
votes
1answer
39 views

Getting the difference between a multipart feature and a single feature using Itopologicaloperator

I am creating a C# addin for ArcGIS Desktop, where one of the functions is to create a feature from the difference between 2 other features. In the image below, I want to be able to create a new ...
0
votes
0answers
42 views

Importing geographical data into SQL Server Spatial

I'm uploading a shapefile containing all the world geometries of each country into SQL Server. The issue I'm facing is that for some of them I'm getting a SQL Exception during insert: A .NET ...
1
vote
1answer
330 views

Error Finding proj.db using GDAL 3.0 With MapInfo v.15

I am using GDAL 3.0, MapInfo v.15, Visual Studio 2015, and c#. Recently I updated from Gdal 2.2 -> 3.0. Since then when I use aerials to create a pdf report and then upload to S3, I receive the ...
0
votes
0answers
49 views

Insert row into MapInfo table using c# and MapInfApplication object

I am attempting to insert a record, then eventually update a record using the MapInfoApplication object in c#. I can currently read the table contents out into a listbox in a windows forms ...
0
votes
0answers
11 views

Parse Error After Updating GDAL Version

I have been running GDAL 201-1800 MSVC 2015 and GDAL-2.1.3-cp36-cp36m-win32.whl. I recently updated to GDAL 300 MSVC 2015 and GDAL‑3.0.1‑cp36‑cp36m‑win32.whl. My apps are built using c# in Visual ...
0
votes
0answers
50 views

C# - ArcGIS Pro Add-in - Open Dialog

I am going add to add a button to show Add layer dialogue to ArcGIS pro Add-in. All works fine but my problem is although I have set the initial location of open dialog but dialog open in last open ...
0
votes
0answers
41 views

Is there a way to deploy Oracle Instant Client with an ArcGIS Add-In to access geodatabase objects?

I would like to open a feature class stored in an Oracle Enterprise geodatabase from an ArcGIS 10.4.1 Add-In without installing an Oracle Client on the end-user machine. Currently, I can use the ...
1
vote
1answer
43 views

ESRI ArcMap ArcObjects C#: Project geometry with user defined transformation

I have routines which project geometries from the projectedCS DHDN_GK_3 to projectedCS ETRS89_32N using the available predefined ESRI Transformation esriSRGeoTransformationType....
1
vote
0answers
32 views

Write geo information to TIFF by LibGeoTiff.NET

Currently I am writing a crop function for georeferenced TIFF files. I use Free.Ports.LibGeoTiff which seems to work quite well to read the TIFF, also the geo references. It is also possible to write ...
0
votes
1answer
25 views

Startup() confused while converting class:IExtension into class:BaseToolbar

I developed an extension with ArcGIS 10.4.1 that I can use through the extension menu and now I need it as a toolbar. The problem is that ArcGIS launches only the startup() event from the extension ...
0
votes
1answer
29 views

GDAL NULL Path Value On Production Server

I am using c# and visual studio. I have an app using GDAL that works perfectly on the Dev Server. When I transfer it to Production the app fails. I receive the following error message: An error ...
0
votes
1answer
34 views

Error when creating projected coordinate system

I have written a function to get a Transverse-Mercator IProjectedCoordinateSystem. However when calling the Define function I get an RPC_E_SERVERFAULT (HRESULT: 0x80010105) and no additional ...
1
vote
0answers
41 views

Similarity between two sets of lat/long points

I am trying to measure the similarity between two trajectories (two sets of lat/long points) which are the outputs from two APIs. I am trying to measure the difference between the routes given by ...
1
vote
0answers
77 views

qgis gdaltransform versus OSGeo.OSR.CoordinateTransformation

I have implemented a simple coordinate transformation test in c# using GDAL 2.4.1 downloaded from https://www.nuget.org/packages/GDAL/. When comparing the result with gdaltransform (QGIS 3.4) and EPSG....
3
votes
1answer
39 views

Display selected feature next to winform window

I'm trying to achieve a scenario like below image when a row selected in Grid, the selected row's feature should be visible next to winform window But in my case, I'm stuck with a selected feature is ...
3
votes
1answer
122 views

Georeferencing RasterLayer using ArcObjects?

I have a raster derived from a .png which has been drawn into a geodatabase. I also have the spatial reference and extent coordinates where I want to georeference the raster. Is there a way to ...
0
votes
1answer
31 views

Draw RasterLayer to map

I request a .PNG from a rest API, store it and create a IRasterLayer. My problem is I'm trying to draw it to the focus map with the RasterLayer.Draw() method, but does not look like I'm doing it ...
0
votes
1answer
95 views

How do I implement a thematic category theme for Mapsui?

I want to implement a theme based on category values for a field within an Arcview shapefile. There is a something similar in SharpMap but not in Mapsui. Any ideas?
1
vote
1answer
29 views

Programmatically open Viewer/Magnifier window in ArcMap 10.2+

Is there a way to programmatically open Viewer/Magnifier etc. windows of ArcMap from Add-In? I am using 10.2, but anything 10.2+ will be fine.