-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some Front Optimization for Keep indoor data #709
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -119,6 +137,7 @@ const locationForRun = ( | |||
} | |||
if (provinceMatch) { | |||
[province] = provinceMatch; | |||
coordinate = extractCoordinate(location); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add some comments here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep的导出数据项location_country 中包含city的坐标
假如 存在province,尝试提取这个坐标保存。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,可以加在代码里么?因为这个是针对 keep 的所以加个注释好点~
@@ -158,6 +179,12 @@ const pathForRun = (run: Activity): Coordinate[] => { | |||
? [arr[1], arr[0]] | |||
: gcoord.transform([arr[1], arr[0]], gcoord.GCJ02, gcoord.WGS84); | |||
}); | |||
if (c.length === 2 && String(c[0]) === String(c[1])) { | |||
const { coordinate } = locationForRun(run); | |||
if (coordinate?.[0] && coordinate?.[1]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
解析runpath,如果仅有两个相同的坐标点(没有路径,只是一个坐标点),尝试替换为 location中记录的 city坐标。
ps: keep中室内跑步数据提取到的runpath 是北京或国家坐标点(可能是无坐标时的默认值)。 location 记录的是 更具体的城市坐标(如果有)。
如果更严谨的话,需要分析替换前后坐标,哪个更具体使用哪个。
@@ -232,6 +259,9 @@ const getBoundsForGeoData = ( | |||
if (points.length === 0) { | |||
return { longitude: 20, latitude: 20, zoom: 3 }; | |||
} | |||
if (points.length === 2 && String(points[0]) === String(points[1])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
调整路径只有一个点时的缩放级别,大概为市区级。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks |
* fix: use specific version match lockfileVersion * chore: slient stderr * fix: heartRates is in keep run data * chore: spell * refactor: use city coord instead country coord (keep indoor data has incomplete geoPoints) * Update utils.ts
* refs/heads/upstream: feat: fix nrc Changed their apis (yihong0618#718) feat: conditionally output analysis JS only in Vercel environment (yihong0618#715) ignore the year which has no running data when drawing github.svg (yihong0618#712) Fix AttributeError in Activity class (yihong0618#714) doc: fix typo close yihong0618#704 Some Front Optimization for Keep indoor data (yihong0618#709) Add new runner (yihong0618#707) feat: adding illustration for special tracks (yihong0618#705) # Conflicts: # run_page/generator/__init__.py # run_page/joyrun_sync.py
hi , yihong
I export some keep records , almost indoor run data 🫣.
the geoPoints is empty or looks incomplete decoded data,
i prefer the bounds is dalian(from location_country) not beijing.
btw the part of the keep data is :