Questions tagged [c#]
C# is a .NET programming language.
1,345
questions
1
vote
1
answer
140
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/...
1
vote
0
answers
22
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 ...
5
votes
2
answers
2k
views
Translating grid to USGS .dem in C# via GDAL
I am attempting to translate ArcInfo binary grids to USGS DEM format (.dem). I have installed the GDAL .NET bindings thru this build installer. I can get to GDAL in my C# add-in I am working on. ...
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
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 ...
0
votes
1
answer
130
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 ...
5
votes
2
answers
828
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
0
answers
37
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
29
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
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
68
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 = ...
1
vote
1
answer
158
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
57
views
Determining if particular point is near country or state boundary
I'm developing an accessibility Add-On for flight simulators that allows a blind person to fly. The App is coded in c#.
I can easily get the GPS location of the user's Aircraft. What I want to be able ...
0
votes
1
answer
285
views
Making point move to right or left using ArcObjects?
I want to make a point and the point can move to the right or to the left. To make the point I can handle it , but I can already confused in the movement of the point.
This code for draw point
...
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
1
answer
28
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
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
73
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 ...
5
votes
1
answer
412
views
How to dissolve by two fields using C#
I need to dissolve a feature class based on two fields for the dissolve_field parameter and two fields for the statistics_fields parameter. Does anyone have an example of how to do this using C#?
...
1
vote
0
answers
1k
views
Calculating Width and Height of Google Static Maps Image [closed]
How do I calculate the width and height (in degrees minutes) of a Google Static Maps image?
I've found it extremely difficult. The only information you have is:
The centre of the image (as a ...
1
vote
1
answer
144
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
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();...
0
votes
1
answer
166
views
How get the toolbar added with 'OnCustomizationEvent' from interface 'ICustomizationFilter'?
I'm implementing the interfaz ICustomizationFilter, and using the event 'OnCustomizationEvent' of this way:
public sealed partial class eManager : Extension, ICustomizationFilter
{
public bool ...
0
votes
2
answers
2k
views
Object does not exist in the namespace "http://schemas.esri.com/arcgis/client/2009"
I am trying to move all of my GIS code over the Visual Studio 2012. I have added the following references:
C#:
using ESRI.ArcGIS.Client;
using ESRI.ArcGIS.Client.Geometry;
using ESRI.ArcGIS.Client....
2
votes
1
answer
128
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 ...
1
vote
1
answer
506
views
ArcObjects OnChangeFeature event not firing unless you move feature
I am displaying points, lines and polygons on ArcMap as features with an addin. I want my end users to be able to change features (move geometries, add vertex, delete vertex etc) and get the updated ...
0
votes
1
answer
199
views
With in Version Difference (DifferenceTypeUpdateNoChange) how to pass IQueryFilter in ArcObjects
I want to know only real shape edits between 2 versions. How can I pass iQueryfilter to DifferenceTypeUpdateNoChange?
public void DifferenceTypeUpdateNoChange(ITable sourceTable, ITable ...
0
votes
1
answer
213
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
1
answer
47
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 ...
4
votes
1
answer
1k
views
Can custom map tiles be properly rendered via ArcObjects within ArcMap AddIn?
Within ArcObjects for ArcGIS 10.1, we are attempting to render pre-generated map tiles as a
basemap (group) layer. The tiles themselves are of the typical web mercator aux. spherical tiling scheme.
...
4
votes
1
answer
2k
views
How to set focus on ArcMap map window using ArcObjects and c#.net
I have developed a custom dockable window with textboxes, comboboxes and a button for use in ArcMap. After the user clicks on the button in the dockable window a function is invoked. After the ...
1
vote
0
answers
103
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 ...
0
votes
1
answer
49
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
78
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
1
answer
49
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
240
views
Getting HRESULT E_FAIL error when trying to open database connection via connection file
I developed an Addin in ArcGIS Pro 2.5 where I am using connection files to open database connections at runtime. So far that worked perfect. The connection files are stored on a network drive, ...
1
vote
1
answer
244
views
GDAL C# Bindings for VRT don't write a VRT file
I have previously asked this question on stack overflow, and am now asking this more specialized audience.
I'm wondering why the GDAL C# library (v2.3.3) call to Gdal.wrapper_GDALBuildVRT_names(...) ...
0
votes
1
answer
216
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 ...
2
votes
2
answers
823
views
Comparing geometry of two features to get changes using ArcObjects and c#?
I would like to compare the geometry between two feature, Already I selected the two feature. How do I start the comparison?
depend on the image below I need to write code to compare this two ...
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
159
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
66
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()
{
...
3
votes
1
answer
1k
views
Pivoting polyline at vertex or distance using ArcObjects C# [closed]
I'm using ArcObjects with C# trying to rotate only one part of a polyline at a vertex or distance along the polyline. The polyline is zAware and has values at regular spacing.
The only successful way ...
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
103
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 ...
1
vote
0
answers
1k
views
Start developing with Jeppesen C-MAP [closed]
I've just downloaded all the contents from the FTP of Jeppesen for their product called C-MAP CM93.
I've been reading the documentation contained in the SDK folders, but I can't figure out how to ...
13
votes
1
answer
34k
views
Converting latitude and longitude into Northing and Easting?
I have the following UK postcode dy8 3xt and know that the latitude and longitude is:
54.452772
-2.156082
I also know that the Easting, Northing for the postcode is:
389490
283880
However I am ...
5
votes
1
answer
7k
views
How to make a WPF Window be a well-behaved child window of ArcMap?
I am pretty familiar with Windows Forms in ArcGIS but WPF, which I'm just starting to tinker with, seems to be a different animal. I've created an ArcMap add-in with a button that displays a Window ...