Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions autotest/t007_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,15 @@ def test_dis_sr():
rotation=rotation, xul=xul, yul=yul,
proj4_str='epsg:2243')

if abs(dis.sr.xul - xul) > 0.01:
raise AssertionError()

if abs(dis.sr.yul - yul) > 0.01:
raise AssertionError()
# SpatialReference has been deprecated
# if abs(dis.sr.xul - xul) > 0.01:
# raise AssertionError()
# if abs(dis.sr.yul - yul) > 0.01:
# raise AssertionError()
# Use StructuredGrid instead
x, y = bg.modelgrid.get_coords(0, delc * nrow)
np.testing.assert_almost_equal(x, xul)
np.testing.assert_almost_equal(y, yul)


def test_mg():
Expand Down
7 changes: 6 additions & 1 deletion flopy/export/netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,8 @@ def initialize_geometry(self):
if pyproj220:
self.grid_crs = pyproj.CRS(proj4_str)
else:
if proj4_str.lower().startswith("epsg:"):
proj4_str = "+init=" + proj4_str
self.grid_crs = pyproj.Proj(proj4_str, preserve_units=True)

print("initialize_geometry::self.grid_crs = {}".format(self.grid_crs))
Expand All @@ -753,7 +755,10 @@ def initialize_geometry(self):
self.grid_crs, nc_crs, always_xy=True
)
else:
nc_crs = pyproj.Proj(self.nc_epsg_str)
nc_epsg_str = self.nc_epsg_str
if nc_epsg_str.lower().startswith("epsg:"):
nc_epsg_str = "+init=" + nc_epsg_str
nc_crs = pyproj.Proj(nc_epsg_str)
self.transformer = None

print("initialize_geometry::nc_crs = {}".format(nc_crs))
Expand Down
2 changes: 1 addition & 1 deletion flopy/utils/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def _parse_units_from_proj4(self):
elif (
"units=ft" in proj_str
or "units=us-ft" in proj_str
or "to_meters:0.3048" in proj_str
or "to_meter=0.3048" in proj_str
):
units = "feet"
return units
Expand Down