I ran into this exact problem recently on LOS 15.1.
Props to Asiier for this post which helped me develop a hybrid fix.
I narrowed my issue down to a mix between a bad/dated gps.conf file and Oreo Google Play Services.
If you have the same issue, now or in the future, here are a few things you can do, but you must be rooted.
Option A) There is a Magisk Module - Global Optimized GPS File Replacer - that will replace your gps.conf file with a more updated one. Make sure though that it places the file in both /system/etc and /system/vendor/etc. If it doesn't, copy it to the other directory. The latter is where it's stored in Oreo on OnePlus 5, but some apps may look for it in the former directory.
I didn't fully trust this process though the instructions in the module are very good. The code is here so you can create the file in Notepad or Wordpad yourself and save it with .conf extension.
Option B ) If you want to do so manually, make sure you place the file in both system locations, and set the permissions 644 or rw-rw-r---, otherwise it won't work. Obviously, make sure the old file is deleted and the new one is re-named to gps.conf. Then reboot. I tweaked the file and added several US-based NTP servers to the list, but otherwise left it as written.
After either option - download either or both of these Apps:
GPS Status and Toolbox
GPS Locker
Switch to Device Only in location settings and re-calibrate your compass. You can use the GPS Status app or another app of your choosing.
Open either app and download new AGPS data.
Toggle between High Accuracy and Device Only and that will help to get a good lock.
After that, GPS lock should be much quicker, or can be reset with a new AGPS download.
I found that Device-Only is a better setting for LOS/OP5.
Of course, make sure you're outdoors, otherwise this won't work well, or not at all.
NOTE: Flashing a new build or new ROM will overwrite the gps.conf file back to the bad version, so this process must be followed again each time.
Props to Asiier for this post which helped me develop a hybrid fix.
I narrowed my issue down to a mix between a bad/dated gps.conf file and Oreo Google Play Services.
If you have the same issue, now or in the future, here are a few things you can do, but you must be rooted.
Option A) There is a Magisk Module - Global Optimized GPS File Replacer - that will replace your gps.conf file with a more updated one. Make sure though that it places the file in both /system/etc and /system/vendor/etc. If it doesn't, copy it to the other directory. The latter is where it's stored in Oreo on OnePlus 5, but some apps may look for it in the former directory.
I didn't fully trust this process though the instructions in the module are very good. The code is here so you can create the file in Notepad or Wordpad yourself and save it with .conf extension.
Option B ) If you want to do so manually, make sure you place the file in both system locations, and set the permissions 644 or rw-rw-r---, otherwise it won't work. Obviously, make sure the old file is deleted and the new one is re-named to gps.conf. Then reboot. I tweaked the file and added several US-based NTP servers to the list, but otherwise left it as written.
After either option - download either or both of these Apps:
GPS Status and Toolbox
GPS Locker
Switch to Device Only in location settings and re-calibrate your compass. You can use the GPS Status app or another app of your choosing.
Open either app and download new AGPS data.
Toggle between High Accuracy and Device Only and that will help to get a good lock.
After that, GPS lock should be much quicker, or can be reset with a new AGPS download.
I found that Device-Only is a better setting for LOS/OP5.
Of course, make sure you're outdoors, otherwise this won't work well, or not at all.
NOTE: Flashing a new build or new ROM will overwrite the gps.conf file back to the bad version, so this process must be followed again each time.