# How do I represent the whole Earth as a Polygon?

This is related to determining the interior of a Polygon.

My difficulty is that if I specify a Polygon covering the Earth going from East to West, it will still have a boundary along the antemeridian, which would show up in azimuthal projections. For example, in GeoJSON:

``````{
"type": "Polygon",
"coordinates": [
[[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]]
]
}
``````

Is there a standard way to specify a whole-sphere Polygon, with no boundary?

I've thought about using an empty exterior ring:

``````{
"type": "Polygon",
"coordinates": [
[]
]
}
``````

The logic being that I could specify further rings as holes to be punched into the whole-sphere Polygon.

Unfortunately, GeoJSON stipulates that LinearRings must have at least 4 points, so this would be straying from the specification. However, I'm still interested in understanding whether this approach is taken anywhere else.

-
In part the answer has to depend on the GIS. However, you're in trouble at the very outset: if the polygon has no boundary, then--without specifying additional information not present in the linestring--there is no way for the software to distinguish the entire sphere from the empty set. (Empty polygons have important uses, even though many GISes do not implement them or implement them incorrectly.) – whuber Dec 7 '12 at 20:03
Thanks. We decided to simply define our own object type "Sphere" to handle this situation, since an empty LineString would most intuitively represent the empty set. I think this is the best "answer" that you can really give to this question. – Jason Davies Dec 7 '12 at 20:10
I think you could generalize your solution, Jason, at little cost and with some benefit. Since you're dedicating one bit to distinguish the empty set from the sphere, why not use that bit with every polygon to indicate its orientation? For nondegenerate polygons, it would indicate whether the inside of the polygon should be considered to be to the right or to the left while traversing its boundary. For degenerate polygons, it would indicate whether the boundary coincides with the polygon or the complement is intended. Now you always know where the inside is. – whuber Dec 7 '12 at 20:16
Good idea! In general we want to accept standard GeoJSON as input, though. The Sphere object is a bit of a special case, so we don't mind defining our own type, since it will hardly be used. For Polygons, we have decided to adopt an ordering convention (right-hand rule to be consistent with the ESRI spec.) – Jason Davies Dec 7 '12 at 21:18

Since there doesn't seem to be a standard way to represent this somewhat rare situation of a polygon with no boundary covering the whole Earth, we decided to add our own `{type: "Sphere"}`, which has worked remarkably well for our purposes.