no rivers) return polygons_to_traces ( poly_paths, N_poly ) # Function generating country lon/lat traces def get_country_traces (): poly_paths = m. get_paths () # coastline polygon paths N_poly = 91 # use only the 91st biggest coastlines (i.e. append ( make_scatter ( lon_cc, lat_cc )) return traces # Function generating coastline lon/lat traces def get_coastline_traces (): poly_paths = m. iter_segments ( simplify = False )] ) # convert coordinates to lon/lat by 'inverting' the Basemap projection lon_cc, lat_cc = m ( coords_cc, coords_cc, inverse = True ) # add plot.ly plotting options traces. array (, vertex ) for ( vertex, code ) in poly_path. plotting list for i_poly in range ( N_poly ): poly_path = poly_paths # get the Basemap coordinates of each segment coords_cc = np. ![]() (N_poly): number of polygon to convert ''' traces = # init. (poly_paths): paths to polygons pos arg 2. Unfortunately we will have to use a little workaround to be able to use that API to access our Penn State enterprise accounts on ArcGIS Online. ![]() # Make shortcut to Basemap object, # not specifying projection type for this example m = Basemap () # Make trace-generating function (return a Scatter object) def make_scatter ( x, y ): return Scatter ( x = x, y = y, mode = 'lines', line = Line ( color = "black" ), name = ' ' # no name on hover ) # Functions converting coastline/country polygons to lon/lat traces def polygons_to_traces ( poly_paths, N_poly ): ''' pos arg 1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |