question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow additional sources for my.location

See original GitHub issue

Dont expect any changes on this problem any time soon, just creating this issue to track the problem I’m having

Currently I have to overlay time.tz.via_location, since I use a different data source (combined from gpslogger, ips from google, facebook, discord etc)

On this repo, it uses location.google to grab that info. Slightly unrelated, but I’ve also parsed the takeout using lxml instead, so my structure there is different

I would prefer if there was a common entrypoint (like my.location.all) that could take multiple entrypoints as input, falling back to empty iterators if they aren’t enabled/fail to be imported, as that would localize my overlayed changes to the my.location package

You can see the current structure for my.location here

.
├── all.py
├── gpslogger.py
├── ip.py
└── models.py

I created this following the discussion we had regarding merging pushshift data

I’ve also slightly modified the Location NT, so it can track whether this source was from an accurate (e.g. Google or gpslogger) or estimate (geolocation based on ip)

class Location(NamedTuple):
    lng: float
    lat: float
    dt: datetime
    # approximate accuracy
    # true means exact, false means its based on ip/auxiliary info
    accuracy: bool

Am a bit conflicted on how to handle this many data sources…

Would need some modifications, would probably create individual files for:

  • google
  • apple (locations from gdpr export)
  • ip-based (need inidividual empty fallbacks for blizzard, facebook, discord)
  • gpslogger

Some of those could stay on my branch if you’re not interested in having them here, I think its more important to have the following here:

  • a common.py file, including:
  • a Location NT which all other location providers would convert their NT/DTs to
  • a merge_locations function, with the typical set/emitted behavior

Then, to enable additional location providers, I could either just overlay the all.py file, including my additional imports – which probably wouldn’t ever have to be changed

Something like what was described in the comment here

If there are no issues you foresee here, I’m willing to implement this at some point in the future.

Will probably not touch the location.google file here, except to create a standard interface across all the submodules which all.py would then import from.

Also, unsure if you settled on using all.py or main.py, I tend to prefer all.py for namespace packages which are merging multiple data sources

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
seanbreckenridgecommented, Feb 13, 2022
1reaction
seanbreckenridgecommented, Feb 9, 2022

accuracy in meters

Yeah, that makes sense – the bool was a quick fix on my end

Are you thinking of my/google_takeout.py path? Or somewhere under my/google/takeout/?

reason I named it my/google_takeout.py to begin with was because otherwise there might be conflicts with the upstream files if someone was trying to use both for something

I think to allow for deprecation of the current google takeout files here, I could name it my/google/takeout/parser.py (to keep with the google_takeout_parser name. If needed can create an all.py file to perhaps handle merging sources in the future then

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understand & manage your location when you search on ...
When you search on Google, like with Maps, Search or Google Assistant, your current location is used to give you more helpful results....
Read more >
About privacy and Location Services in iOS and iPadOS
With your permission, Location Services allows apps and websites (including Maps, Camera, Weather, and other apps) to use information from ...
Read more >
Get Started | Maps URLs - Google Developers
Introduction. Using Maps URLs, you can build a universal, cross-platform URL to launch Google Maps and perform searches, get directions and navigation, ...
Read more >
9 things to know about Google's maps data: Beyond the Map
With more than a billion people using Google Maps every month and more than 5 million active apps and websites using Google Maps...
Read more >
Stay up to date with news and interests - Microsoft Support
Select Location to set your primary location and see more relevant content for that location. This will also update the location used for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found