A suite of standardized data structure and pipeline for city data engineering
Project description
UDL (UrbanDataLayer) is a suite of standard data structure and pipeline for city data engineering, which processes city data from various raw data into a unified data format.
UDL is featured for:
- Unified standardized formats for city data: five data layers (grid, graph, point, polygon and linestring).
- User-friendly APIs of data processing: scheme transformation, granularity alignment and feature fusion.
Usage
- Install Python >= 3.8. For convenience, execute the following command.
pip install udlayer
- Construct a UDL layer data. The full layer data formats and data processing APIs are available in the documentation.
# Example: Construct a polygon layer data from a geojson file
from udlayer.layer.polygonlayer import PolygonLayer
polygonlayer = PolygonLayer("Vermont", "sample_Vermont.geojson", year=2014, column_list=['tag'])
print(polygonlayer.data)
# Example: Transform a tiff file to a grid layer data
from udlayer.transformation.transformation import *
from udlayer.alignment.alignment import *
from udlayer.utils.utility import *
griddata = tif_to_grid("pm2.5", ["Shanghai_pm2.5.tif"], start_lat=30.975, start_lon=121.1, end_lat=31.514, end_lon=121.804, year=2014)
print(griddata.data)
- Transform between different data layers.
# Example: Transform a polygon layer to a graph layer
from udlayer.transformation.transformation import *
with open('sample_Vermont.pickle', 'rb') as f:
polygon = pickle.load(f)
graph_data = polygon_to_graph(polygon)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
udlayer-0.2.3.tar.gz
(17.8 kB
view hashes)