Some code samples for various purposes and languages
samples/R/OSM_GADM.R: This R script retrieves highway data from OpenStreetMap (OSM) for a specified country and administrative region, processes it, and exports the results as a CSV and optional PNG visualization. It begins by downloading administrative boundary data using thegeodatapackage, validates the selected region, and converts it into ansfobject. The script then queries OSM for highways within the region’s bounding box, extracts relevant road segments, and filters them to ensure they intersect with the actual administrative boundary. The final dataset includes road type, geometry in WKT format, and segment length, which is saved as a CSV. If enabled, a map of the road network is generated and saved as a PNG usingggplot2.samples/Python/ndvi: This project is designed for processing Earth observation data, specifically NDVI data from NASA's MODIS satellite. It provides functionality to retrieve, download, and process MODIS data stored in HDF format using theearthaccessAPI. Key features include extracting bounding box coordinates for geospatial regions, downloading MODIS data for a specified region and date range, constructing polygon geometries from grid coordinates, extracting metadata from HDF files, and cleaning numerical data arrays by applying scaling factors and handling missing values. The script leverages geospatial processing libraries (geopandas,shapely), numerical tools (numpy,pandas), and parallel computing (joblib) to efficiently handle large datasets.