# Geometry Visualization and Information

## Visualizing geometries

To visualize a geometry, add it to the map. For example:

### Code Editor (JavaScript)

```// Create a geodesic polygon.
var polygon = ee.Geometry.Polygon([
[[-5, 40], [65, 40], [65, 60], [-5, 60], [-5, 60]]
]);

// Create a planar polygon.
var planarPolygon = ee.Geometry(polygon, null, false);

// Display the polygons by adding them to the map.
Map.centerObject(polygon);

For more on visualizing, see Feature and FeatureCollection Visualization.

To view information about a geometry, print it. To access the information programmatically, Earth Engine provides several methods. For example, to get information about the polygon created previously, use:

### Code Editor (JavaScript)

```print('Polygon printout: ', polygon);

// Print polygon area in square kilometers.
print('Polygon area: ', polygon.area().divide(1000 * 1000));

// Print polygon perimeter length in kilometers.
print('Polygon perimeter: ', polygon.perimeter().divide(1000));

// Print the geometry as a GeoJSON string.
print('Polygon GeoJSON: ', polygon.toGeoJSONString());

// Print the GeoJSON 'type'.
print('Geometry type: ', polygon.type());

// Print the coordinates as lists.
print('Polygon coordinates: ', polygon.coordinates());

// Print whether the geometry is geodesic.
print('Geodesic? ', polygon.geodesic());```

Observe that the perimeter (or length) of a geometry is returned in meters and the area is returned in square meters unless a projection is specified. By default, the computation is performed on the WGS84 spheroid and the result is computed in meters or square meters.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]