Skip to content

Commit

Permalink
fix geometry and URL handling
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Jan 9, 2024
1 parent 02b0ece commit 461cd03
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pywis_pubsub/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def create_message(topic: str, content_type: str, url: str, identifier: str,
:inline: `bool` of whether to publish the data inline as base64
(default False)
:geometry: point array defining longitude,latitude,elevation
(elevation is optional
(elevation is optional)
:metadata_id: `str` of WCMP2 metadata record identifier
:wigos_station_identifier: `str` of WSI for station as used in OSCAR
:operation: `str` of message operation
Expand All @@ -125,10 +125,9 @@ def create_message(topic: str, content_type: str, url: str, identifier: str,
file_info = get_file_info(url)

if geometry:
point = [float(i) for i in geometry.split(',')]
geometry2 = {
'type': 'Point',
'coordinates': point
'coordinates': geometry
}
else:
geometry2 = None
Expand Down Expand Up @@ -162,7 +161,7 @@ def create_message(topic: str, content_type: str, url: str, identifier: str,
}]
}

if operation != 'canonical':
if operation != 'create':
message['links'].append({
'rel': LINK_TYPES[operation],
'type': content_type2,
Expand Down

0 comments on commit 461cd03

Please sign in to comment.