GeoLocation: how to copy the Position saved in one entry into a different field in another entry?

29 views
Skip to first unread message

Todd Johnson

unread,
Aug 30, 2025, 12:30:04 PM (13 days ago) Aug 30
to mementodatabase
I have a database where I store a EndLocation as a geo "Position" object and I want to copy that object into the StartLocation field in another entry in the same database.  I can get the address or even coordinates of the EndLocation field into variables but I am unable to assign the "position" into the EndLocation field.
How do I assign the position info or object into the EndLocation (location field) ?
I have tried something like these methods, as well as simpler methods:
1.
const simulatedPosition = {
                    coords: {
                        latitude: SLocat[lex].lat,
                        longitude: SLocat[lex].lng,
                        accuracy: null, // Accuracy is not provided by geocoding
                        altitude: null,
                        altitudeAccuracy: null,
                        heading: null,
                        speed: null
                    }
            };
            entry().set("StartLocation", simulatedPosition);

2.
var locationData = {
               latitude: SLocat[lex].lat,
                longitude: SLocat[lex].lng,
                address: SLocat[lex].address
            };
Thanks for help!



Er Mo

unread,
Aug 30, 2025, 2:09:12 PM (13 days ago) Aug 30
to mementodatabase
Hallo
Für das Kopieren von GPS Daten zerlege ich diese in lat  und lng und setze sie wider zusammen . So funktioniert es bei mir gut

Hello
To copy GPS data, I split it into lat and long and then reassemble them. This works well for me.

var ort = e.field("GPS Daten ")
var lat = ort.lat
var lng =ort.lng
var gps = lat +","+ lng
e.set("GPS neu ",gps)

Ernst
Reply all
Reply to author
Forward
0 new messages