Merge pull request #46 from faragher/main

Added Windows API for MMAP in Geo.py
This commit is contained in:
markqvist 2024-03-28 12:20:33 +01:00 committed by GitHub
commit 54a2764815
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -418,7 +418,10 @@ class GeoidHeight(object):
raise Exception("File has the wrong length")
self.headerlen = headerlen
self.raw = mmap.mmap(fd, fullsize, mmap.MAP_SHARED, mmap.PROT_READ)
if RNS.vendor.platformutils.is_windows():
self.raw = mmap.mmap(fd, fullsize, access=mmap.ACCESS_READ)
else:
self.raw = mmap.mmap(fd, fullsize, mmap.MAP_SHARED, mmap.PROT_READ)
self.rlonres = self.width / 360.0
self.rlatres = (self.height - 1) / 180.0