Skip to content

Prevent trailing spaces in ssc catalog #1185

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

Closed
veenstrajelmer opened this issue May 8, 2025 · 1 comment · Fixed by #1188
Closed

Prevent trailing spaces in ssc catalog #1185

veenstrajelmer opened this issue May 8, 2025 · 1 comment · Fixed by #1188

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented May 8, 2025

There are trailing spaces in the SSC catalogue:

import pandas as pd
from shapely import Point
import geopandas as gpd

url_json = 'https://www.ioc-sealevelmonitoring.org/ssc/service.php?format=json'
ssc_catalog_pd = pd.read_json(url_json)
geom = [Point(x["geo:lon"], x["geo:lat"]) for irow, x in ssc_catalog_pd.iterrows()]
ssc_catalog_gpd = gpd.GeoDataFrame(data=ssc_catalog_pd, geometry=geom, crs='EPSG:4326')
ssc_catalog_gpd = ssc_catalog_gpd.drop(["geo:lon","geo:lat"], axis=1)
name_endwithspace = ssc_catalog_gpd["name"].loc[ssc_catalog_gpd["name"].str.endswith(" ")]
print(name_endwithspace.tolist())

Gives:

['Barentsburg ', 'Brisbane ', 'Burnett Heads ', 'DART NOOSS Optimization Buoy  ', 'Dzaoudzi ', 'Fort Dauphin ', 'Funchal ', 'Ginostra ', 'Guam ', 'Hafun ', 'Hienghene ', 'Hiva Oa ', 'Huahine island ', 'Laohutan ', 'Martinez-Amorco Pier ', 'Mirny ', 'Nansha ', 'Nuku Hiva ', 'Nouméa - Numbo ', 'Penuelas ', 'Capitan Prat Base ', 'Qinglan ', 'Rangiroa Atoll ', 'Pointe des Galets ', 'Rikitea ', 'Salvador ', 'Santa Cruz del Flores ', 'Suez ', 'Tubuaï ', 'Port-Tudy ', 'Vairao ']

Requested to fix this in the json on 8-5-2025. If this is not feasible/needed, trim them in dfm_tools.

Also clean up the ssc catalog code slightly.

@veenstrajelmer veenstrajelmer changed the title Prevent trailing spaces in ssc table Prevent trailing spaces in ssc/uhslc catalog May 8, 2025
@veenstrajelmer
Copy link
Collaborator Author

Resolved on 9-5-2025 in the source json

@veenstrajelmer veenstrajelmer closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2025
@veenstrajelmer veenstrajelmer changed the title Prevent trailing spaces in ssc/uhslc catalog Prevent trailing spaces in ssc catalog May 9, 2025
@veenstrajelmer veenstrajelmer reopened this May 9, 2025
@veenstrajelmer veenstrajelmer linked a pull request May 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant