|
708 | 708 | "from owslib.fes import PropertyIsLike, BBox, And, PropertyIsEqualTo\n", |
709 | 709 | "from owslib.csw import CatalogueServiceWeb\n", |
710 | 710 | "\n", |
711 | | - "thecsw = CatalogueServiceWeb('http://geoportal.gov.cz/php/micka/csw/index.php')" |
| 711 | + "thecsw = CatalogueServiceWeb('https://inspire-geoportal.ec.europa.eu/srv/eng/csw')" |
712 | 712 | ] |
713 | 713 | }, |
714 | 714 | { |
|
726 | 726 | }, |
727 | 727 | "outputs": [], |
728 | 728 | "source": [ |
729 | | - "# wfs_query = PropertyIsLike('csw:AnyText', 'WFS')\n", |
730 | | - "geology_query = PropertyIsLike('csw:AnyText', 'Geology')\n", |
731 | 729 | "service_query = PropertyIsLike('apiso:type', 'service')\n", |
732 | | - "geology_and_wfs = And([geology_query, service_query])\n", |
733 | | - "thecsw.getrecords2([geology_and_wfs], esn='full')\n", |
| 730 | + "geology_query = PropertyIsLike('csw:AnyText', 'Geology')\n", |
| 731 | + "all_queries = And([ service_query, geology_query])\n", |
| 732 | + "thecsw.getrecords2([all_queries], esn='full')\n", |
734 | 733 | "\n", |
735 | 734 | "print(thecsw.results)" |
736 | 735 | ] |
|
766 | 765 | }, |
767 | 766 | "source": [ |
768 | 767 | "### Step 2 - Get the WFS endpoint and interact with it\n", |
769 | | - "Let's have a look at WFS data from the Czech Geology survey." |
| 768 | + "Let's have a look at WFS from the INSPIRE compliant download service, hosted at https://spatial.naturalsciences.be. " |
770 | 769 | ] |
771 | 770 | }, |
772 | 771 | { |
|
784 | 783 | }, |
785 | 784 | "outputs": [], |
786 | 785 | "source": [ |
787 | | - "geology = thecsw.records['575a4ef6-2f74-43ed-9352-6f400a010852']\n", |
788 | | - "print(f'Abstract: {geology.abstract}')\n", |
| 786 | + "boreholes = thecsw.records['aeaeaab2-10ac-48ac-922f-077a831a61c5']\n", |
| 787 | + "print(f'Abstract: {boreholes.abstract}')\n", |
789 | 788 | "\n", |
790 | | - "print(f'Identifier: {geology.identifiers[1][\"identifier\"]}')" |
| 789 | + "print(f'Identifier: {boreholes.identifiers[0][\"identifier\"]}')\n", |
| 790 | + "print(f'URL: {boreholes.uris[0][\"url\"]}')" |
791 | 791 | ] |
792 | 792 | }, |
793 | 793 | { |
|
806 | 806 | "outputs": [], |
807 | 807 | "source": [ |
808 | 808 | "from owslib.wfs import WebFeatureService\n", |
809 | | - "url = 'http://inspire.geology.cz/geoserver/wms?service=WMS&version=1.3.0&request=Getcapabilities'\n", |
810 | | - "geology_wfs = WebFeatureService(geology.identifiers[1]['identifier'])" |
| 809 | + "boreholes_wfs = WebFeatureService(boreholes.uris[0][\"url\"])" |
811 | 810 | ] |
812 | 811 | }, |
813 | 812 | { |
|
838 | 837 | }, |
839 | 838 | "outputs": [], |
840 | 839 | "source": [ |
841 | | - "capabilities = geology_wfs.getcapabilities()\n", |
| 840 | + "capabilities = boreholes_wfs.getcapabilities()\n", |
842 | 841 | "print(f'URL: {capabilities.geturl()}')\n", |
843 | | - "print(f'Name: {geology_wfs.provider.name}')\n", |
844 | | - "print(f'Title: {geology_wfs.identification.title}')\n", |
845 | | - "print(f'Keywords: {geology_wfs.identification.keywords[0]}')\n", |
846 | | - "print(f'Fees: {geology_wfs.identification.fees}')\n", |
847 | | - "print(f'Abstract: {geology_wfs.identification.abstract}')" |
| 842 | + "print(f'Name: {boreholes_wfs.provider.name}')\n", |
| 843 | + "print(f'Title: {boreholes_wfs.identification.title}')\n", |
| 844 | + "print(f'Keywords: {boreholes_wfs.identification.keywords[0]}')\n", |
| 845 | + "print(f'Fees: {boreholes_wfs.identification.fees}')\n", |
| 846 | + "print(f'Abstract: {boreholes_wfs.identification.abstract}')" |
848 | 847 | ] |
849 | 848 | }, |
850 | 849 | { |
|
875 | 874 | }, |
876 | 875 | "outputs": [], |
877 | 876 | "source": [ |
878 | | - "for i in geology_wfs.contents:\n", |
879 | | - " print(f'\\n#### {i} ####')\n", |
880 | | - " print(geology_wfs.contents[i].abstract)" |
| 877 | + "for i in boreholes_wfs.contents:\n", |
| 878 | + " print(f'\\n#### {i} ####')" |
881 | 879 | ] |
882 | 880 | }, |
883 | 881 | { |
|
908 | 906 | }, |
909 | 907 | "outputs": [], |
910 | 908 | "source": [ |
911 | | - "identifier = 'gsmlp:CZE_CGS_500k_Fault'\n", |
912 | | - "features = geology_wfs.getfeature([identifier])\n", |
| 909 | + "identifier = 'ge:boreholes_cores_rbins'\n", |
| 910 | + "features = boreholes_wfs.getfeature([identifier])\n", |
913 | 911 | "\n", |
914 | | - "with open('test/10-geology-faults.gml', 'w', encoding='UTF-8') as out:\n", |
| 912 | + "with open('test/10-boreholes.gml', 'w', encoding='UTF-8') as out:\n", |
915 | 913 | " out.write(str(features.read(), 'UTF-8'))" |
916 | 914 | ] |
917 | 915 | }, |
|
928 | 926 | "tags": [] |
929 | 927 | }, |
930 | 928 | "source": [ |
931 | | - "View the GML-data in browser via [this link](test/10-geology-faults.gml).\n", |
| 929 | + "View the GML-data in browser via [this link](test/10-boreholes.gml).\n", |
932 | 930 | "\n", |
933 | 931 | "---\n", |
934 | 932 | "[<- Publishing](09-publishing.ipynb) | [Emerging technology and trends ->](11-emerging-technology-trends.ipynb)" |
|
0 commit comments