# Polyline on map generated by coordinates from database

**URL:** <https://forum.inductiveautomation.com/t/polyline-on-map-generated-by-coordinates-from-database/57324>\
**Category:** Ignition\
**Created:** [March 17, 2022, 6:10pm UTC](https://forum.inductiveautomation.com/t/polyline-on-map-generated-by-coordinates-from-database/57324 "2022-03-17T18:10:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregorio\_Casparri](https://avatars.discourse-cdn.com/v4/letter/g/8edcca/32.png) [@Gregorio\_Casparri](https://forum.inductiveautomation.com/u/Gregorio_Casparri)\
**Post date:** [March 17, 2022, 6:10pm UTC](https://forum.inductiveautomation.com/t/polyline-on-map-generated-by-coordinates-from-database/57324/1 "2022-03-17T18:10:36Z")

</div>

Hello everyone, I have a problem that I want to share with you. I want to display a series of aqueduct lines in the map component, for which I have point-to-point coordinates entered into a database. To extract them, load a query name with the data and then try to bind it using a Query binding followed by a script that assigns it to lat and lng objects. But although they seem to be loaded correctly, the designer tells me an error (layers.vector.polyline[0].points[1].lng: string found, number, null expected), which according to my understanding is due to the data type, and I still can’t solve this. I am interested to know if someone can think of a solution or a simpler way to perform the same data acquisition process.

 ![Captura de pantalla 2022-03-17 150246](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/d/4dc1dc82e11b34c9253c59362f06eaa2c988a1a5.png)  
 ![Captura de pantalla 2022-03-17 150336](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/d/bdfeb05b617df1040e3a083455205551985b9120.png)`Preformatted text`

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [March 17, 2022, 6:15pm UTC](https://forum.inductiveautomation.com/t/polyline-on-map-generated-by-coordinates-from-database/57324/2 "2022-03-17T18:15:14Z")

</div>

Please post code, not pictures of code. Tip: use the `</>` code formatting button to preserve code indentation and apply syntax highlighting. It’s essential for Python and makes any code much easier to read. There’s an edit button (pencil icon) below your post so you can fix it.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 17, 2022, 6:17pm UTC](https://forum.inductiveautomation.com/t/polyline-on-map-generated-by-coordinates-from-database/57324/3 "2022-03-17T18:17:27Z")

</div>

> [@Gregorio\_Casparri](#):
>
> (layers.vector.polyline[0].points[1].lng: string found, number, null expected

That path doesn't line up with the section of the property editor you've shown in the screenshot; what do the values look like in the `points` array?

Also, it's probably not relevant to your issue, but I'm pretty sure your transform script could be reduced to something like this:

```auto
pds = system.dataset.toPyDataSet(value)

return list(dict(row) for row in pds)

```

Or as a comprehension:

```auto
pds = system.dataset.toPyDataSet(value)

return [
	{
		"lat": lat,
		"lng": lng
	} for lat, lng in pds
]

```

---

<div class="post-metadata">

**Author:** ![ajdewhirst1](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@ajdewhirst1](https://forum.inductiveautomation.com/u/ajdewhirst1)\
**Post date:** [March 17, 2022, 6:28pm UTC](https://forum.inductiveautomation.com/t/polyline-on-map-generated-by-coordinates-from-database/57324/4 "2022-03-17T18:28:49Z")

</div>

How are your long and lat values stored in the database?  
If they are stored as strings, they will need converting to floats.
