geofire

Using GeoFire in an Angular2 App

五迷三道 提交于 2019-11-30 16:22:28
问题 I'm trying to set up GeoFire in my Angular2 (RC5) app. I've installed geofire and firebase with npm and configured systemjs to import it. Here's my package.json: { "name": "MyProject", "version": "0.1.0", "scripts": { "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ", "lite": "lite-server", "postinstall": "typings install", "tsc": "tsc", "tsc:w": "tsc -w", "typings": "typings" }, "license": "ISC", "dependencies": { "@angular/common": "^2.0.0-rc.5", "@angular/compiler": "^2.0

Handling geocoding in Firebase?

房东的猫 提交于 2019-11-30 14:59:46
Has anyone tried storing and/or searching on geocodes (e.g. lat/long) in Firebase? This is functionality that is built into MongoDB and as I'm considering using Firebase for our backend instead, I need to know how I'd handle this scenario in Firebase. Thanks! The folks at Firebase recently open-sourced a library that allows you to store and query location data in Firebase. In short, this is very easily accomplished because all keys in Firebase are strings, and Firebase has support for startAt() and endAt() queries that allow you to do the appropriate windowing for geohashes and bounding boxes.

Ordering Firestore GeoHash query from closest to furthest?

情到浓时终转凉″ 提交于 2019-11-30 09:52:38
问题 Currently, I'm using parts of the GeoFirebase library along with Firestore to allow for geoquerying. When I set the geohash of a post, I do it as such if let geoHash = GFGeoHash(location: location.coordinate).geoHashValue { However, to make the geohash querying less specific, I'm planning on truncating part of the geohash when I query; currently, the query looks similar to this var geoQuerySpecific = GFGeoHashQuery() let geoQueryHash = GFGeoHashQuery.queries(forLocation: (lastLocation?

Handling geocoding in Firebase?

随声附和 提交于 2019-11-29 19:50:57
问题 Has anyone tried storing and/or searching on geocodes (e.g. lat/long) in Firebase? This is functionality that is built into MongoDB and as I'm considering using Firebase for our backend instead, I need to know how I'd handle this scenario in Firebase. Thanks! 回答1: The folks at Firebase recently open-sourced a library that allows you to store and query location data in Firebase. In short, this is very easily accomplished because all keys in Firebase are strings, and Firebase has support for

Is there a way I can combine a GeoFireStore query with a normal Firestore query?

浪子不回头ぞ 提交于 2019-11-29 17:14:06
I want to query users which I have stored in a collection named "Users". Each user has fields such as age and weight. Is there a way I can query the users by distance from the user running the search with GeoFire and combine it with FireStore search queries? For instance, I am a user who is looking for someone who is in a 20 mile radius but also wants to find someone who is between 2 years younger or older than them. The Firestore database can filter on multiple fields, but it can only do a range filter on one of those fields. So this query is possible: collection.where("age", ">", 18).where(

Ordering Firestore GeoHash query from closest to furthest?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 17:00:07
Currently, I'm using parts of the GeoFirebase library along with Firestore to allow for geoquerying. When I set the geohash of a post, I do it as such if let geoHash = GFGeoHash(location: location.coordinate).geoHashValue { However, to make the geohash querying less specific, I'm planning on truncating part of the geohash when I query; currently, the query looks similar to this var geoQuerySpecific = GFGeoHashQuery() let geoQueryHash = GFGeoHashQuery.queries(forLocation: (lastLocation?.coordinate)!, radius: (30)) as! Set<GFGeoHashQuery> for query in geoQueryHash { geoQuerySpecific = query

In order to sort geoquery results by distance must I read the entire dataset?

女生的网名这么多〃 提交于 2019-11-28 12:32:17
问题 To perform geoqueries in Firebase or Firestore, there are libraries like GeoFire and GeoFirestore. But to sort the results of that geoquery by distance, the entire dataset must be read, correct? If a geoquery produces a large number of results, there is no way to paginate those results (on the backend, not to the user) when sorting by distance, is there? 回答1: No, a geo query doesn't read the entire result set. That wouldn't scale well at all. You might want to read up on how geohashes work if

GeoFire query on User location

大憨熊 提交于 2019-11-28 08:48:44
I'm quite new to work with Firebase and its location library, GeoFire. Currently I'm facing some problem when structuring my data. At the moment my db is something like this: users facebook:xxxxx displayName: xx firstName: xx lastName: xx location: g: xxxx l: 0: xxx 1: xxx facebook:yyyyy displayName: yy firstName: yy lastName: yy location: g: yyyy l: 0: yyy 1: yyy I would like to query on users that are near my current user logged in. To do so I can't understand what path I have to specify. At the moment I'm doing like this (but that doesn't work): saving current location let root = Firebase

Adding additional children when setting in GeoFire Firebase?

旧巷老猫 提交于 2019-11-28 02:05:10
问题 I'm trying to set additional info when setting geoFire object in FB. Something like: geoFire.set(uniqueId, [latitude, longitude],{'message': message, 'iconUrl': iconURL, lastUpdate: Firebase.ServerValue.TIMESTAMP}).then(function () { //some stuff }; I can do it like this and it mostly works (depends on db roundtrip time): geoFire.set(uniqueId, [latitude, longitude],).then(function () { firebaseRef.child(uniqueId).update({'message': message, 'iconUrl': iconURL, lastUpdate: Firebase.ServerValue