Skip to content

Commit

Permalink
Fix for bug where displacmentts accumulated for longitude. (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-i-berry authored Feb 6, 2024
1 parent dcf9bbf commit 90b560b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions bufr2geojson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def get_location(self) -> Union[dict, None]:
LOGGER.warning("longitude set to None")
longitude = None
else:
longitude = self.qualifiers["06"]["longitude"]
longitude = deepcopy(self.qualifiers["06"]["longitude"])

if longitude is not None:
# check if we need to add a displacement
Expand All @@ -292,7 +292,7 @@ def get_location(self) -> Union[dict, None]:

# now station elevation
if "height_of_station_ground_above_mean_sea_level" in self.qualifiers["07"]: # noqa
elevation = self.qualifiers["07"]["height_of_station_ground_above_mean_sea_level"] # noqa
elevation = deepcopy(self.qualifiers["07"]["height_of_station_ground_above_mean_sea_level"]) # noqa
elevation = round(elevation["value"], elevation["attributes"]["scale"]) # noqa
else:
elevation = None
Expand All @@ -313,7 +313,6 @@ def get_location(self) -> Union[dict, None]:
if None in location:
LOGGER.debug('geometry contains null values; setting to None')
return None

return {
"type": "Point",
"coordinates": location
Expand Down

0 comments on commit 90b560b

Please sign in to comment.