GithubHelp home page GithubHelp logo

fabric-io-rodrigues / geotiffcog Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 2.0 3.94 MB

Open Cloud Optimized GeoTiffs in C# Console Library

License: MIT License

C# 96.96% QML 3.04%
geotiff csharp latitude-and-longitude cog cloud-optimized-geotiff elevation xy libtiff-library

geotiffcog's Introduction

GeoTiffCOG

Open Cloud Optimized GeoTiffs in C# Console Library

After researching some solutions, mostly in Python or using GDAL (QGis/ArcGis) I worked to build this first working version.

The idea is to access GeoTiff (local or COG) and return the corresponding value given a latitude/longitude.

      GeoTiff geoTiff = new GeoTiff(new Uri(url), directoryTemp);

      double value = geoTiff.GetElevationAtLatLon(latitude, longitude);

As an example, url_COG + expected result. This same Tiff is in the Sample directory, it can be accessed locally.

 https://globalwindatlas.info/api/gis/country/SLV/wind-speed/50 
 
 Latitude::  13.88427 
 Longitude:  -89.42231
 Value:    3.6284714
 
 Latitude:   13.59475;
 Longitude: -88.84668;
 Value:    8.6823205947876

Map of El Salvador - Wind Data 50m

Support crop area function:

 //Sample:
 Bottom-Left: 14.004, -89.572
 Upper-Right: 14.221, -89.227

SLV_wind-speed_50m_crop

Some project details: I used some best practices from the DEM.Net lib and as a base (used as reference) the BitMiracle/libtiff.net lib.

Feel free to download, modify and suggest changes (such as pull request).

License

Copyright © 2022 Fabricio Rodrigues Released under the MIT license.


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.