# Conversion (x,y,z) grid on a sphere to (lam,phi) grid

I have unregular mesh on a sphere. Each cell of the mesh is a quad. Coordinates of nodes are 3D (Cartesian x,y,z). I have cell data on this mesh and can view fields of the data on the 3D RenderView. No problem.

But now I need to draw the data in 2D coordinates (lam, phi). Longitude and latitude. I know formulas for transformation (x,y,z) -> (lam,phi,r). So lam variates from 0 to 2*Pi. But there are several cells on the mesh that are intersected by the Greenwich. They spoil my life! After transformation their horizontal edges jump from very left side to very right and their data overlap the data of the other cells.

I tried to cut off the cells that lie in a band around the Greenwich. But in this case I can not draw data exactly from 0 to 2Pi. Excellent solution could be to duplicate intersected cells so that one copy intersects line phi=0 and other one intersects line phi=2Pi. Then draw area exactly from 0 to 2Pi. But here is a lot of programming of the VTK file coverter. May be easier way already exists?

You have probably moved on, but one solution would be to split the mesh using the Clip filter with planar cut function two times, once producing one half of your sphere and again to produce the other half. This filter actually splits cells, so it should deal with your prime meridian problem fine. Then transform the vertices of each half sphere.