Wanna punch sports clock automatically? Try this! This tutorial is for those who have both Mac and iPhone.
[TOC]
Because the development is based on iOS system, we use Xcode to construct the project and simulate the whole process. Note that if you want to do this on a real phone, you need to connect your iPhone to your Mac.
Open Gaode API and get your intended location. Note that this location (GCJ02) is not exact because of restrictions in China. Thus, the real location should be obtained by a mathematical algorithm.
For exampl,e Tian’an men: [116.397498, 39.90916]
Modify the main function in the python script ./coordTransform_utils.py
and run python2 ./coordTransform_utils.py
to get the real location.
For exampl,e Tian’an men: [116.39125436909006, 39.907756481171596]
Open Xcode, and build a new program. Create a new GPX file.
Copy and paste the exact location (latitude and longtitude) into the file.
Edit the scheme of the program to real phone and click “run”.
Then stop running and run the program for several times, and then the location is successfully shifting from your place now to another place!