GeoPointValue vs precision #222
-
Using GeoPointValue with doubles was rounding to 2 decimals due to WString.h in esp32 Arduino core. both Constructors are marked as obsolete here: i also see in CreateDocument.ino: but this didn't work either.. sorry if this is obvious, but i was hoping someone could help me in the use of GeoPointValue or should another class be used? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It works as normal. Why you said it does not work? The latitude as number between -90 and 90. Creating a document...
Debug task: createDocumentTask, msg: Connecting to server...
task: createDocumentTask, payload: {
"name": "projects/______________/databases/(default)/documents/test_doc_creation/doc_1/col_1/data_0",
"fields": {
"myNull": {
"nullValue": null
},
"myRef": {
"referenceValue": "projects/______________/databases/(default)/documents/coll_id/doc_id"
},
"myDouble": {
"doubleValue": 1234.567891
},
"myBytes": {
"bytesValue": "aGVsbG8="
},
"myMap": {
"mapValue": {
"fields": {
"count": {
"integerValue": "3"
},
"mass": {
"stringValue": "1.3kg"
},
"name": {
"stringValue": "wrench"
}
}
}
},
"myArr": {
"arrayValue": {
"values": [
{
"stringValue": "test"
},
{
"integerValue": "20"
},
{
"booleanValue": true
}
]
}
},
"myGeo": {
"geoPointValue": {
"latitude": 1.486284, <----------
"longitude": 23.678198 <----------
}
},
"myString": {
"stringValue": "hello"
},
"myBool": {
"booleanValue": true
},
"myInt": {
"integerValue": "1"
},
"myTimestamp": {
"timestampValue": "2024-04-09T14:54:01.999999Z"
}
},
"createTime": "2025-02-15T18:43:52.983935Z",
"updateTime": "2025-02-15T18:43:52.983935Z"
}
Creating a document...
task: createDocumentTask, payload: {
"name": "projects/______________/databases/(default)/documents/test_doc_creation/doc_1/col_1/data_1",
"fields": {
"myDouble": {
"doubleValue": 1234.567891
},
"myMap": {
"mapValue": {
"fields": {
"name": {
"stringValue": "wrench"
},
"count": {
"integerValue": "3"
},
"mass": {
"stringValue": "1.3kg"
}
}
}
},
"myArr": {
"arrayValue": {
"values": [
{
"stringValue": "test"
},
{
"integerValue": "20"
},
{
"booleanValue": true
}
]
}
},
"myBytes": {
"bytesValue": "aGVsbG8="
},
"myGeo": {
"geoPointValue": {
"latitude": 1.486284, <----------
"longitude": 23.678198 <----------
}
},
"myRef": {
"referenceValue": "projects/______________/databases/(default)/documents/coll_id/doc_id"
},
"myNull": {
"nullValue": null
},
"myString": {
"stringValue": "hello"
},
"myTimestamp": {
"timestampValue": "2024-04-09T14:54:01.999999Z"
},
"myBool": {
"booleanValue": true
},
"myInt": {
"integerValue": "2"
}
},
"createTime": "2025-02-15T18:44:11.929609Z",
"updateTime": "2025-02-15T18:44:11.929609Z"
}
Creating a document...
task: createDocumentTask, payload: {
"name": "projects/______________/databases/(default)/documents/test_doc_creation/doc_1/col_1/data_2",
"fields": {
"myMap": {
"mapValue": {
"fields": {
"mass": {
"stringValue": "1.3kg"
},
"count": {
"integerValue": "3"
},
"name": {
"stringValue": "wrench"
}
}
}
},
"myTimestamp": {
"timestampValue": "2024-04-09T14:54:01.999999Z"
},
"myRef": {
"referenceValue": "projects/______________/databases/(default)/documents/coll_id/doc_id"
},
"myArr": {
"arrayValue": {
"values": [
{
"stringValue": "test"
},
{
"integerValue": "20"
},
{
"booleanValue": true
}
]
}
},
"myInt": {
"integerValue": "3"
},
"myDouble": {
"doubleValue": 1234.567891
},
"myGeo": {
"geoPointValue": {
"latitude": 1.486284, <----------
"longitude": 23.678198 <-----------
}
},
"myBool": {
"booleanValue": true
},
"myString": {
"stringValue": "hello"
},
"myBytes": {
"bytesValue": "aGVsbG8="
},
"myNull": {
"nullValue": null
}
},
"createTime": "2025-02-15T18:44:31.927678Z",
"updateTime": "2025-02-15T18:44:31.927678Z"
} |
Beta Was this translation helpful? Give feedback.
-
sorry for the dumb question Mobizt, i didn't get enough sleep last night |
Beta Was this translation helpful? Give feedback.
It works as normal. Why you said it does not work?
The latitude as number between -90 and 90.
The longitude as number between -180 and 180.