Skip to content

Commit

Permalink
Merge pull request #655 from jbouffard/0.4.0-release
Browse files Browse the repository at this point in the history
0.4.0 Release
  • Loading branch information
Jacob Bouffard committed May 2, 2018
2 parents 1c87c11 + e11a709 commit b421d61
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ script:

before_deploy:
- export GEOPYSPARK_VERSION_SUFFIX="-${TRAVIS_COMMIT:0:7}"
- aws s3 rm s3://geopyspark-dependency-jars/geotrellis-backend-assembly-0.3.0.jar
- aws s3 rm s3://geopyspark-dependency-jars/geotrellis-backend-assembly-0.4.0.jar

deploy:
- provider: script
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst

JAR-PATH := geopyspark/jars

ASSEMBLYNAME := geotrellis-backend-assembly-0.3.0.jar
ASSEMBLYNAME := geotrellis-backend-assembly-0.4.0.jar
BUILD-ASSEMBLY := geopyspark-backend/geotrellis/target/scala-2.11/${ASSEMBLYNAME}
DIST-ASSEMBLY := ${JAR-PATH}/${ASSEMBLYNAME}

WHEELNAME := geopyspark-0.3.0-py3-none-any.whl
WHEELNAME := geopyspark-0.4.0-py3-none-any.whl
WHEEL := dist/${WHEELNAME}

SCALA_SRC := $(call rwildcard, geopyspark-backend/geotrellis/src/, *.scala)
Expand Down
136 changes: 136 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,142 @@ Changelog
==========


0.4.0
------

New Features
^^^^^^^^^^^^

Rasterizing an RDD[Geometry]
*****************************

Users can now rasterize an ``RDD[shapely.geometry]`` via the
``rasterize`` method.

.. code:: python3
# A Python RDD that contains shapely geomtries
geometry_rdd = ...
gps.rasterize(geoms=geometry_rdd, crs="EPSG:3857", zoom=11, fill_value=1)
ZFactor Calculator
*******************

``zfactor_lat_lng_caculator`` and ``zfactor_caclulator`` are two
new functions that will caculate the the the ``zfactor`` for each
``Tile`` in a layer during the ``slope`` or ``hillshade`` operations.
This is better than using a single ``zfactor`` for all ``Tile``\s as
``Tile``\s at different lattitdues require different ``zfactor``\s.

As mentioned above, there are two different forms of the calculator:
``zfactor_lat_lng_calculator`` and ``zfactor_calculator``. The former
being used for layers that are in the LatLng projection while the
latter for layers in all other projections.

.. code:: python3
# Using the zfactor_lat_lng_calculator
# Create a zfactor_lat_lng_calculator which uses METERS for its calcualtions
calculator = gps.zfactor_lat_lng_calculator(gps.METERS)
# A TiledRasterLayer which contains elevation data
tiled_layer = ...
# Calcualte slope of the layer using the calcualtor
tiled_layer.slope(calculator)
# Using the zfactor_calculator
# We must provide a dict that maps lattitude to zfactor for our
# given projection. Linear interpolation will be used on these
# values to produce the correct zfactor for each Tile in the
# layer.
mapped_factors = {
0.0: 0.1,
10.0: 1.5,
15.0: 2.0,
20.0, 2.5
}
# Create a zfactor_calculator using the given mapped factors
calculator = gps.zfactor_calculator(mapped_factors)
PartitionStragies
*****************

With this release of GeoPySpark comes three different parition
strategies: ``HashPartitionStrategy``, ``SpatialPartitionStrategy``,
and ``SpaceTimePartitionStrategy``. All three of these are used
to partition a layer given their specified inputs.

HashPartitionStrategy
######################

``HashPartitionStrategy`` is a partition strategy that uses
Spark's ``HashPartitioner`` to partition a layer. This can
be used on either ``SPATIAL`` or ``SPACETIME`` layers.

.. code:: python3
# Creates a HashPartitionStrategy with 128 partitions
gps.HashPartitionStrategy(num_partitions=128)
SpatialPartitionStrategy
#########################

``SpatialPartitionStrategy`` uses GeoPySpark's ``SpatialPartitioner``
during partitioning of the layer. This strategy will try and
partition the ``Tile``\s of a layer so that those which are near each
other spatially will be in the same partition. This will
only work on ``SPATIAL`` layers.

.. code:: python3
# Creates a SpatialPartitionStrategy with 128 partitions
gps.SpatialPartitionStrategy(num_partitions=128)
SpaceTimePartitionStrategy
###########################

