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

Before Change


    for result in responses["elements"]:
        if result["type"] == "node" and "tags" in result:
            try:
                point = Point(result["lon"], result["lat"])

                poi = {
                    "osmid": result["id"],
                    "geometry": point
                }
                if "tags" in result:
                    for tag in result["tags"]:
                        poi[tag] = result["tags"][tag]
                pois[result["id"]] = poi

After Change


    pois = {}

    // POI ways
    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: 3

Non-data size: 7

Instances


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


Project Name: gboeing/osmnx
Commit Name: b43ab325ce3e9b4f6b39af7a0f4b8338578bb89a
Time: 2021-03-16
Author: boeing@usc.edu
File Name: osmnx/distance.py
Class Name:
Method Name: get_nearest_edge


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