예제 #1
0
    def test_reproject_point(self):
        shp_path = pf.get_shp("RADIO")
        lat, lon = -34.567277, -58.440509
        point = reproject_point(lat, lon, shp_path)
        reproj_coords = list(point.coords)[0]
        exp_reproj_coords = (1476458.5151069912, -2797102.116439601)

        self.assertAlmostEqual(reproj_coords[0], exp_reproj_coords[0])
        self.assertAlmostEqual(reproj_coords[1], exp_reproj_coords[1])
예제 #2
0
파일: test_geo_utils.py 프로젝트: SSTyT/tod
    def test_reproject_point(self):
        shp_path = pf.get_shp("RADIO")
        lat, lon = -34.567277, -58.440509
        point = reproject_point(lat, lon, shp_path)
        reproj_coords = list(point.coords)[0]
        exp_reproj_coords = (1476458.5151069912, -2797102.116439601)

        self.assertAlmostEqual(reproj_coords[0], exp_reproj_coords[0])
        self.assertAlmostEqual(reproj_coords[1], exp_reproj_coords[1])
예제 #3
0
파일: land_use.py 프로젝트: SSTyT/tod
def find_containing_shape(row, radios_dict, shp_path):
    lat = row["y"]
    lon = row["x"]
    comuna = int(row["comuna"])
    point = reproject_point(lon, lat, shp_path)

    for id_shape, shape in radios_dict[comuna].iteritems():
        if shape.contains(point):
            return id_shape

    return None
예제 #4
0
def find_containing_shape(row, radios_dict, shp_path):
    lat = row["y"]
    lon = row["x"]
    comuna = int(row["comuna"])
    point = reproject_point(lon, lat, shp_path)

    for id_shape, shape in radios_dict[comuna].iteritems():
        if shape.contains(point):
            return id_shape

    return None
예제 #5
0
파일: land_prices.py 프로젝트: yghlc/tod
def find_id_intersecting_shape(lat, lon, shapes, shp_path):
    """Return id of shape containing the lat-lon point."""
    point = reproject_point(lon, lat, shp_path)

    # for id_shp, shp in find_intersections(point.buffer(0.1), shapes,
    # shp_idx):
    for id_shp, shp in shapes:
        if shp.contains(point):
            # print(lat, lon, "is", id_shp)
            return id_shp

    return None
예제 #6
0
파일: land_prices.py 프로젝트: SSTyT/tod
def find_id_intersecting_shape(lat, lon, shapes, shp_path):
    """Return id of shape containing the lat-lon point."""
    point = reproject_point(lon, lat, shp_path)

    # for id_shp, shp in find_intersections(point.buffer(0.1), shapes,
    # shp_idx):
    for id_shp, shp in shapes:
        if shp.contains(point):
            # print(lat, lon, "is", id_shp)
            return id_shp

    return None