PointFieldMetadata Invalid array length

Afternoon LEAF,

I am trying to display a point on the Globe for a data service that contains PointFieldMetadata that looks like so:

{
        "_id" : "545b93e3-11ef-4562-897f-56cc4fe27fa3",
        "version" : NumberLong(436),
        "dataChangeEvents" : {

        },
        "ancestryArray" : [
                {
                        "id" : "545b93e3-11ef-4562-897f-56cc4fe27fa3",
                        "type" : "TspiLight",
                        "separation" : 0
                }
        ],
        "foreignRefs" : [ ],
        "type" : "TspiLight",
        "alternateId" : "1286823e-8281-456d-8f3e-66d9076d3c70.missile",
        "idStateVector" : "1286823e-8281-456d-8f3e-66d9076d3c70.missile-SV436",
        "idOnOrbit" : "1286823e-8281-456d-8f3e-66d9076d3c70.missile",
        "pedigree" : "ORBIT_UPDATE",
        "covarianceArray" : "[0.00545120246887666, 0.0026330259976793443]",
        "thrustAccel" : 0.10351304667137952,
        "xpos" : -1433.5743382589774,
        "xvel" : -0.5443929956264034,
        "ypos" : 4478.412335905606,
        "yvel" : -0.9925431300273011,
        "zpos" : 4309.722029631882,
        "zvel" : -0.456459766090847,
        "flightPhase" : 7,
        "createdByUsername" : "AnonymousSystemUser",
        "lastModifiedByUsername" : "AnonymousSystemUser",
        "edition" : NumberLong(1),
        "qualifiedId" : "/545b93e3-11ef-4562-897f-56cc4fe27fa3",
        "qualifiedType" : "/TspiLight",
        "rootId" : "545b93e3-11ef-4562-897f-56cc4fe27fa3",
        "rootType" : "TspiLight",
        "geodeticPosition" : {
                "type" : "Point",
                "coordinates" : [
                        107.750267,
                        42.697329,
                        10.13
                ]
        },
        "createdDate" : NumberLong("1680723299416"),
        "ts" : NumberLong("1679945220001"),
        "lastModifiedDate" : NumberLong("1680723316899"),
        "displayLabel" : "1286823e-8281-456d-8f3e-66d9076d3c70.missile"
}

However, when I try to load the data on the Globe I get this:

I am stumped as to where to look for the problem, any pointers would make my day.

sg

Are you able to share the code you’re using to load this data into Globe?

David, sorry for the delay, I am working two things at once.

Finding the code to show you is part of the problem. We are using a leaf 3.4.0-dev.5 clone of what used to be called the reference-app. The app uses these leaf dependencies;

    "@leaf-framework/core": "3.4.0-dev.5",
    "@leaf-framework/dashboard": "3.4.0-dev.5",
    "@leaf-framework/data-object-editor": "3.4.0-dev.5",
    "@leaf-framework/data-object-table": "3.4.0-dev.5",
    "@leaf-framework/globe": "3.4.0-dev.5",
    "@leaf-framework/map": "3.4.0-dev.5",
    "@leaf-framework/morph-map": "3.4.0-dev.5",
    "@leaf-framework/query-builder": "3.4.0-dev.5",
    "@leaf-framework/react": "3.4.0-dev.5",
    "@leaf-platform/service-discovery": "3.4.0-dev.5",

The error occurs at the instant I click “Save” in the overlay widget and the errors, as you can see, are not helpful in finding the problem.

A question back to you is, do you know where I would even begin to look? I don’t think we (my division) wrote any of the code involved. I would be happy to huddle in Slack and give you a live demo too.

Thank you again for your time/help.

sg

The LKB docs for setting up Globe states:

First, make sure you have an array of DataObjects with geometries properties. The array can be manually created in-memory or from a server. How you create your array determines which EntityCollection component you will use. If you create it in-memory, you will use DataObjectEntityCollection . If you create it from a server, you will need to use ServerBackedDataObjectEntityCollection .

Given that your exception is “invalid array length”, can you confirm that you’re passing Globe an array of DataObjects rather than a single DataObject?

Summarization:

I found my problem and the answer can be confusing, but I will try and summarize. I am running a leaf 3.4.0-dev.5 clone of what used to be referred to as the reference-app. My goal was to display a “point” on the leaf-globe. Back when the reference-app was a thing there were also a capability built in such that if you had a PointFieldMetadata as part of your dataObject it would show up on the 3D Globe or a 2D leaflet map. As this thread details, I created such a PointFieldMetadata but got the errors listed.

After lot’s of trial and error I found that all I needed to do was have root level fields in my dataObject named

  • latitude
  • longitude
  • altitude

I use them as Doubles.

I deleted the PointFieldMetadata all-together, ingested some fresh data with the new fields and the Point showed up on the map without any issues.

I wish I could give more specific details as to the cause of the Error, but this is all I know.

Thank you LEAF for all the help.

sg