Category : Python

If you have grid or point data and polygon shapefiles for longitude and longitude. Using geopandas and shapely it’s easy to find grids or points in specific polygons. import geopandas as gpd import pandas as pd import numpy as np import matplotlib.pyplot as plt from shapely.geometry import Point # US state polygon shape file US_states=gpd.GeoDataFrame.from_file(‘states_province_shapefile\cb_2018_us_state_20m\cb_2018_us_state_20m.shp’) ..

Read more

My example of Python code for mapping variables overlay with geographic information. Elements in the map include ocean, coastline,borders,lakes,rivers,province borders, contour, contourf, pcolormesh, scatter, labels, province (or state) names. Also includes information about how to set cmap, what range of the data (minimum, maximum) to show, how many levels to display the data. How to ..

Read more

conda create –name pygdal conda activate pygdal conda install -c conda-forge gdal #from osgeo import gdal #to make jupyter server work pip install –upgrade jupyterhub pip install –upgrade nbconvert conda install -c conda-forge notebook conda install -c conda-forge jupyter_contrib_nbextensions # install cartopy conda install -c conda-forge cartopy #install rasterio for reading tiff file conda install ..

Read more