# How to access Point coordinates as PointData arrays?

**URL:** https://discourse.vtk.org/t/how-to-access-point-coordinates-as-pointdata-arrays/5484
**Category:** Support
**Created:** [April 2, 2021, 7:01am UTC](https://discourse.vtk.org/t/how-to-access-point-coordinates-as-pointdata-arrays/5484 "2021-04-02T07:01:57Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![scotsman60](https://discourse.vtk.org/user_avatar/discourse.vtk.org/scotsman60/32/6000_2.png) [@scotsman60](https://discourse.vtk.org/u/scotsman60)
#### Post date: [April 2, 2021, 7:01am UTC](https://discourse.vtk.org/t/how-to-access-point-coordinates-as-pointdata-arrays/5484/1 "2021-04-02T07:01:57Z")

</div>

Hello!!!  
I want to use the coordinates of Points in an unstucturedGrid as part of an equation in vtkArrayCalculator.  
In Paraview, I cann access the point coordinates as vector PointData using the array name ‘coords’ - which Paraview seems to provide “for free”  
How do I do the same thing in VTK?  
Of course I can do it manually - extract the point coordinates and add them as pointData - but are the coordinates directly avaiable without this step?

Thanks,

Doug

---

<div class="post-metadata">

### Author: ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)
#### Post date: [April 2, 2021, 12:16pm UTC](https://discourse.vtk.org/t/how-to-access-point-coordinates-as-pointdata-arrays/5484/2 "2021-04-02T12:16:53Z")

</div>

You can get a `vtkDataArray` handle of the point coordinates using `vtkPoints::GetData()`. So you could add this data array into you point data if you wanted to. However, if I recall correctly, this array is unnamed, so you would need to name it if you want to fetch it easily from the point data once you added this array.

I don’t know how it is done in ParaView, and if it is done in a smarter way. Do you know that on the top of your head @cory.quammen or @utkarshayachit ?

---

<div class="post-metadata">

### Author: ![scotsman60](https://discourse.vtk.org/user_avatar/discourse.vtk.org/scotsman60/32/6000_2.png) [@scotsman60](https://discourse.vtk.org/u/scotsman60)
#### Post date: [April 2, 2021, 10:00pm UTC](https://discourse.vtk.org/t/how-to-access-point-coordinates-as-pointdata-arrays/5484/3 "2021-04-02T22:00:13Z")

</div>

@Yohann_Bearzi  
Yes - doing it manually is easy enough.

```
    dset.GetPointData().AddArray(dset.GetPoints().GetData())`

```

The resulting vector array actually ends up being called “Points”…
