TUW-GEO / Equi7Grid

Definition of the Equi7Grid - a spatial reference optimized for global high-resolution raster data.
MIT License
61 stars 13 forks source link

Failed to reample an image to Equi7Grid with image2equi7grid function #15

Closed senmao closed 4 years ago

senmao commented 5 years ago

The image2equi7grid failed when resampling an image with non-lat/lon projectino to Equi7 Grid. It returns the below error.

====

ERROR 6: Incompatible geometry for operation 2019-10-04 15:30:42 [ERROR]: File-not-processed: S1B_EW_GRDH_1SDH_20191002T214344_20191002T214444_018302_02279D_7471.zip Traceback (most recent call last): File "/home/scao/shares/disk/swdvlp/git_eodc/A01-preprocessing/sgrt_A01/A01_workflow_sar_full_preprocessing.py", line 166, in A01_workflow_sar_full_preprocessing resample_to_equi7(sar_ds, job.wflow_id, File "/home/scao/shares/disk/swdvlp/git_eodc/A01-preprocessing/sgrt_A01/A01_workflow_sar_full_preprocessing.py", line 295, in resample_to_equi7 tiledtiff=tiled_tif, blocksize=block_size) File "/home/scao/shares/disk/swdvlp/git_eodc/Equi7Grid/equi7grid/image2equi7grid.py", line 314, in image2equi7grid subgrid_ids=subgrid_ids) File "/home/scao/shares/disk/swdvlp/git_eodc/pytileproj/pytileproj/base.py", line 505, in search_tiles_in_roi overlapped_grids = self.locate_geometry_in_subgrids(roi_geometry) File "/home/scao/shares/disk/swdvlp/git_eodc/pytileproj/pytileproj/base.py", line 240, in locate_geometry_in_subgrids if ptpgeometry.check_lonlat_intersection(geometry, self.subgrids.get(x).polygon_geog): File "/home/scao/shares/disk/swdvlp/git_eodc/pytileproj/pytileproj/geometry.py", line 428, in check_lonlat_intersection area = get_lonlat_intersection(geometry1, geometry2) File "/home/scao/shares/disk/swdvlp/git_eodc/pytileproj/pytileproj/geometry.py", line 462, in get_lonlat_intersection polygons = split_polygon_by_antimeridian(geometry1c) File "/home/scao/shares/disk/swdvlp/git_eodc/pytileproj/pytileproj/geometry.py", line 489, in split_polygon_by_antimeridian lons = [p[0] for p in in_points] TypeError: 'NoneType' object is not iterable

bbauerma commented 5 years ago

last commits in pytileproj & equi7grid solved the problem for me. please test it.

bbauerma commented 5 years ago

@senmao: please have a look here: https://github.com/TUW-GEO/Equi7Grid/blob/1aa29e7b04e55c13a4b4ae10f043a870d44d7e31/equi7grid/image2equi7grid.py#L618

Can we proceed like this? Or should we accept MULTIPOLYGON?

sebhahn commented 5 years ago

@bbauerma Please create new branches and create pull requests for issues, which makes it much more easier to follow changes/issues and have a discussion in the pull request are about the code and its impact. Looking at "last commits" can be troublesome, whereas simply checking out another branch is rather easy

bbauerma commented 5 years ago

Duly noted.

bbauerma commented 5 years ago

see latest changes in branch search_tiles_in_roi