cc2c3376832df749fc386f31621eff0b9babc1ea,osmnx/pois.py,,create_poi_gdf,#Any#Any#Any#Any#Any#Any#Any#,130

Before Change


                pois[result["id"]] = poi

            except Exception:
                log("Point has invalid geometry: {}".format(result["id"]))

        elif result["type"] == "relation":
            // TODO: Add functionalities to parse "relation" tags.
            pass

After Change


    poi_ways = {}

    // A list of POI relations
    relations = []

    for result in responses["elements"]:
        if result["type"] == "node" and "tags" in result:
            poi = parse_osm_node(response=result)
            pois[result["id"]] = poi
        elif result["type"] == "way":
            // Parse POI area Polygon
            poi_area = parse_osm_way(vertices=vertices, response=result)
            if poi_area:
                poi_ways[result["id"]] = poi_area
        elif result["type"] == "relation":
            // Add relation to a relation list (needs to be parsed after all nodes and ways have been parsed)
            relations.append(result)

    // Create GeoDataFrames
    gdf_nodes = gpd.GeoDataFrame(pois).T
    gdf_nodes.crs = {"init": "epsg:4326"}

    gdf_ways = gpd.GeoDataFrame(poi_ways).T
    gdf_ways.crs = {"init": "epsg:4326"}

    // Parse relations (MultiPolygons) from "ways"
    gdf_ways = parse_osm_relations(relations=relations, osm_way_df=gdf_ways)

    return (gdf_nodes, gdf_ways)

def pois_from_point(point, distance=None, amenities=None, retain_invalid=False):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: gboeing/osmnx
Commit Name: cc2c3376832df749fc386f31621eff0b9babc1ea
Time: 2018-05-03
Author: henrikki.tenkanen@helsinki.fi
File Name: osmnx/pois.py
Class Name:
Method Name: create_poi_gdf


Project Name: geomstats/geomstats
Commit Name: a0b3c07b0dbefdcf2b2534d0b6eec49f23e79aa8
Time: 2020-09-22
Author: alice.le-brigant@enac.fr
File Name: examples/plot_square_h2_poincare_half_plane.py
Class Name:
Method Name: main


Project Name: deepchem/deepchem
Commit Name: 1c07a01ae1268ca316981cf6be9a826e4691b5e4
Time: 2018-08-14
Author: peastman@stanford.edu
File Name: deepchem/feat/rdkit_grid_featurizer.py
Class Name: RdkitGridFeaturizer
Method Name: featurize_complexes


Project Name: gboeing/osmnx
Commit Name: d66cfb74ac8c3b55f9728b57230387466e69e7d1
Time: 2017-12-25
Author: henrikki.tenkanen@helsinki.fi
File Name: osmnx/pois.py
Class Name:
Method Name: create_poi_gdf