Exception: x,y point given is outside of the model area- New to pygsflow #50
Unanswered
bvanhuizen
asked this question in
Q&A
Replies: 2 comments
-
You most likely need to set your coordinate offsets on the modelgrid object. I'd check your xoffset and yoffest value (lower left corner of the grid). Here's how to check the offsets and set/reset the grid offsets for intersection: # check the grid offsets (current lower left corner coordinates)
curr_xoffset = modelgrid.xoffset
curr_yoffset = modelgrid.yoffset
print(curr_xoffset, curr_yoffset)
# set new grid offsets (lower left corner coordinates)
new_xoffset = 12345 # replace with your x spatial location
new_yoffset = 6789 # replace with your y spatial location
modelgrid.set_coord_info(new_xoffset, new_yoffset)
# then try running the watershed delineation
watershed = fa.define_watershed(pour_point_file, modelgrid, fmt="shp") |
Beta Was this translation helpful? Give feedback.
0 replies
-
So I am replacing them with x and y of my pour point? Is that what you mean
by my spatial location?
…On Wed, Nov 27, 2024 at 4:16 PM Joshua Larsen ***@***.***> wrote:
@bvanhuizen <https://github.com/bvanhuizen>
You most likely need to set your coordinate offsets on the modelgrid
object. I'd check your xoffset and yoffest value (lower left corner of the
grid). Here's how to check the offsets and set/reset the grid offsets for
intersection:
# check the grid offsets (current lower left corner coordinates)curr_xoffset = modelgrid.xoffsetcurr_yoffset = modelgrid.yoffsetprint(curr_xoffset, curr_yoffset)
# set new grid offsets (lower left corner coordinates)new_xoffset = 12345 # replace with your x spatial locationnew_yoffset = 6789 # replace with your y spatial locationmodelgrid.set_coord_info(new_xoffset, new_yoffset)
# then try running the watershed delineationwatershed = fa.define_watershed(pour_point_file, modelgrid, fmt="shp")
—
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BAYPJUEFKYEWJ2UJHBF6ATL2CYZC3AVCNFSM6AAAAABSTWX6SSVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCMZZHEZTOOA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I have been working with gsflow for a couple years but am trying to automate the build process. I have been following the tutorials, and swapping out the data provided for my own. I keep running into an error when I try and delineate my watershed:
Defines the watershed
watershed = fa.define_watershed(pour_point_file, modelgrid, fmt="shp")
but it says my pour point is not in line with my model grid. The coordinate systems are different, but they didn't start that way. Is it possible that when saving my rasters to text files and then reloading them that I am losing the coordinate system information? When I print my shapefile xy location I get [[471986.9229802983, 6307837.769819319]] which is the xy coordinate, but when I look at the extent for my model area they don't come close to matching: (898, 908)
I am not sure what I am doing wrong, any help would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions