# Part 2 - Working with Geometries¶

## Creating geometries¶

The `arcgis.geometry`

module defines geometry types for working with geographic features in a GIS. It provides functions which use geometric types as input and output as well as functions for easily converting geometries between different representations.

Several functions in this module accept geometries represented as Python dictionary objects. To get started, we import the following classes and functions from the `geometry`

module.

```
from arcgis.gis import GIS
from arcgis.geocoding import geocode
from arcgis.geometry import lengths, areas_and_lengths, project
from arcgis.geometry import Point, Polyline, Polygon, Geometry
```

```
gis = GIS('home')
```

### Creating `Point`

objects¶

A point contains x and y fields along with a `spatialReference`

field. A point can also contain m and z fields as well, representing the vertical and linear referencing system coordinates. A point is empty when its x field is present and has the value null or the string `NaN`

. An empty point has no location in space.

```
pt = Point({"x" : -118.15, "y" : 33.80,
"spatialReference" : {"wkid" : 4326}})
pt
```

As shown above, you can create a `Point`

geometry using a dictionary. The `x`

and `y`

key value pairs in this example contain longitude and latitude respectively. The `spatialReference`

dictionary with the `wkid`

kvp specifies the coordinate system in which `x`

and `y`

are in. Thus, you could have passed it X and Y values from a projected coordinate system and constructed the same point by specifying the appropriate `wkid`

.

When using the Jupyter Notebook (or ArcGIS Notebook) interface, you can query a geometry and get a visual representation as shown in the cell earlier. Alternately you can check the validity of a geometry by querying the `is_valid()`

method.

```
pt.is_valid()
```

```
print(pt.is_empty)
```

To get the geometry type, use the `type`

property:

```
print(pt.type)
```

To get the object type in Python, use the built-in `type`

function:

```
type(pt)
```

```
map0 = gis.map("Port of Long Beach")
map0.basemap = "satellite"
map0.zoom = 6
map0
```