# Chapter 2 — Practice Spatial Points Lines Polygons cont.

## Objectives for this part:

• Create new spatial objects (points, lines, polygons)
• Assign the correct projection or CRS
• Create points from a table or csv of lat and lon

## Creating GeoDataFrame Geometries

`# Import necessary modules firstimport pandas as pdimport geopandas as gpdfrom shapely.geometry import Point, LineString, Polygonimport fionaimport matplotlib.pyplot as pltplt.style.use('bmh') # better for plotting geometries vs general plots.`

First, create an empty `GeoDataFrame` and create a new column called geometry that will contain our Shapely objects:

`# Create an empty geopandas GeoDataFramenewdata = gpd.GeoDataFrame()print(newdata)`
`Empty GeoDataFrameColumns: []Index: []`

## GeoDataFrame Components

• data: a pandas.DataFrame, dictionary, or empty list [] containing an desired attribute data. Use [] if no data is
• crs: Coordinate Reference System of the geometry objects. Can be anything accepted by `pyproj.CRS.from_user_input()`, such as an authority string (eg “EPSG:4326”) or a WKT string.
• geometry: Column name in a DataFrame to use as geometry or Shapely point, line, or polygon object.

## Create Points from list of coordinates

Single point:

`# Coordinates of the GW department of geography in Decimal Degreescoordinate = [-77.04639494419096,  38.89934963421794]# Create a Shapely point from a coordinate pairpoint_coord = Point(coordinate)# create a dataframe with needed attributes and required geometry columndf = {'GWU': ['Dept Geography'], 'geometry': [point_coord]}# Convert shapely object to a geodataframe point = gpd.GeoDataFrame(df, geometry='geometry', crs ="EPSG:4326")# Let's see what we havepoint.plot()`

Multiple points:

`# list of attributes and coordinatesdf = pd.DataFrame(    {'City': ['Buenos Aires', 'Brasilia', 'Santiago'…`