Parcel Fetching#

Retrieve building parcels from various sources.

shift.parcels_from_geodataframe(geo_df: GeoDataFrame) list[ParcelModel]#

Function to convert geopandas dataframe to list of parcel models.

Parameters:

geo_df (GeoDataFrame) – Geo dataframe.

Returns:

list[ParcelModel]

shift.parcels_from_location(location: str | ~shift.data_model.GeoLocation | list[~shift.data_model.GeoLocation], max_distance: ~infrasys.quantities.Distance = <Quantity(500, 'meter')>) list[ParcelModel] | None#

Function to return parcels for a given location.

Note max_distance is not used if location type is Polygon. For a location of type str and GeoLocation, a polygon is created by forming a sqaure bounding box using max distance. We use osmnx package to fetch these buildings.

Parameters:
  • location (str | GeoLocation | Polygon) – Location for which openstreet parcels are to be fetched.

  • max_distance (Distance) – Maximum distance to form a bounding box within which buildings are fetched.

Returns:

List of ParcelModel.

Return type:

list[ParcelModel]

Examples

>>> from shift.parcel.openstreet import get_parcels
>>> from infrasys.quantities import Distance
>>> get_parcels("Fort Worth, Texas", Distance(100, "m"))
shift.parcels_from_csv(file_path: Path)#

Function to load parcels from csv.

Note, this function uses geopandas to construct geo dataframe which requires that you have at least a column named geometry in your file.

Parameters:

file_path (Path to csv file with geometries.)