Skip to content

Commit

Permalink
removing pyproj from fauxgeo
Browse files Browse the repository at this point in the history
  • Loading branch information
wbierbower committed May 28, 2015
1 parent 0c59bff commit 8722686
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
26 changes: 13 additions & 13 deletions fauxgeo/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# from affine import Affine
from shapely.geometry import Polygon
import shapely
import pyproj
# import pyproj
import PIL
import pygeoprocessing as pygeo

Expand Down Expand Up @@ -871,21 +871,21 @@ 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))
# 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)
# 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))
# 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)
# return shapely.ops.transform(reproj, shapely_object)

def resize_pixels(self, pixel_size, resample_method):
bounding_box = self.get_bounding_box()
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ numpy
gdal
pygeoprocessing
shapely
pyproj
pillow
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"shapely",
"pygeoprocessing",
"wheel",
"pyproj",
# "pyproj",
"pillow"
]

Expand All @@ -30,7 +30,7 @@
"shapely",
"pygeoprocessing",
"wheel",
"pyproj",
# "pyproj",
"pillow",
"nose",
"coverage"
Expand Down
11 changes: 11 additions & 0 deletions tests/test_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,17 @@ def test_set_slice(self):
raster[1:9:2, 1:9:2] = 2
assert(raster[1][3] == 2)

def test_set_slice(self):
raster = self.factory.alternating(0, 1)
raster[1:3, 1:3] = (np.ones((2, 2)) * 5)
assert(raster[1][1] == 5)

def test_reclass_slice(self):
raster = self.factory.alternating(0, 1)
block = raster[1:3, 1:3]
block[block == 1] = 0
raster[1:3, 1:3] = block
assert(raster[1][1] == 0)

if __name__ == '__main__':
unittest.main()

0 comments on commit 8722686

Please sign in to comment.