diff --git a/README.md b/README.md index 42bee59..d6f918e 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,9 @@ options: 1. To generate a list of layers per service run the following: ```sh -ngr-spider layers -p 'OGC:WMS,OGC:WMTS' -m services pdok-services.json +ngr-spider layers -p 'OGC:WMS,OGC:WMTS' pdok-services.json +ngr-spider services -p 'OGC:WMS,OGC:WMTS' pdok-services.json + ``` ## Development diff --git a/ngr_spider/csw_client.py b/ngr_spider/csw_client.py index e688030..e800a52 100644 --- a/ngr_spider/csw_client.py +++ b/ngr_spider/csw_client.py @@ -56,11 +56,7 @@ def _get_csw_records( records = [CswServiceRecord(rec[1].xml) for rec in csw.records.items()] result.extend(records) - if ( - maxresults != 0 and len(result) >= maxresults - ): # break only early when maxresults set - break - if csw.results["nextrecord"] != 0: + if csw.results["nextrecord"] != 0 and (maxresults == 0 or len(result) < maxresults): start = csw.results["nextrecord"] continue result_out: list[CswServiceRecord] = result @@ -75,7 +71,7 @@ def _get_csw_records_by_protocol( max_results: int = 0, no_filter: bool = False, ) -> list[CswServiceRecord]: - protocol_key = "protocol" + protocol_key = "OnlineResourceType" if ( protocol == OAT_PROTOCOL ): # required since NGR does not support OGC API TILES as a seperate protocol