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

oil-gas-lease throwing spatial error: Self-intersection at or near point ... #70

Closed
bbest opened this issue Oct 25, 2021 · 2 comments
Closed

Comments

@bbest
Copy link
Contributor

bbest commented Oct 25, 2021

tab..._shp_within_aoi(dataset_code='oil-gas-lease', aoi_wkt='POLYGON ((-97.39714 24.15911, -97.39714 37.64227, -75.1278 37.64227, -75.1278 24.15911, -97.39714 24.15911))')
Warning: Error in : Problem with `mutate()` column `sp_data`.
ℹ `sp_data = map(code, get_spatial_intersection, aoi_wkt = aoi_wkt)`.
x Failed to fetch row: ERROR:  lwgeom_intersection: GEOS Error: TopologyException: Input geom 0 is invalid: Self-intersection at or near point -163.00000206734327 25.389757947825256 at -163.00000206734327 25.389757947825256
@bbest
Copy link
Contributor Author

bbest commented Nov 10, 2021

Added ST_MakeValid(geometry) to select_sql column in spatial | marineenergy.app - Google Sheets

select
        prot_numbe as protraction_num, 
        prot_aprv_ as protraction_aprv, 
        block_numb as block_num, 
        blk_fed_ap::date as block_fed_aprv, 
        mms_region, 
        mms_plan_a as mms_plan_area, 
        geometry
from (
        select
                prot_numbe, prot_aprv_, block_numb, blk_fed_ap, mms_region, mms_plan_a, geometry
        from shp_blk_clip
        UNION
        select
                prot_numbe, prot_aprv_, block_numb, blk_fed_ap, mms_region, mms_plan_a, geometry
        from "shp_PC_BLK_CLIP"
        UNION
        select 
                prot_numbe, prot_aprv_, block_numb, blk_fed_ap, mms_region, mms_plan_a, geometry
        from "shp_ATL_BLKCLP"
        UNION
        select
                prot_numbe, prot_aprv_, block_numb, blk_fed_ap, mms_region, mms_plan_a, ST_MakeValid(geometry) AS geometry
        from "shp_AK_BLKCLP")

@bbest
Copy link
Contributor Author

bbest commented Dec 22, 2021

Woops, above SQL is from dataset ocs-lease-blk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant