Questions tagged [c#]

C# is a .NET programming language.

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

Which algorithm is being used in NetTopologySuite-1.15-pre2 for polygonization?

NetTopologySuite-1.15-pre2 (GeoAPI-1.7.4) has an implementaion of Polygonizer() as follows: using System.Collections.Generic; using GeoAPI.Geometries; namespace NetTopologySuite.Operation.Polygonize ...
0
votes
0answers
29 views

Which algorithm can I use to detect polygons from a set of line segments?

Say, I have a set of line segments. I need to check to see if they intersect to form any polygon or not. If they form any polygon, I need to detect and return them as a list. Say, I represent a line ...
2
votes
1answer
27 views

Adding AddIn to ArcMap UI automatically after AddIn installed?

For example: I create a basic MainMenu "My Menu" AddIn by VS2010, and add "isRootMenu=true", complie and install the addin, open ArcMap, I have to open the customize dialog -> ...
1
vote
0answers
24 views

How to add style in GeoServer with restsharp

I can add new style application/zip with Postman into GeoServer, but I can't do it with C#-RestSharp. How can I do this? string url = "http://" + server + "/geoserver/rest/...
0
votes
0answers
24 views

Getting started with SharpMap in Visual Studio with C#

I am trying to use SharpMap in Visual Studio with C#. My first step was to go to the Tutorials on CodePlex. https://archive.codeplex.com/wikipage?title=SharpMap%20Tutorial&referringTitle=Home But ...
2
votes
0answers
41 views

GDAL WriteRaster as single band GeoTiff using C# saves as all black image

I am new to the community. I am fairly new to GDAL, and I'm using the C# library. I have a single band raster for which I ran multiple analyses on, and for each, I saved them using GDAL WriteRaster - ...
3
votes
0answers
13 views

ArcGIS Pro SDK forcing process windows to be minimized?

I'm running a Process from my add-in, and even if I use P/Invoke to force the window to be open and in the foreground, the process windows that appear will be minimized. Weirdly enough, they are ...
0
votes
1answer
18 views

Does MakeTableView work with field_info in ArcObjects?

gp.Execute(new MakeTableView() { in_table = $@"Database Connections\os@gisuat.sde\TESTGIS.SOME_POLY", out_view = "SOME_POLY", ...
1
vote
0answers
39 views

GDAL C# Bindings

I need some help on usage of GDAL C# bindings to convert geoJSON to MVT. How do I know that, below call is complete? We observed that below call is Async (All the code lines are executed and Parent ...
0
votes
0answers
12 views

Join utility using ArcObjects/ArcGIS runtime SDK and c#

I am working on creating a utility to join excel sheet with the shapefile using ArcObjecs and c#. I have ArcMap 10.4 installed at my machine and ArcGIS runtime sdk. Do I need to use ArcObjects to ...
2
votes
2answers
48 views

Cannot reuse output feature class in a custom geoprocess using ArcObjects

I'm developing an arcobjects 10.4.1 custom GeoProcess (fusion shift) which has to be able to run within a model builder. The GeoProcess seems to run smoothly, but the problem is it needs to be ...
0
votes
0answers
11 views

Catfood.Shapefile System.NotImplementedException: PointZ not implemented

I am trying to read a shapefile with catfood.shapefile. But it gives me a weird error when I run the code: System.NotImplementedException: 'Shapetype PointZ is not implemented' The code: using (...
3
votes
1answer
85 views

GDAL C# Error: “Failed to import coordinate system”

I've been struggling with building C# code that will do the equivalent of gdalwarp, specifically reproject a GeoTIFF file and save to an ESRI .bil file (EHdr) To that end, I thought the following ...
0
votes
0answers
7 views

How to create custom calculations with filters using C# when generating reports on ArcGIS Desktop 10.7.1

I have read the help page on calculating fields in reports which has shown me that calculating fields when generating a report is possible, however, I am unsure how to write a C# expression to be able ...
0
votes
0answers
16 views

Uploading KML or KMZ files on GeoServer via REST Service

I am developing a web application that can upload some files on GeoServer. public bool UploadShapeFile(Uri localZipUrlFile) { String fileUri = localZipUrlFile.AbsolutePath; ...
1
vote
0answers
25 views

Catching gdal errors in C#?

I have an operation: var warpTif = Gdal.wrapper_GDALWarpDestName(ecwTif, 1, dss, warpOptions, new Gdal.GDALProgressFuncDelegate(GdalProgressFunc), $"Warping {vrtName}:"); that ...
1
vote
0answers
69 views

MapWinGIS Create Buffer Using WGS84 Lat Long Coordinate System

I am using MapWinGIS with c#. I am trying to create a buffer for a polygon that has WGS84 decimal degree reference system, but it never get displayed. Here is my code: // Form load var gp = new ...
0
votes
0answers
28 views

gdal_calc in C#

I am writing a .NET core application and have been trying to utilize the Gdal libraries. I have added Gdal.Core and Gdal.Core.WindowsRuntime NuGet packages to my project. I have been able to ...
1
vote
0answers
26 views

AutoIdentifying spatial reference from shapefile fails on second attempt

I read a shapefile with GDAL 2.4.3 in C# and try to determine the used spatial reference. This works fine for the first time reading the file. When I close the file and read it again, the ...
0
votes
1answer
30 views

Arcgis Runtime .NET for WPF scene with elevation source shows flat instead

I tried the Arcgis tutorial from here. It shows how to add basemap and elevation so that the scene would show a 3D surrounding, but it doesn't. Can someone help me? This is my .cs file private ...
0
votes
0answers
27 views

DotSpatial reprojection introduces offset compared with QGIS

Im writing a converter from shape file to Geojson using C# and DotSpatial to do coordinate conversion. Currently this mostly works, with newly created shape files in QGIS the coordinates are perfect ...
0
votes
0answers
39 views

GDAL C# - ReWrite of PY function in C# to CHIP dataset

I am working on a small project that utilises GDAL and its C# bindings. TASK To chip a dataset given the top left and bottom right LAT/LNG coordinates. PROBLEM My resulting CHIP is offset by 40km ...
1
vote
0answers
83 views

Opening Attribute Table by using ArcGIS Pro SDK, WPF and C#

I am trying to display an attribute table for a selected layer. I have access to attribute table but I can not pass the ArcGIS table to the DataGrid I created in xaml. <DataGrid x:Name="...
2
votes
0answers
42 views

How to read the Microstation element attribute values from .Net C#?

I am using following code for read the element attribute from index.But it shown the error like Unable to cast object of type 'System.Object[]' to type 'MicroStationDGN.DataBlock[]'.Is there any ...
3
votes
1answer
36 views

How to get the bounding rectangle of the rectangle drawn in the ArcGIS using ArcObjects?

I am trying to draw the rectangle in the map and get the Rectangle bounds from it. I am able to draw it but I am not getting the rectangle bounds. I have followed this url :Follow URL And my code as :...
0
votes
0answers
73 views

Creating layer file using C#

Is there a C# library which can be used to programmatically create a .lyr file? (Compatible with Esri products) Using NetTopologySuite I've created a shapefile which contains some squares. I'd like ...
2
votes
0answers
75 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 ...
2
votes
1answer
38 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 exception ...
0
votes
0answers
34 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
72 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
207 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
22 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
23 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
35 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
120 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
25 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
1answer
42 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
64 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
60 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 ...
1
vote
1answer
38 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
28 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
163 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
42 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
185 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
48 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
60 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
79 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
44 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
171 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
46 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 ...

1
2 3 4 5
26