-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xyz points from zmap in wrong position #6
Comments
Thanks @jscotchman for raising this. Should we add support for both conventions: |
Thanks for looking into this @abduhbm Doing some more reading around this it appears more complex than I originally thought. See this example: http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_pixelisarea_raster_space It looks like now that when using pixel_is_point=True we get the expected result as described in the link above. However, when using pixel_is_point=False it seems that the point location should be placed in the upper left of the cell using with the pixelCorner convention. So currently the code in the top left does do this but by the time we get to the bottom right of the grid the point is at the bottom right. So when making the xy grids for pixel_is_area from the grid extents maybe it should subtract a cell size? |
Thanks @jscotchman |
Thank you for this repo - it is really useful.
I have come across an issue with the creation of the xyz points from the zmap file. When creating the xy arrays the points are incorrectly located. I would expect to see the output points in the cell centers. From inspecting the code I think this occurs when inputting the cell edge min_x, max_x etc. values into np.linspace rather than the cell center min and max values. Hopefully the example below illustrates the point and provides a fix.
Here is an example code that reads a zmap file, creates a dataframe of points using .to_pandas() and creating a shapefile from that to view the point locations
When plotting the shapefile over the zmap in ArcGIS/QGIS we can see that the points are located in the cell top left in the top left corner:
![image](https://user-images.githubusercontent.com/55480539/167897468-8ba8970b-bf6b-45bf-b618-c7cb8fc40691.png)
Near the center in the middle of the zmap:
![image](https://user-images.githubusercontent.com/55480539/167896353-2dcf848c-76c4-4e75-8b89-814ae15bfe2a.png)
Point in the bottom right of cell toward the bottom right corner of the zmap:
![image](https://user-images.githubusercontent.com/55480539/167896589-988335e5-2d86-41bd-826b-7442acdfbf06.png)
To make these consistently cell center when creating the x and y meshgrids the code would need to look something like this:
The resultant shapefile of points plotted over the zmap shows the points now placed in cell center. Again the image below is the top left of the zmap.
I hope that is clear. If not let me know.
Many Thanks,
The text was updated successfully, but these errors were encountered: