I think what doublebishop suggests is actually giving the result you want, , giving the shading hit point, not the object location, but world space is huge, so unless you either use a mapping node or math nodes to normalize to the size you want, you will see in the viewport probably only one colour per quadrant on small objects as the difference in colours is too small to be seen in the low dynamic range. Thus his suggestion of an .exr which you can tone map after rendering.
Docs here: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More
suggest that node:Geometry -> Position returns the position of the shading point in world space, which is I think what you want, but upon experimentation, it only provides meaningful results in the quadrant where world coordinates are all positive.
Perhaps there is a way to do this with an OSL shader?