public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Federico Pellegrin <fede@evolware.org>
To: git-commits@fedoraproject.org
Subject: [rpms/python-phyghtmap] f44: Try to further fix package: GDAL swapped coordinates (rhbz#2469045)
Date: Thu, 04 Jun 2026 04:35:11 GMT	[thread overview]
Message-ID: <178054771117.1.2297169545834951481.rpms-python-phyghtmap-9a9d2c7642fa@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/python-phyghtmap
Branch : f44
Commit : 9a9d2c7642faae7e89bd9f9d172538c5924b02a8
Author : Federico Pellegrin <fede@evolware.org>
Date   : 2026-06-03T06:41:05+02:00
Stats  : +58/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-phyghtmap/c/9a9d2c7642faae7e89bd9f9d172538c5924b02a8?branch=f44

Log:
Try to further fix package: GDAL swapped coordinates (rhbz#2469045)

---
diff --git a/0004-New_gdal_swapped_coords.patch b/0004-New_gdal_swapped_coords.patch
new file mode 100644
index 0000000..b5da0d9
--- /dev/null
+++ b/0004-New_gdal_swapped_coords.patch
@@ -0,0 +1,52 @@
+diff -ruN phyghtmap-2.23-c/phyghtmap/hgt.py phyghtmap-2.23-d/phyghtmap/hgt.py
+--- phyghtmap-2.23-c/phyghtmap/hgt.py	2026-05-14 05:47:13.077972255 +0200
++++ phyghtmap-2.23-d/phyghtmap/hgt.py	2026-05-25 06:49:34.200861430 +0200
+@@ -132,8 +132,12 @@
+ 	return minLon+corrx, minLat+corry, maxLon+corrx, maxLat+corry
+ 
+ def getTransform(o, reverse=False):
++	import osgeo
+ 	from osgeo import gdal, osr
+ 	n = osr.SpatialReference()
++	if int(osgeo.__version__[0]) >= 3:
++		# GDAL 3 changes axis order: https://github.com/OSGeo/gdal/issues/1546
++		n.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER)
+ 	n.ImportFromEPSG(4326)
+ 	oAuth = o.GetAttrValue("AUTHORITY", 1)
+ 	nAuth = n.GetAttrValue("AUTHORITY", 1)
+@@ -168,6 +172,7 @@
+ 		return minLon, minLat, maxLon, maxLat
+ 
+ def parseGeotiffBbox(filename, corrx, corry, doTransform):
++	import osgeo
+ 	from osgeo import gdal, osr
+ 	try:
+ 		g = gdal.Open(filename)
+@@ -177,6 +182,9 @@
+ 				filename, geoTransform))
+ 			raise hgtError
+ 		fileProj = osr.SpatialReference()
++		if int(osgeo.__version__[0]) >= 3:
++			# GDAL 3 changes axis order: https://github.com/OSGeo/gdal/issues/1546
++			fileProj.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER)
+ 		fileProj.ImportFromWkt(g.GetProjectionRef())
+ 		numOfCols = g.RasterXSize
+ 		numOfRows = g.RasterYSize
+@@ -536,6 +544,7 @@
+ 	def initAsGeotiff(self, corrx, corry, polygon, checkPoly, voidMax):
+ 		"""init this hgtFile instance with data from a geotiff image.
+ 		"""
++		import osgeo
+ 		from osgeo import gdal, osr
+ 		try:
+ 			g = gdal.Open(self.fullFilename)
+@@ -543,6 +552,9 @@
+ 			# we don't need to check for the geo transform, this was already done when
+ 			# calculating the area name from main.py
+ 			fileProj = osr.SpatialReference()
++			if int(osgeo.__version__[0]) >= 3:
++				# GDAL 3 changes axis order: https://github.com/OSGeo/gdal/issues/1546
++				fileProj.SetAxisMappingStrategy(osr.OAMS_TRADITIONAL_GIS_ORDER)
+ 			fileProj.ImportFromWkt(g.GetProjectionRef())
+ 			self.numOfCols = g.RasterXSize
+ 			self.numOfRows = g.RasterYSize

diff --git a/python-phyghtmap.spec b/python-phyghtmap.spec
index 1e8cc25..965e06b 100644
--- a/python-phyghtmap.spec
+++ b/python-phyghtmap.spec
@@ -2,7 +2,7 @@
 
 Name:           python-phyghtmap
 Version:        2.23
-Release:        20%{?dist}
+Release:        21%{?dist}
 Summary:        Generate OSM contour lines from NASA SRTM data
 License:        GPL-2.0-or-later
 URL:            http://katze.tfiu.de/projects/phyghtmap/
@@ -13,6 +13,8 @@ Patch0:         0001-phyghtmap_numpy_arrays.patch
 Patch1:         0002-Fix_matplotlib_after_3_6_0.patch
 # Compatibility with changes of newer numpys: array comparison and inputs are arrays of arrays
 Patch2:         0003-Array_all_array_equal.patch
+# GDAL swapped coordinates in new versions: https://gis.stackexchange.com/questions/423635/phyghtmap-2-23-reversing-flipping-coordinates
+Patch3:         0004-New_gdal_swapped_coords.patch
 BuildArch:      noarch
 # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
 ExcludeArch: %{ix86}
@@ -72,6 +74,9 @@ install -Dpm 644 docs/%{modname}.1 %{buildroot}%{_mandir}/man1/%{modname}.1
 %{_mandir}/man1/%{modname}.1*
 
 %changelog
+* Mon May 25 2026 Federico Pellegrin <fede@evolware.org> - 2.23-21
+- Try to further fix package: GDAL swapped coordinates (rhbz#2469045)
+
 * Sat May 23 2026 Federico Pellegrin <fede@evolware.org> - 2.23-20
 - Try to further fix package with new numpy changes (rhbz#2469045)
 

                 reply	other threads:[~2026-06-04  4:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178054771117.1.2297169545834951481.rpms-python-phyghtmap-9a9d2c7642fa@fedoraproject.org \
    --to=fede@evolware.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox