[Mobilitydb-users] Loading Moving Feature JSON to Mobility DB?
SCHOEMANS Maxime
maxime.schoemans at ulb.be
Sat Apr 12 04:44:04 PDT 2025
Hi Andrew,
I believe that tgeompointFromMFJSON requires a TemporalGeometry object as input, instead of a full MovingFeature object.
Could you try to use the value of your TemporalGeometry field as input instead of the complete JSON?
Additionally, could you explain your use-case in more detail and maybe give an example MFJSON that you want to input in MobilityDB?
Do you want to produce a single tgeompoint object out of it, or does the MFJSON also have additional temporal properties (speed, etc.) that you also want to input?
This would give us a better idea of how these functions are used in practice.
If these functions work differently to how you might expect them to, don't hesitate to let us know so we can potentially improve their documentation or their behavior.
Best regards,
Maxime
On 12/04/2025 06:16, Andrew Koure via Mobilitydb-users wrote:
Dear Esteban,
Thanks for the advice!
I am receiving this error: SQL Error [XX000]: ERROR: Invalid 'type' value in MFJSON string. The types for my TemporalProperties objects are "Measure", on temporalGeometry it is "MovingPoint", and the top level type is Feature.
I suspect that I may not be formatting my MFJSON files correctly, is there a way to validate MFJSON easily? I can also send some examples if that is helpful.
All the Best,
Andrew
On Fri, Apr 11, 2025 at 12:25 PM Esteban Zimanyi <estebanzimanyi at gmail.com<mailto:estebanzimanyi at gmail.com>> wrote:
Dear Andrew
As part of our CI tests we do the following kind of queries to ensure that the input/output for MFJSON works correctly.
--------------------------------------------------------------
test=# SELECT COUNT(*) FROM tbl_tgeompoint WHERE asEWKT(temp) != asEWKT(tgeompointFromMFJSON(asMFJSON(temp)));
count
-------
0
(1 row)
test=# SELECT COUNT(*) FROM tbl_tgeompoint3D WHERE asEWKT(temp) != asEWKT(tgeompointFromMFJSON(asMFJSON(temp)));
count
-------
0
(1 row)
test=# SELECT COUNT(*) FROM tbl_tgeogpoint WHERE asEWKT(temp) != asEWKT(tgeompointFromMFJSON(asMFJSON(temp)));
count
-------
0
(1 row)
test=# SELECT COUNT(*) FROM tbl_tgeogpoint3D WHERE asEWKT(temp) != asEWKT(tgeompointFromMFJSON(asMFJSON(temp)));
count
-------
0
(1 row)
--------------------------------------------------------------
Therefore you should be able to able to input and output in MFJSON format.
Please let us know if you find any issues on this.
Esteban
On Fri, Apr 11, 2025 at 6:12 PM Andrew Koure via Mobilitydb-users <mobilitydb-users at lists.osgeo.org<mailto:mobilitydb-users at lists.osgeo.org>> wrote:
>
> Hello All,
> I have a program that is generating moving feature JSON, and I am looking to load the JSON into MobilityDB.
>
> Does anyone have guidance on how best to do this? I've tried looking through the documentation for MovingPandas, MobilityDB, and MEOS. Most of what I have found so far is for writing out to MFJSON.
>
> Thanks in Advance,
> Andrew
> _______________________________________________
> Mobilitydb-users mailing list
> Mobilitydb-users at lists.osgeo.org<mailto:Mobilitydb-users at lists.osgeo.org>
> https://lists.osgeo.org/mailman/listinfo/mobilitydb-users
_______________________________________________
Mobilitydb-users mailing list
Mobilitydb-users at lists.osgeo.org<mailto:Mobilitydb-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/mobilitydb-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mobilitydb-users/attachments/20250412/e18f26d9/attachment-0001.htm>
More information about the Mobilitydb-users
mailing list