Skip to content
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

Potential bug on build_database.wkt2extent() #1

Closed
seongsujeong opened this issue Oct 5, 2022 · 1 comment
Closed

Potential bug on build_database.wkt2extent() #1

seongsujeong opened this issue Oct 5, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@seongsujeong
Copy link
Collaborator

The function in the title is to calculate the extent (bounding box) of the input burst as polygon. This function only takes the first polygon in the multi polygon input. This needs to be addressed especially for the burst (multi)polygons split on +/- 180 degree.

@seongsujeong seongsujeong added the bug Something isn't working label Oct 5, 2022
@scottstanie
Copy link
Contributor

scottstanie commented Oct 24, 2022

@seongsujeong I also noticed this when I started to add the burst database reading to COMPASS, though I hadn't seen that you already marked this to fix.
I tried a different method of getting the centroids/bounding boxes of the geometries using shapely and pandas here:

main...scottstanie:burst_db:main#diff-09d0cbaf891d623ac245ccf84485a687b554217349ca55557c60b33234b969aeR12-R29

It seems to be working based on my tests of the burst t081_172141_iw3. The fault bounding box (xmin, ymin, xmax, ymax) from the current database is (645650.0, 5760850.0, 706650.0, 5796300.0). As you noted, this is just the values of the snapped first geometry (which below is geom_idl for "international date line"):


In [215]: polygon_to_utm(geom_idl.geoms[0], epsg_out=epsg_idl).bounds
Out[215]: (646626.7148944604, 5761871.2820195, 705638.8897354577, 5795317.287388428)

In [216]: polygon_to_utm(geom_idl.geoms[1], epsg_out=epsg_idl).bounds
Out[216]: (704686.5009254754, 5772308.0731547205, 729619.1975054083, 5799533.836049749)

With the new one from the pull request below, the xmax goes out to 730600

$ echo "select * from burst_id_map where burst_id_jpl='t081_172141_iw3';" | sqlite3 /u/aurora-r0/staniewi/dev/burst_map_IW_000001_375887.OPERA-JPL.sqlite3

OGC_FID  relative_orbit_number  time_from_anx_sec  orbit_pass  burst_id_jpl     epsg   xmin      ymin       xmax      ymax       geometry
-------  ---------------------  -----------------  ----------  ---------------  -----  --------  ---------  --------  ---------  --------
516423   81                     847.60244699211    ASCENDING   t081_172141_iw3  32660  645650.0  5760850.0  730600.0  5800550.0

I also made it into a script that could download the ESA original database first , then convert it, and the new conversion with shapely seems to run pretty quickly (~45-60 seconds to build the DB).

Let me know if you want me to make the PR for this, or if you'd like to adapt the current version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants