Exemple #1
0
    def test_set_epsilon(self):
        import affine

        old_epsilon = affine.EPSILON

        try:
            affine.set_epsilon(123)
            assert_equal(123, affine.EPSILON)
            assert_equal(123 * 123, affine.EPSILON2)
        finally:
            affine.set_epsilon(old_epsilon)
Exemple #2
0
# Imports necessary Python libraries
import rasterio as rio
import fiona as fio
import copy
import affine
import click

# Allows for numerically small pixels (i.e. small georeferenced units)
affine.set_epsilon(1e-10)


def _cb_bidx(ctx, param, value):

    """
    Validates --bidx (band index) parameter
    """
    if value < 1:
        raise click.BadParameter("Band index must be >= 1")
    return value

# These decorators construct the command line interface
@click.command()
@click.argument("input_vector", required=True)
@click.argument("raster", required=True)
@click.argument("output_vector", required=True)
@click.option(
    "--bidx", type=click.INT, default=1, callback=_cb_bidx, show_default=True,
    help="Sample from this raster band."
)
@click.option(
    "--layer", help="Name of layer to process. If not specified, defaults to first."
Exemple #3
0
# Imports necessary Python libraries
import rasterio as rio
import fiona as fio
import copy
import affine
import click

# Allows for numerically small pixels (i.e. small georeferenced units)
affine.set_epsilon(1e-10)


def _cb_bidx(ctx, param, value):
    """
    Validates --bidx (band index) parameter
    """
    if value < 1:
        raise click.BadParameter("Band index must be >= 1")
    return value


# These decorators construct the command line interface
@click.command()
@click.argument("input_vector", required=True)
@click.argument("raster", required=True)
@click.argument("output_vector", required=True)
@click.option("--bidx",
              type=click.INT,
              default=1,
              callback=_cb_bidx,
              show_default=True,
              help="Sample from this raster band.")
Exemple #4
0
"""

WorldEngine is used as the data layer for the threaded server. Retrieves and processes data stored in raster images.
Manages

"""
from __future__ import (absolute_import, division, print_function, unicode_literals)
import collections
import affine
affine.set_epsilon(1e-12)  # must set epsilon to small value to prevent sensitive trip of degenerate matrix detection
import rasterio
from builtins import *
from geographiclib.geodesic import Geodesic
from numpy import math
from tower.map.space import Space
from tower.map.graph import Graph

try:
    from osgeo import gdal
except ImportError:
    import osgeo.gdal as gdal

try:
    from osgeo import osr
except ImportError:
    import osgeo.gdal as osr


class ReadException(Exception):
    """