starepandas.STAREDataFrame.split_antimeridian#
- STAREDataFrame.split_antimeridian(inplace=False, drop=False)#
Splits trixels at the antimeridian
This works on trixels that cross the meridian and whose longitudes have not been wrapped around the antimeridian. I.e. when creating the trixels use sdf.make_trixels(wrap_lon=False)
Examples
>>> cities = {'name': ['midway', 'Fiji', 'Baker', 'honolulu'], ... 'lat': [28.2, -17.8, 0.2, 21.3282956], ... 'lon': [-177.35, 178.1, -176.7, -157.9]} >>> sdf = starepandas.STAREDataFrame(cities) >>> sids = starepandas.sids_from_xy(sdf.lon, sdf.lat, level=1) >>> sdf.set_sids(sids, inplace=True) >>> trixels = sdf.make_trixels(wrap_lon=False) >>> sdf.set_trixels(trixels, inplace=True) >>> cites_split = sdf.split_antimeridian(inplace=False) >>> max(max(cites_split.trixels[1].geoms[0].exterior.xy)) 180.0