readShapefile

Reads a Shapefile file into a GeoDataFrame.

Each row in the resulting GeoDataFrame corresponds to a single feature from the shapefile:

  • Geometry is stored in the geometry column.

  • Attribute data from the .dbf file is stored in separate columns.

  • CRS is read from the .prj file if present, otherwise set to null.

Supported input formats:

  • Path to a .shp file.

  • Path to a .shp.gz file.

  • Path to a directory containing a shapefile with the same name as the directory (expects <dir>/<dir>.shp).

Requires .shx and .dbf files with the same name to be present in the same directory as the .shp file.

Examples:

GeoDataFrame.readShapefile("simple_points")
// Do the same
GeoDataFrame.readShapefile("simple_points/simple_points.shp")

Return

a new GeoDataFrame with the data from the Shapefile

Parameters

path

path to a Shapefile (*.shp or *.shp.gz file), or to a directory containing such a file


Reads a Shapefile file into a GeoDataFrame.

Each row in the resulting GeoDataFrame corresponds to a single feature from the shapefile:

  • Geometry is stored in the geometry column.

  • Attribute data from the .dbf file is stored in separate columns.

  • CRS is read from the .prj file if present, otherwise set to null.

Supported input formats:

  • Path to a .shp file.

  • Path to a .shp.gz file.

  • Path to a directory containing a shapefile with the same name as the directory (expects <dir>/<dir>.shp).

Requires .shx and .dbf files with the same name to be present in the same directory as the .shp file.

Return

a new GeoDataFrame with the data from the Shapefile

Parameters

url

URL of a Shapefile (*.shp or *.shp.gz file) or of a directory containing such a file


Reads a Shapefile file into a GeoDataFrame.

Each row in the resulting GeoDataFrame corresponds to a single feature from the shapefile:

  • Geometry is stored in the geometry column.

  • Attribute data from the .dbf file is stored in separate columns.

  • CRS is read from the .prj file if present, otherwise set to null.

Supported input formats:

  • Path to a .shp file.

  • Path to a .shp.gz file.

  • Path to a directory containing a shapefile with the same name as the directory (expects <dir>/<dir>.shp).

Requires .shx and .dbf files with the same name to be present in the same directory as the .shp file.

Examples:

DataFrame.readShapefile("simple_points")
// Do the same
DataFrame.readShapefile("simple_points/simple_points.shp")

Return

a new GeoDataFrame with the data from the Shapefile

Parameters

path

path to a Shapefile (*.shp or *.shp.gz file), or to a directory containing such a file