geo_functions module¶
-
geo_functions.blocksFromMarker_ids(closeMarkers, client)¶ Find that blocks that contain the given marker_ids.
Parameters: - closeMarkers – List of marker_ids.
- client (pymongo.mongo_client.MongoClient) – The pymongo MongoClient instance.
Returns: DataFrame – the close blocks in a Pandas DataFrame.
Raises: ValueError
-
geo_functions.findBlockCoordinates(block_df, client)¶ Return the space marker ids, their coordinates, and block information for markers within the given blocks.
Parameters: - block_df (DataFrame) – The close blocks in a Pandas DataFrame.
- client (pymongo.mongo_client.MongoClient) – The pymongo MongoClient instance.
Returns: list – a list of Dicts that have all the plotting information for the spaces.
Raises: ValueError
-
geo_functions.findCloseBlocks(point, meters, client)¶ Find the blocks in the parking database that are within a given radius to a set of coordinates.
Parameters: - point (list) – The coordinates of the point.
- meters (int) – The radius to search within in meters.
- client (pymongo.mongo_client.MongoClient) – The pymongo MongoClient instance.
Returns: DataFrame – the close blocks in a Pandas DataFrame.
Raises: ValueError
-
geo_functions.findCloseMarker_ids(point, meters, client)¶ Find the marker_ids for spaces within the radius of the supplied coordinates with a GeoQuery.
Parameters: - point (list) – The coordinates of the point.
- meters (int) – The radius to search within in meters.
- client (pymongo.mongo_client.MongoClient) – The pymongo MongoClient instance.
Returns: list – the close marker_ids in a list.
Raises: ValueError, TypeError
-
geo_functions.findCoordsFromMarker_Ids(marker_ids, client)¶ Returns a DataFrame of marker_ids, coordinates, and desctiptions from the bayData collection.
Parameters: - marker_ids (list) – marker_ids of interest.
- client (pymongo.mongo_client.MongoClient) – The pymongo MongoClient instance.
Returns: DataFrame – a DataFrame with marker_id, coordinates, and descriptions.
Raises: TypeError
-
geo_functions.format_blocksWithAllMarkers(blocksWithAllMarkers)¶ Returns a dict of with the block information, and coordinate geometry in GeoJSON style.
Parameters: blocksWithAllMarkers (DataFrame) – blocks, marker_ids, marker_id descriptions, and coordinates. Returns: dict – a dict of with the block information, and coordinate geometry in GeoJSON style. Raises: ValueError
-
geo_functions.format_closeBlocksCur(closeBlocksCur)¶ Returns a DataFrame of the block information from a cursor assoicated with Mongo query of marker_ids.
Parameters: closeBlocksCur (Mongo Cursor) – blocks, marker_ids, marker_id descriptions, and coordinates. Returns: DataFrame – a DataFrame of the block information.
-
geo_functions.geocode_address(locationQuery)¶ Lookup user inputted text with a Geolocation service. Return the clean address and coordinates.
Parameters: locationQuery (str) – The address entered by the user. Returns: dict – the cleaned address and coordinates in a dict. Raises: ValueError
-
geo_functions.getBlockAvailability(features, time, client)¶ Find the predicted availablity for each block and append the information to the list of blocks.
Parameters: - features (list) – A list of Dicts that have all the plotting information for the spaces.
- time (str) – The time entered by the user.
- client (pymongo.mongo_client.MongoClient) – The pymongo MongoClient instance.
Returns: list – a list of Dicts that have all the plotting information for the spaces as well as the predictions.
-
geo_functions.marker_idsFromBlocks(block_df, client)¶ Appends a column of all the marker_ids to a DataFrame of block identifiers.
Parameters: - block_df (DataFrame) – The close blocks in a Pandas DataFrame.
- client (pymongo.mongo_client.MongoClient) – The pymongo MongoClient instance.
Returns: DataFrame – all of the blocks and the marker_ids assiated with them.
Raises: ValueError