thinkingmachines / geomancer

Automated feature engineering for geospatial data
MIT License
216 stars 16 forks source link

Add support for road feature extraction #57

Closed issa-tingzon closed 5 years ago

issa-tingzon commented 5 years ago

Five types of roads: (1) primary, (2) trunk, (3) paved, (4) unpaved, and (5) intersection.

For each lat-lng and specified radius or bounding box, extract the following features:

ljvmiranda921 commented 5 years ago

@ibtingzon Possible via DistanceToNearest, NumberOf and LengthOf spells

If you want to get the distance to the nearest primary road:

# df is a pandas.DataFrame of points
# feature_name is arbitrary
DistanceToNearest("primary", # should be a valid OSM fclass
                   within=10*1000, # within 10-kilometers
                   source_table="tm-geospatial.ph_osm.gis_osm_roads_free_1",
                   feature_name="dist_primary").cast(df, dburl="bigquery://tm-geospatial")

# The spell above returns a pandas.Dataframe with a column `dist_primary`

For more info, please check documentation

~Not yet possible for a BoundingBox input though.~

ljvmiranda921 commented 5 years ago

Oops I closed it. @ibtingzon please close the issue if it matches your use-case :)