Depends on what level you want to do it, some options/suggestions on top of my mind:
- In the PX4 Autopilot, there’s a Simulator interface, you could intercept the real GPS messages and change them . (As pointed out in another post by @dagar )
- directly on Gazebo, through the GPS plugin