Code Monkey home page Code Monkey logo

sentinel_models's Introduction

Sentinel models

This library was created to create input data for Neural Network based on Satellite images data. First use was on setninel2 satellite images but it will also work for other data sources. Library is in beta version still, some of the functionality may not be available.

Requirements

Use cases

Class Raster

This class allows to load data from various formats. Currently available are:

  • Shapefile (shp)
  • Geotiff (geotiff)
  • PNG (png)
  • WKT (wkt)

  • When the shape file or any other geometry format is loaded, it is converted into raster based on coordinates, Array size depends on pixel size and extent size. It can be passed via extent and pixel in options method.

    Loading from wkt

    wkt = "Polygon((110.0 105.0, 110.0 120.0, 120.0 120.0, 120.0 110.0, 110.0 105.0))"
    raster = Raster\
                .read\
                .format("wkt")\
                .load(wkt)
    raster.show()

    Loading from Shape File

    shape_path = "/tests/data/shapes/domy.shp"
    
    GeometryFrame.from_file(shape_path).show()
    """
     -----------------------------------------------------------------------
    |      id     |     cls     |                 geometry                 |
    ------------------------------------------------------------------------
    |      1      |      4      |   POLYGON ((559610.9241914469 4929878.   |
    ------------------------------------------------------------------------
    |      1      |      5      |   POLYGON ((559649.5178541846 4929868.   |
    ------------------------------------------------------------------------
    |      1      |      5      |   POLYGON ((559678.1483190297 4929851.   |
    ------------------------------------------------------------------------
    |      1      |      2      |   POLYGON ((559648.8379760745 4929819.   |
    ------------------------------------------------------------------------
    |      1      |      4      |   POLYGON ((559587.8988370569 4929857.   |
    ------------------------------------------------------------------------
    """
    raster = Raster\
                .read\
                .format("shp")\
                .load(shape_path)
    raster.show()

    To get raster value based on shape file column, use color_column attribute in options

    raster = Raster\
                .read\
                .format("shp")\
                .options(
                    pixel=Pixel(0.5, 0.5),
                    color_column="cls"
                ).load(shape_path)
    raster.show()

    To get different values for all records pass

    raster = Raster\
                .read\
                .format("shp")\
                .options(
                    all_unique="True"
                ).load(shape_path)
    raster.show()

    sentinel_models's People

    Contributors

    imbruced avatar

    Watchers

    James Cloos avatar

    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.