Skip to content

Add exception handlers for Polygon and Locale methods#929

Merged
tomkralidis merged 2 commits into
geopython:masterfrom
vietnguyengit:exception-handling-bugs
May 31, 2024
Merged

Add exception handlers for Polygon and Locale methods#929
tomkralidis merged 2 commits into
geopython:masterfrom
vietnguyengit:exception-handling-bugs

Conversation

@vietnguyengit
Copy link
Copy Markdown
Contributor

@vietnguyengit vietnguyengit commented May 31, 2024

Please feel free to ignore/add new commits to the PR if you don't think it's useful, I won't put more efforts to this PR since the problems have been solved for us;

Missing the exception handlers blocking us from processing large number of records;

sample code to reproduce:

# Define the queries to search for records using GCMD Keywords
gcmd_query_lower = PropertyIsLike("AnyText", "%gcmd%")
gcmd_query_upper = PropertyIsLike("AnyText", "%GCMD%")
gcmd_query_full = PropertyIsLike("AnyText", "%Global Change Master Directory%")

# Define the query to exclude records containing 'AODN Discovery Parameter Vocabulary'
aodn_exclude_query = PropertyIsNotEqualTo(
    "AnyText", "AODN Discovery Parameter Vocabulary"
)

# Combine all queries using Or and And filters
combined_gcmd_query = Or([gcmd_query_lower, gcmd_query_upper, gcmd_query_full])
final_query = And([combined_gcmd_query, aodn_exclude_query])

# Connect to the CSW service
csw = CatalogueServiceWeb(
    "https://catalogue.aodn.org.au/geonetwork/srv/eng/csw?request=GetCapabilities&service=CSW&version=2.0.2"
)

you might want to use outputschema param within csw.getrecords2() method to be: http://standards.iso.org/iso/19115/-3/mdb/2.0

@vietnguyengit vietnguyengit changed the title Add exception handlers or Polygon and Locale methods Add exception handlers for Polygon and Locale methods May 31, 2024
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 60.184% (-0.1%) from 60.329%
when pulling ad993f7 on vietnguyengit:exception-handling-bugs
into 0bee95e on geopython:master.

@tomkralidis tomkralidis merged commit 13b0050 into geopython:master May 31, 2024
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

Successfully merging this pull request may close these issues.

3 participants