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.

Feature request: Optional custom data

See original GitHub issue

My current project is based on Polymer/Firebase/Maps API. I have to display to the user the number of records within the area he is viewing, using clustering technique. All is fine with GeoFire and thousand of records (require some tweaks with the Polymer data binding system).

The user can filter records by type using the on/off switch buttons: capture d ecran de 2016-09-27 13 05 37

If GeoFire lets me add custom data, then I can achieve this in a simple way without server side code.

For my use case, and for performance reasons, the added data must be relatively tiny. For exemple:

"2016-001": {
  "g" : "u07t4v857n",
  "l" : [ 47.31595982215497, 5.042859856945543 ],
  "t" : "a"
}

“t” stands for “type”.

I understand that adding custom data has an impact on performances. It might be up to the user of GeoFire to decide the best compromise, depending on the context, between adding data and performance.

I’ll link a PR to this issue.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:14
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
mikepughcommented, Feb 17, 2017

@sonaye that is right - GeoFire is not downloading all of that data when I execute a query. I don’t have precise perf figures for you but basically GeoFire makes a couple of calls out to Firebase and streams the results to my app over the websocket connection. For a sample search near my location, Firebase sent me ~10 frames and each frame was between 1 KB and 6 KB. Each frame contained multiple search results - I think I had about 30 results displayed to the user, but GeoFire provided ~60 results.

The way GeoFire works is it takes your search lat/long coordinates and a search radius, and it calculates GeoHash values for the bounding box of that circle. Since GeoFire requires a Firebase index on the geohash value for all keys stored on the geo node, it is then able to very quickly query those indexes and stream the results to you. It does stream more results than what is strictly within your search radius since it’s working off a bounding box. GeoFire then locally trims out results which aren’t within your search radius.

So it does get a bit more than absolutely necessary but it’s still very fast and reasonably lightweight.

Some of the data I store on my geo node include:

  • Display Name
  • Phone #
  • E-mail
  • Company Name
  • Certifications
  • Id

The extra data isn’t huge, so I haven’t had any performance issues with it.

The recommended approach where-by I store that data on some other node in Firebase and query it directly by id was much slower. But my data set is fairly static - I’m tracking local companies so their locations don’t move around and at most my app is going to display ~75 results to the end user. So your mileage will vary with my solution.

1reaction
mikepughcommented, Feb 15, 2017

@sonaye - I have a modified GeoFire-JS fork that can store data on the GeoFire index. I just updated it a few minutes ago to bring it in line with GeoFire v4.1.2

Try it out and let me know if it works for you.

https://github.com/mikepugh/geofire-js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: Allow custom likerts to have optional questions.
Currently is it not very hard to implement a subclass of webform likert element to allow some questions to be optional.
Read more >
Feature Request Content - Instabug
This page covers the content found in a feature request. ... that users can complete as well as the APIs to make their...
Read more >
Should you build a feature for just one customer? - OpinionX
Product builders think that by making a feature optional, they get the best of both worlds — satisfy the feature request without overburdening ......
Read more >
Bugs vs Feature Requests | FIGURE Help Desk
A Feature Request (often mistaken as a Bug) comes about when a user of the Figure platform would like unique, new, or additional...
Read more >
What are your "Top 5 Feature Requests"? - Qualtrics Community
Re-code seen but not selected on data export - The ability to re-code downloaded ... The dream feature, would be an api to...
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