Could somebody advise me why the linestring behaves differently to the two lists as shown in the attached?
Label2 shows [[1.315,103.845],[1.316,103.846],[1.317,103.847]]
whereas Label1 shows [[1.32305,103.82732],[1.31584,103.83453]], the points of linestring indicated in designer.
"Invalid value for point at index 1 (103.845, 1.315)."
The valid range of latitude in degrees is -90 and +90 for the southern and northern hemisphere respectively. Longitude is in the range -180 and +180 specifying coordinates west and east of the Prime Meridian, respectively.
For reference, the Equator has a latitude of 0°, the North pole has a latitude of 90° north (written 90° N or +90°), and the South pole has a latitude of -90°.
The Prime Meridian has a longitude of 0° that goes through Greenwich, England. The International Date Line (IDL) roughly follows the 180° longitude. A longitude with a positive value falls in the eastern hemisphere and negative value falls in the western hemisphere.
I set linestring1.points to the list variable lineLocation only if the list variable has more than one item. But why is there still an error saying the linestring1 requires at least 2 points and that there was none?
Attached are the blocks. Appreciate if anyone can help.
I tried using either LineString1.Points or LineString1.PointsFromString and in both instances it worked.
But for LineSting1.PointsFromString I have to set the block to a list consisting of pairs of values in the form of [latitude,longitude] and not [longitude,latitude] as mentioned to be required. Why is this so?
Also, since both LineString1.Points and LineString.PointsFromString achieve the same objective, why do we need to have two blocks? Are there circumstances where one works but not the other?
Yes. Points takes a List as input. PointsFromString takes a list you construct as input like
" [[42.36907141773815,-71.10506057739259],[42.3637444694139,-71.09785079956056]] "
The two methods are there for flexibility.
The PointsFromString is demonstrated in the example aia.
==================================================
Do this:
This will bring up
Select the OK, that brings up anther screen you use to load the example Project in the Designer.
Hi,
I 'm trying to program an app where multiple users of the app can update their current locations so that everyone knows where everyone else is.
I tried to store the current latitude and longitude to the TinyWebDb and to be sure that the latitude and longitude values are correctly returned from the TinyWebDb I have introduced a label to verify this.
The label indicated that a list of latitude and longitude values were returned. However when I ran the AI Companion, I got the error message that said “Attempt to get item 2 of a list of length 1”. Where did I go wrong?
Sorry, we do not know. You posted a few Blocks but not the important ones. You apparently tried to iterate through a List without checking if the length of list is at least two.