def main():
    gtg = GeodesicLine2Gisfile()

    cd = gtg.gdlComp(lons_lats)

    gtg.gdlToGisFile(cd, folderpath, layername)
    gtg.gdlToGisFile(cd, folderpath, layername, fmt="GeoJSON")
Beispiel #2
0
    def __init__(self, coords, color, width, simplify=True):
        """
        Line that can be drawn in a static map

        :param coords: an iterable of lon-lat pairs, e.g. ((0.0, 0.0), (175.0, 0.0), (175.0, -85.1))
        :type coords: list
        :param color: color suitable for PIL / Pillow
        :type color: str
        :param width: width in pixel
        :type width: int
        :param simplify: whether to simplify coordinates, looks less shaky, default is true
        :type simplify: bool
        """
        
        # since GeodesicLine2Gisfile needs a flat list of coords
        # we need to unpack the given coords
        unpacked_coords = []
        for c in coords:
            unpacked_coords.append(c[0])
            unpacked_coords.append(c[1])

        gtg = GeodesicLine2Gisfile()
        self.coords = gtg.gdlComp(unpacked_coords, km_pts=DEFALUT_KM_PTS) 
        self.color = color
        self.width = width
        self.simplify = simplify
Beispiel #3
0
 def __getRoutesGeoms(self, coords_src_dst, folderpath, layername,
                      buildgeojson, props):
     """
     """
     gtg = GeodesicLine2Gisfile()
     gtg.gdlToGisFileMulti(coords_src_dst,
                           folderpath,
                           layername,
                           prop=props,
                           gjs=buildgeojson)
Beispiel #4
0
def main():

    gtg = GeodesicLine2Gisfile()
    props = [
        "prop01",
        "prop02",
        "prop03",
        "prop04",
        "prop05",
        "prop06",
        "prop07",
        "prop08",
    ]
    gtg.gdlToGisFileMulti(data, folderpath, layername, prop=props)
Beispiel #5
0
def main():

    gtg = GeodesicLine2Gisfile()
    props = ["prop01", "prop02"]
    gtg.gdlToGisFileMulti(coord_np, folderpath, layername, prop=props)
Beispiel #6
0
def main():

    gtg = GeodesicLine2Gisfile()

    gtg.gdlToGisFileMulti(data, folderpath, layername)
import matplotlib.colors
from fiona.transform import transform_geom
from fiona.crs import from_string
from functools import partial
import pyproj
from shapely.ops import transform
from shapely.geometry import Point, LineString
import pickle
from bulletin import Bulletin
import itertools
import pandas as pd
import xarray as xr
from tqdm import tqdm

from geodesiclinestogis.geodesicline2gisfile import GeodesicLine2Gisfile
line_builder = GeodesicLine2Gisfile(loglevel='ERROR')

colors = {'WARM': 1, 'COLD': 2, 'STNRY': 3, 'OCFNT': 4, 'TROF': 5}

with rasterio.open('example.grib') as example:
    crs = example.crs
    tf = example.transform
    width = example.width
    height = example.height
project = partial(
    pyproj.transform,
    pyproj.Proj(init='epsg:4326'),  # source coordinate system
    pyproj.Proj(crs))  # destination coordinate system
inf = open('data.bin', 'rb')
bulletins = pickle.load(inf)
data = []