Skip to content

Commit

Permalink
modified raster class align_to method and cleaned up commented-out code
Browse files Browse the repository at this point in the history
  • Loading branch information
Will committed Jul 1, 2015
1 parent eadb1b9 commit 2f11510
Showing 1 changed file with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions fauxgeo/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,16 +769,17 @@ def dataset_pixel_op(x, y): return y
return Raster.from_tempfile(dataset_out_uri)

def align_to(self, raster, resample_method):
'''Currently aligns other raster to this raster - later: union/intersection
'''Currently aligns self to provided raster - later: union/intersection
'''
assert(self.get_projection() == raster.get_projection())

def dataset_pixel_op(x, y): return y

dataset_uri_list = [raster.uri, self.uri]
dataset_out_uri = pygeo.geoprocessing.temporary_filename()
datatype_out = pygeo.geoprocessing.get_datatype_from_uri(raster.uri)
nodata_out = pygeo.geoprocessing.get_nodata_from_uri(raster.uri)
pixel_size_out = pygeo.geoprocessing.get_cell_size_from_uri(self.uri)
datatype_out = pygeo.geoprocessing.get_datatype_from_uri(self.uri)
nodata_out = pygeo.geoprocessing.get_nodata_from_uri(self.uri)
pixel_size_out = pygeo.geoprocessing.get_cell_size_from_uri(raster.uri)
bounding_box_mode = "dataset"

pygeo.geoprocessing.vectorize_datasets(
Expand All @@ -805,19 +806,6 @@ def clip(self, aoi_uri):
pixel_size = self.get_affine().a

try:
# pygeo.geoprocessing.vectorize_datasets(
# [self.uri],
# lambda x: x,
# dataset_out_uri,
# datatype,
# nodata,
# pixel_size,
# 'intersection',
# aoi_uri=aoi_uri,
# assert_datasets_projected=False, # ?
# process_pool=None,
# vectorize_op=False,
# rasterize_layer_options=['ALL_TOUCHED=TRUE'])
pygeo.geoprocessing.clip_dataset_uri(
self.uri,
aoi_uri,
Expand Down Expand Up @@ -877,22 +865,6 @@ def reproject(self, proj, resample_method, pixel_size=None):

return Raster.from_tempfile(dataset_out_uri)

# def reproject_georef_point(self, x, y, dst_proj):
# reproj = functools.partial(
# pyproj.transform,
# pyproj.Proj(init="epsg:%i" % self.get_projection()),
# pyproj.Proj(init="epsg:%i" % dst_proj))

# return reproj(x, y)

# def reproject_shapely_object(self, shapely_object, dst_proj):
# reproj = functools.partial(
# pyproj.transform,
# pyproj.Proj(init="epsg:%i" % self.get_projection()),
# pyproj.Proj(init="epsg:%i" % dst_proj))

# return shapely.ops.transform(reproj, shapely_object)

def resize_pixels(self, pixel_size, resample_method):
bounding_box = self.get_bounding_box()
output_uri = pygeo.geoprocessing.temporary_filename()
Expand Down

0 comments on commit 2f11510

Please sign in to comment.