Code Monkey home page Code Monkey logo

goose-lab's Introduction

goose-lab

Recipes for geospatial data processing in Python.

Efficiently generate the bounding coordinates (xmin, ymin, xmax, ymax) of a 2d regular grid in numpy. This array can be easily converted into shapely or pygeos geometries.

Intersect points with rectangles from a regular grid without a spatial index (using only NumPy). Useful for processing rasters larger than memory through reading windows or creating database indexes.

  • The dataset is the European Digital Elevation Model (EU-DEM), version 1.1 from European Union's Copernicus Programme.

  • The format is Raster data (geotiff), divided into 1000x1000km tiles, 25m resolution, accuracy of ~7m RMSE.

  • The only dependencies of this script are Numpy, Pandas, Pyproj and Rasterio.

  • The process was designed to minimize memory consumption. Tiles or chunks of the rasters are read sequentially from storage.

  • Input coordinates are assumed to be in WGS84 (latitude and longitude).

  • A distributed version of this script can be easily created with Dask for Big Data use cases.

Basic usage example:

  1. Download the raster tiles from Copernicus website.

  1. Instantiate the object CopernicusDEM with the geotiff file paths and call the get_elevation method over a Pandas dataframe with latitude and longitude columns.
airports = pd.DataFrame([['LPPT', 38.775600, -9.135400],
                         ['LPPR', 41.242100, -8.678600],
                         ['LPFR', 37.017600, -7.969700],
                         ['LPBJ', 38.063700, -7.939200]], columns=['ICAO', 'Latitude', 'Longitude'])
                         
copernicus = CopernicusDEM(raster_paths=['eu_dem_v11_E20N10.TIF', 'eu_dem_v11_E20N20.TIF'])

airports = copernicus.get_elevation(airports, lat_col='Latitude', lon_col='Longitude')

print(airports)

image

goose-lab's People

Contributors

carlosg-m avatar

Stargazers

 avatar

Watchers

 avatar

goose-lab's Issues

How to retroject to 'epsg:28992' instead of WSG84

I am using the code to create altitude contours in NL. I would like to reproject to 'epsg:28992'. I can't seem to find where you reproject to WGS84 (so I would be able to insert a different reprojection there). I am not the greatest python programmer so may misunderstand your code.

Thanks,
Maarten Kool

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.