shapefile
Need the path for particular files using os.walk() [duplicate]
os.walk gives you the path to the directory as the first value in the loop, just use os.path.join() to create full filename: shpfiles = [] for dirpath, subdirs, files in os.walk(path): for x in files: if x.endswith(“.shp”): shpfiles.append(os.path.join(dirpath, x)) I renamed path in the loop to dirpath to not conflict with the path variable you … Read more
Check if a geopoint with latitude and longitude is within a shapefile
Another option is to use Shapely (a Python library based on GEOS, the engine for PostGIS) and Fiona (which is basically for reading/writing files): import fiona import shapely with fiona.open(“path/to/shapefile.shp”) as fiona_collection: # In this case, we’ll assume the shapefile only has one record/layer (e.g., the shapefile # is just for the borders of a … Read more
Different legends and fill colours for facetted ggplot?
Currently there can be only one scale per plot (for everything except x and y).