We compare two optical clocks based on the ^{2}S_{1/2}(F=0)→^{2}D_{3/2}(F=2) electric quadrupole (E2) and the ^{2}S_{1/2}(F=0)→^{2}F_{7/2}(F=3) electric octupole (E3) transition of ^{171}Yb^{+} and measure the frequency ratio ν_{E3}/ν_{E2}=0.932829404530965376(32), improving upon previous measurements by an order of magnitude. Using two caesium fountain clocks, we find ν_{E3}=642121496772645.10(8) Hz, the most accurate determination of an optical transition frequency to date. Repeated measurements of both quantities over several years are analyzed for potential violations of local position invariance. We improve by factors of about 20 and 2 the limits for fractional temporal variations of the fine structure constant α to 1.0(1.1)×10^{-18}/yr and of the proton-to-electron mass ratio μ to -8(36)×10^{-18}/yr. Using the annual variation of the Sun's gravitational potential at Earth Φ, we improve limits for a potential coupling of both constants to gravity, (c^{2}/α)(dα/dΦ)=14(11)×10^{-9} and (c^{2}/μ)(dμ/dΦ)=7(45)×10^{-8}.