Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix - corrected lat long in station csv url epa #211

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions basin3d/plugins/epa.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def _get_location_info_csv(loc_type: str, loc_list: list, synthesis_messages: li
properties_provider = row_dict.get(FIELD_NAMES['provider'][api_version])

loc_info.append({
'geometry': {'type': 'Point', 'coordinates': [geometry_coord_lat, geometry_coord_long]},
'geometry': {'type': 'Point', 'coordinates': [geometry_coord_long, geometry_coord_lat]},
'properties': {'name': properties_name, 'locName': properties_loc_name,
'huc8': properties_huc8, 'orgName': properties_org_name,
'provider': properties_provider}})
Expand Down Expand Up @@ -309,7 +309,7 @@ def _make_monitoring_feature_object(plugin_access: DataSourcePluginAccess, loc_i
feature_type=FeatureTypeEnum.POINT,
shape=SpatialSamplingShapes.SHAPE_POINT)

coord: list = loc_geometry.get('coordinates')
coord: list = loc_geometry.get('coordinates') # type: ignore
if coord:
monitoring_feature.coordinates = Coordinate(
absolute=AbsoluteCoordinate(horizontal_position=GeographicCoordinate(
Expand Down
12 changes: 8 additions & 4 deletions tests/test_plugins_epa.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,10 @@ def get_csv_dict(dummyvar):
for mf in monitoring_features:
count += 1
print(f"{mf.id} ({mf.feature_type}) {mf.description} {mf.coordinates and [(p.x, p.y) for p in mf.coordinates.absolute.horizontal_position]}")
if 'feature_type' in query:
assert mf.feature_type == query['feature_type'].upper()
if mf.id == 'EPA-21COL001_WQX-10124E':
print('******** CHECK EPA-21COL001_WQX-10124E')
assert mf.coordinates.absolute.horizontal_position[0].x == -106.9859090000
assert mf.coordinates.absolute.horizontal_position[0].y == 38.8709750000

print(query.values(), "count:", count, "expected:", expected_count)

Expand Down Expand Up @@ -186,8 +188,10 @@ def get_csv_dict(dummyvar):
for mf in monitoring_features:
count += 1
print(f"{mf.id} ({mf.feature_type}) {mf.description} {mf.coordinates and [(p.x, p.y) for p in mf.coordinates.absolute.horizontal_position]}")
if 'feature_type' in query:
assert mf.feature_type == query['feature_type'].upper()
if mf.id == 'EPA-21COL001_WQX-10124E':
print('******** CHECK EPA-21COL001_WQX-10124E')
assert mf.coordinates.absolute.horizontal_position[0].x == -106.9859090000
assert mf.coordinates.absolute.horizontal_position[0].y == 38.8709750000

print(query.values(), "count:", count, "expected:", expected_count)

Expand Down