Skip to content

Commit

Permalink
Removed obsolete test.py file; updated projections.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik-Geo committed Mar 7, 2024
1 parent e24a19a commit 1071c08
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 23 deletions.
4 changes: 2 additions & 2 deletions geost/bro/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def __response_to_bbox(
epsg: str = "28992",
object_type: str = "CPT",
):
xmin_ll, ymin_ll = xy_to_ll(xmin, ymin, epsg)
xmax_ll, ymax_ll = xy_to_ll(xmax, ymax, epsg)
ymin_ll, xmin_ll = xy_to_ll(xmin, ymin, epsg)
ymax_ll, xmax_ll = xy_to_ll(xmax, ymax, epsg)
criteria = get_bbox_criteria(xmin_ll, xmax_ll, ymin_ll, ymax_ll)
api_url = self.server_url + self.apis[object_type] + self.search_url
response = self.session.post(api_url, json=criteria)
Expand Down
14 changes: 2 additions & 12 deletions geost/projections.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,5 @@ def get_transformer(epsg_from, epsg_to):

def xy_to_ll(x, y, epsg):
t = get_transformer(epsg, 4326)
transformed = list(t.itransform([(x, y)]))
return transformed[0][1], transformed[0][0]


def get_coors(xy_gen):
x = []
y = []
xy = list(xy_gen)
for coor in xy:
x.append(coor[0])
y.append(coor[1])
return x, y
transformed = t.transform(x, y)
return transformed
8 changes: 0 additions & 8 deletions geost/test.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_projections.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ def test_get_transformer(self):

@pytest.mark.unittest
def test_xy_to_ll(self):
lon_dec, lat_dec = projections.xy_to_ll(141000, 455000, 28992)
lat_dec, lon_dec = projections.xy_to_ll(141000, 455000, 28992)
assert_almost_equal(lon_dec, 5.182956740521864)
assert_almost_equal(lat_dec, 52.083091710433095)

0 comments on commit 1071c08

Please sign in to comment.