Describe the bug
I have a simple point that I am attempting to transform from EPSG 4326 to EPSG 32755. It is failing with 'PROJ: utm: Invalid latitude'
To Reproduce
using MaxRev.Gdal.Core;
using OSGeo.OSR;
// Initialize GDAL
GdalBase.ConfigureAll();
// Define the source and target spatial references
SpatialReference srcSpatialRef = new SpatialReference("");
srcSpatialRef.ImportFromEPSG(4326); // WGS84
SpatialReference dstSpatialRef = new SpatialReference("");
dstSpatialRef.ImportFromEPSG(32755); // UTM zone 55S
CoordinateTransformation transformToUTM = new CoordinateTransformation(srcSpatialRef, dstSpatialRef);
// Coordinates to transform
double[] point = new double[] { 144.9631, -37.8136, 0 };
// Validate latitude and longitude
if (point[1] < -80 || point[1] > 84)
{
Console.WriteLine("Invalid latitude for UTM transformation.");
return;
}
// Perform the transformation
try
{
transformToUTM.TransformPoint(point);
Console.WriteLine($"Transformed coordinates: X = {point[0]}, Y = {point[1]}, Z = {point[2]}");
}
catch (Exception ex)
{
Console.WriteLine($"Error during transformation: {ex.Message}");
}
Expected behavior
According to copilot: When you run this code, it should output the transformed coordinates in the UTM zone 55S projection. The expected result should be something like:
Transformed coordinates: X = 321921.45, Y = 5814192.55, Z = 0
Screenshots
Environment information:
OS (version): Windows 10 (19045)
Package version (Universal): 3.9.1.247
Additional context
Hopefully this should be simple enough to follow. I had a problem in my system with this transformation and I'd really like to know the cause. If you need anything extra please let me know, or if this is something that I need to post to a GDAL forum please tell me where.
Describe the bug I have a simple point that I am attempting to transform from EPSG 4326 to EPSG 32755. It is failing with 'PROJ: utm: Invalid latitude'
To Reproduce
Expected behavior According to copilot: When you run this code, it should output the transformed coordinates in the UTM zone 55S projection. The expected result should be something like: Transformed coordinates: X = 321921.45, Y = 5814192.55, Z = 0
Screenshots
Environment information:
Additional context Hopefully this should be simple enough to follow. I had a problem in my system with this transformation and I'd really like to know the cause. If you need anything extra please let me know, or if this is something that I need to post to a GDAL forum please tell me where.