``SpaceTimePartitionStrategy`` uses GeoPySpark's ``SpaceTimePartitioner``
during partitioning of the layer. This strategy will try and
partition the ``Tile``\s of a layer so that those which are near each
other spatially and temporally will be in the same partition. This will
only work on ``SPACETIME`` layers.

.. code:: python3
# Creates a SpaceTimePartitionStrategy with 128 partitions
# and temporal resolution of 5 weeks. This means that
# it will try and group the data in units of 5 weeks.
gps.SpaceTimePartitionStrategy(time_unit=gps.WEEKS, num_partitions=128, time_resolution=5)
Other New Features
*******************

- `tobler method for TiledRasterLayer <https://github.com/locationtech-labs/geopyspark/pull/567>`__
- `slope method for TiledRasterLayer <https://github.com/locationtech-labs/geopyspark/pull/595>`__
- `local_max method for TiledRasterLayer <https://github.com/locationtech-labs/geopyspark/pull/602>`__
- `mask layers by RDD[Geometry] <https://github.com/locationtech-labs/geopyspark/pull/629>`__
- `with_no_data method for RasterLayer and TiledRasterLayer <https://github.com/locationtech-labs/geopyspark/pull/631>`__
- ``partitionBy`` method for ``RasterLayer`` and ``TiledRasterLayer``
- ``get_partition_strategy`` method for ``CachableLayer``

Bug Fixes
^^^^^^^^^

- `TiledRasterLayer reproject bug fix <https://github.com/locationtech-labs/geopyspark/pull/581>`__
- `TMS display fix <https://github.com/locationtech-labs/geopyspark/pull/589>`__
- `CellType representation and conversion fixes <https://github.com/locationtech-labs/geopyspark/pull/606>`__
- `get_point_values will now return the correct number of results for temporal layers <https://github.com/locationtech-labs/geopyspark/pull/620>`__
- `Reading layers and values from Accumulo fix <https://github.com/locationtech-labs/geopyspark/pull/621>`__
- `time_intervals will now enumerate correctly in catalog.query <https://github.com/locationtech-labs/geopyspark/pull/623>`__
- `TileReader will now read the correct attribures file <https://github.com/locationtech-labs/geopyspark/pull/637>`__


0.3.0
------

Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
jar = 'geotrellis-backend-assembly-0.2.2.jar'

if not path.isfile(path.join('geopyspark/jars', jar)):
url = 'https://github.com/locationtech-labs/geopyspark/releases/download/v0.3.0/'
url = 'https://github.com/locationtech-labs/geopyspark/releases/download/v0.4.0/'
subprocess.call(['curl', '-L', url+jar, '-o', path.join('geopyspark/jars', jar)])

sys.path.insert(0, path.abspath(os.curdir))
Expand Down Expand Up @@ -73,9 +73,9 @@
# built documents.
#
# The short X.Y version.
version = '0.3.0'
version = '0.4.0'
# The full version, including alpha/beta/rc tags.
release = '0.3.0'
release = '0.4.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion geopyspark-backend/project/Version.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object Version {
val geopyspark = "0.3.0"
val geopyspark = "0.4.0"
val geotrellis = "2.0.0-SNAPSHOT"
val scala = "2.11.11"
val scalaTest = "2.2.0"
Expand Down
2 changes: 1 addition & 1 deletion geopyspark/command/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from geopyspark.geopyspark_constants import JAR, CWD


JAR_URL = 'https://github.com/locationtech-labs/geopyspark/releases/download/v0.3.0/' + JAR
JAR_URL = 'https://github.com/locationtech-labs/geopyspark/releases/download/v0.4.0/' + JAR
DEFAULT_JAR_PATH = path.join(CWD, 'jars')
CONF = path.join(CWD, 'command', 'geopyspark.conf')

Expand Down
2 changes: 1 addition & 1 deletion geopyspark/geopyspark_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from os import path

"""GeoPySpark version."""
VERSION = '0.3.0'
VERSION = '0.4.0'

"""Backend jar name."""
JAR = 'geotrellis-backend-assembly-' + VERSION + '.jar'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup_args = dict(
name='geopyspark',
version='0.3.0',
version='0.4.0',
author='Jacob Bouffard, James McClain',
author_email='jbouffard@azavea.com, jmcclain@azavea.com',
download_url='http://github.com/locationtech-labs/geopyspark',
Expand Down

0 comments on commit b421d61

Please sign in to comment.