|
|
@@ -0,0 +1,682 @@
|
|
|
+# Spis treści:
|
|
|
+
|
|
|
+* [Adresy i wersje API] (#adresy-i-wersje-api)
|
|
|
+* [Struktura danych] (#struktura-danych)
|
|
|
+ * [Lista dostępnych tabel i funkcji - GetCapabilities] (#getcapabilities)
|
|
|
+ * [Struktura tabeli - DescribeFeatureType] (#describefeaturetype)
|
|
|
+ * [Struktura tabeli z dodatkowymi atrybutami - DescribeFeatureTypeAdvanced] (#describefeaturetypeadvanced)
|
|
|
+ * [Struktury wielu tabel] (#multiple-describefeaturetype)
|
|
|
+* [Pobieranie danych] (#pobieranie-danych)
|
|
|
+ * [GetFeature] (#getfeature)
|
|
|
+ * [Filtry] (#getfeature-filtry)
|
|
|
+ * [Filtr ogc:PropertyIsEqualTo] (#getfeature-filtr-ogcpropertyisequalto)
|
|
|
+ * [Filtr ogc:PropertyIsLike] (#getfeature-filtr-ogcpropertyislike)
|
|
|
+ * [Filtr ogc:PropertyIsNull] (#getfeature-filtr-ogcpropertyisnull)
|
|
|
+ * [Filtr ogc:Function] (#getfeature-filtr-ogcfunction)
|
|
|
+ * [Filtr ogc: IsLessThan, IsGreaterThen] (#getfeature-filtr-ogc-islessthan-isgreaterthen)
|
|
|
+ * [Error - Not implemented tag] (#error-not-implemented-tag)
|
|
|
+ * [Request-URI Too Long - ogc:Filter z POST] (#request-uri-too-long-ogcfilter-z-post)
|
|
|
+ * [GetFeatureAdvanced] (#getfeatureadvanced)
|
|
|
+ * [GetFeature - Hits] (#getfeature-hits)
|
|
|
+* [Modyfikacja danych] (#modyfikacja-danych)
|
|
|
+ * [Edycja danych] (#edycja-danych)
|
|
|
+ * [Wprowadzanie danych] (#wprowadzanie-danych)
|
|
|
+ * [Modyfikacja wielu danych] (#modyfikacja-wielu-danych)
|
|
|
+ * [Usuwanie danych] (#usuwanie-danych)
|
|
|
+ * [Wynik operacji] (#wynik-operacji)
|
|
|
+* [Pliki] (#pliki)
|
|
|
+ * [Pliki - download] (#pliki-download)
|
|
|
+ * [Pliki - upload] (#pliki-upload)
|
|
|
+ * [Pliki - wgranie pliku wraz z przypisaniem do obiektu] (#pliki-wgranie-pliku-wraz-z-przypisaniem-do-obiektu)
|
|
|
+
|
|
|
+# Adresy i wersje API
|
|
|
+
|
|
|
+- Wersja Data (ze wszystkimi danymi): `/wfs-data.php/default_db/`
|
|
|
+- Wersja QGIS (tyko rekordy z geom): `/wfs-qgis.php/default_db/`
|
|
|
+- Poprzedni link (wersja QGIS): `/wfs.php/xml/wfs/default_db/`
|
|
|
+- Uprawnienia wg procesu:
|
|
|
+ - wersja Data - proces 5040: `/wfs-data.php/filtr_proces_5040/default_db/`
|
|
|
+ - wersja QGIS - proces 5040: `/wfs-qgis.php/filtr_proces_5040/default_db/`
|
|
|
+
|
|
|
+API BIALL-NET:
|
|
|
+- Wersja ze wszystkimi danymi: https://biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/
|
|
|
+- Wersja QGIS (tyko rekordy z geom): https://biuro.biall-net.pl/SE/version-git/wfs-qgis.php/default_db/
|
|
|
+- Poprzedni link (wersja QGIS): https://biuro.biall-net.pl/SE/version-git/wfs.php/xml/wfs/default_db/
|
|
|
+
|
|
|
+
|
|
|
+### Examples
|
|
|
+- [Postman Collection](https://biuro.biall-net.pl/gitlab/plabudda/procesy5-wfs-api-doc/raw/master/Postman.wfs-server-data.json)
|
|
|
+
|
|
|
+
|
|
|
+# Struktura danych
|
|
|
+
|
|
|
+## GetCapabilities:
|
|
|
+```
|
|
|
+?SERVICE=WFS&REQUEST=GetCapabilities&VERSION=1.0.0
|
|
|
+```
|
|
|
+
|
|
|
+## DescribeFeatureType
|
|
|
+Struktura danych dla tabeli TEST_PERMS (namespace: "p5_default_db:TEST_PERMS")
|
|
|
+```
|
|
|
+?SERVICE=WFS&VERSION=1.0.0&TYPENAME=p5_default_db:TEST_PERMS&REQUEST=DescribeFeatureType
|
|
|
+```
|
|
|
+
|
|
|
+## DescribeFeatureTypeAdvanced
|
|
|
+Polskie nazwy kolumn oraz informacje o uprawnieniach:
|
|
|
+
|
|
|
+https://biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&TYPENAME=p5_default_db:TEST_PERMS&REQUEST=DescribeFeatureTypeAdvanced
|
|
|
+
|
|
|
+- każde pole dostaje id zasobu w @p5:id_zasobu
|
|
|
+- ładniejsza nazwa w @p5:label (z pola `DESC_PL` jeśli jest określona)
|
|
|
+- opis w @p5:description (z pola `OPIS` jeśli jest określone)
|
|
|
+- enumy rozdzielone do osobnych nazwanych typów
|
|
|
+- @atrybut p5:allow_create="true" - możliwość tworzenia nowego rekordu z tą kolumną
|
|
|
+- @atrybut p5:allow_write="true" - możliwość edycji tej kolumny
|
|
|
+- @atrybut p5:allow_read="false" - brak uprawnień do odczytania zawartości tej kolumny
|
|
|
+
|
|
|
+```xml
|
|
|
+ <xsd:element name="ID" minOccurs="1" maxOccurs="1" nillable="true" type="xsd:integer" p5:id_zasob="13052" p5:label="Nr"/>
|
|
|
+ <xsd:element name="A_STATUS" minOccurs="0" maxOccurs="1" nillable="true" type="p5_default_db:A_STATUSType" p5:id_zasob="21835" p5:label="Status" p5:allow_write="true" p5:allow_create="true"/>
|
|
|
+ <xsd:element name="ADM_PASSWD" minOccurs="0" maxOccurs="1" nillable="true" type="xsd:string" p5:id_zasob="22266" p5:allow_write="true" p5:allow_create="true" p5:allow_read="false"/>
|
|
|
+```
|
|
|
+
|
|
|
+## Multiple DescribeFeatureType
|
|
|
+Struktury wielu tabel
|
|
|
+
|
|
|
+POST na adres `?REQUEST=DescribeFeatureType&version=1.0.0&service=WFS`
|
|
|
+<!--
|
|
|
+lub `?REQUEST=DescribeFeatureTypeAdvanced&version=1.0.0&service=WFS`
|
|
|
+-->
|
|
|
+
|
|
|
+```xml
|
|
|
+<DescribeFeatureType xmlns="http://www.opengis.net/wfs/2.0"
|
|
|
+ xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ service="WFS"
|
|
|
+ version="2.0.2"
|
|
|
+ xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
|
|
|
+ <TypeName>p5_default_db:Rozdzielcza_rurociag_wsg84</TypeName>
|
|
|
+ <TypeName>p5_default_db:TEST_PERMS</TypeName>
|
|
|
+</DescribeFeatureType>
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
+# Pobieranie danych
|
|
|
+
|
|
|
+## GetFeature
|
|
|
+
|
|
|
+Parametry url:
|
|
|
+
|
|
|
+- **Limit**: `count` (WFS 2.0.0) lub `maxFeatures` (for earlier WFS versions)
|
|
|
+- **Offset**: `startIndex`
|
|
|
+- **Sort**: `sortBy` np. sortBy=ID+D,columnName+A
|
|
|
+- **Kolumny**: `propertyName` np. propertyName=ID,test_date,A_STATUS
|
|
|
+- **Filtry** `ogc:Filter`: parametr `Filter`, więcej na [API-WFS-ogc-Filter](https://biuro.biall-net.pl/gitlab/plabudda/procesy5-wfs-api-doc/wikis/API-WFS-ogc-Filter)
|
|
|
+- **featureID**: `featureID`: np. featureID=TEST_PERMS.12
|
|
|
+
|
|
|
+
|
|
|
+## Przykład - tylko 5 rekordów (MAXFEATURES=5):
|
|
|
+```
|
|
|
+?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:TEST_PERMS&SRSNAME=EPSG:3003&MAXFEATURES=5
|
|
|
+```
|
|
|
+- parametr MAXFEATURES - limit
|
|
|
+- ID rekordu w atrybucie fid="TEST_PERMS.26"
|
|
|
+
|
|
|
+```xml
|
|
|
+ <wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs" ... >
|
|
|
+ <gml:featureMember>
|
|
|
+ <p5_default_db_TEST_PERMS:TEST_PERMS fid="TEST_PERMS.26">
|
|
|
+ <p5_default_db_TEST_PERMS:ID>26</p5_default_db_TEST_PERMS:ID>
|
|
|
+ <p5_default_db_TEST_PERMS:OPIS>testowy opis</p5_default_db_TEST_PERMS:OPIS>
|
|
|
+```
|
|
|
+
|
|
|
+## Pobieranie danych (tylko zawierające dane geometryczne na potrzeby QGIS)
|
|
|
+
|
|
|
+Przykład - tylko 5 rekordów (MAXFEATURES=5):
|
|
|
+```
|
|
|
+?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:TEST_PERMS&SRSNAME=EPSG:3003&MAXFEATURES=5
|
|
|
+```
|
|
|
+- parametr MAXFEATURES - limit
|
|
|
+- ID rekordu w atrybucie fid="TEST_PERMS.26"
|
|
|
+
|
|
|
+```xml
|
|
|
+ <wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs" ... >
|
|
|
+ <gml:featureMember>
|
|
|
+ <p5_default_db_TEST_PERMS:TEST_PERMS fid="TEST_PERMS.26">
|
|
|
+ <p5_default_db_TEST_PERMS:ID>26</p5_default_db_TEST_PERMS:ID>
|
|
|
+ <p5_default_db_TEST_PERMS:OPIS>testowy opis</p5_default_db_TEST_PERMS:OPIS>
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
+## GetFeature Filtry
|
|
|
+```
|
|
|
+?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:TEST_PERMS&SRSNAME=EPSG:3003&Filter=<ogc:Filter>...
|
|
|
+```
|
|
|
+
|
|
|
+https://biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:TEST_PERMS&SRSNAME=EPSG:3003&Filter=%3Cogc:Filter%3E%3Cogc:Or%3E%3Cogc:PropertyIsEqualTo%3E%3Cogc:PropertyName%3EA_STATUS%3C/ogc:PropertyName%3E%3Cogc:Literal%3ENORMAL%3C/ogc:Literal%3E%3C/ogc:PropertyIsEqualTo%3E%3Cogc:PropertyIsEqualTo%3E%3Cogc:PropertyName%3EA_STATUS%3C/ogc:PropertyName%3E%3Cogc:Literal%3EWARNING%3C/ogc:Literal%3E%3C/ogc:PropertyIsEqualTo%3E%3C/ogc:Or%3E%3C/ogc:Filter%3E
|
|
|
+
|
|
|
+```
|
|
|
+https://biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS
|
|
|
+&VERSION=1.0.0
|
|
|
+&REQUEST=GetFeature
|
|
|
+&TYPENAME=p5_default_db:TEST_PERMS
|
|
|
+&SRSNAME=EPSG:3003
|
|
|
+&Filter=<ogc:Filter><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>A_STATUS</ogc:PropertyName><ogc:Literal>NORMAL</ogc:Literal></ogc:PropertyIsEqualTo><ogc:PropertyIsEqualTo><ogc:PropertyName>A_STATUS</ogc:PropertyName><ogc:Literal>WARNING</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Or></ogc:Filter>
|
|
|
+```
|
|
|
+
|
|
|
+### GetFeature - Filtr ogc:PropertyIsEqualTo
|
|
|
+```
|
|
|
+?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:TEST_PERMS&SRSNAME=EPSG:3003&Filter=<ogc:Filter>...
|
|
|
+```
|
|
|
+
|
|
|
+Sql Filtr:
|
|
|
+```sql
|
|
|
+ `A_STATUS` in('NORMAL','WAITING')
|
|
|
+```
|
|
|
+```xml
|
|
|
+ <ogc:Filter>
|
|
|
+ <ogc:Or>
|
|
|
+ <ogc:PropertyIsEqualTo>
|
|
|
+ <ogc:PropertyName>A_STATUS</ogc:PropertyName>
|
|
|
+ <ogc:Literal>NORMAL</ogc:Literal>
|
|
|
+ </ogc:PropertyIsEqualTo>
|
|
|
+ <ogc:PropertyIsEqualTo>
|
|
|
+ <ogc:PropertyName>A_STATUS</ogc:PropertyName>
|
|
|
+ <ogc:Literal>WAITING</ogc:Literal>
|
|
|
+ </ogc:PropertyIsEqualTo>
|
|
|
+ </ogc:Or>
|
|
|
+ </ogc:Filter>
|
|
|
+```
|
|
|
+
|
|
|
+### GetFeature - Filtr ogc:PropertyIsLike
|
|
|
+Sql Filtr:
|
|
|
+```sql
|
|
|
+ `A_STATUS` like '%O_MA%' or `A_STATUS` like '%ARNING'
|
|
|
+```
|
|
|
+```xml
|
|
|
+ <ogc:Filter>
|
|
|
+ <ogc:Or>
|
|
|
+ <ogc:PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
|
|
|
+ <ogc:PropertyName>A_STATUS</ogc:PropertyName>
|
|
|
+ <ogc:Literal>*O#MA*</ogc:Literal>
|
|
|
+ </ogc:PropertyIsLike>
|
|
|
+ <ogc:PropertyIsLike wildCard="*" singleChar="#" escapeChar="!">
|
|
|
+ <ogc:PropertyName>A_STATUS</ogc:PropertyName>
|
|
|
+ <ogc:Literal>*ARNING</ogc:Literal>
|
|
|
+ </ogc:PropertyIsLike>
|
|
|
+ </ogc:Or>
|
|
|
+ </ogc:Filter>
|
|
|
+```
|
|
|
+
|
|
|
+### GetFeature - Filtr ogc:PropertyIsNull
|
|
|
+```sql
|
|
|
+ ( ! (`t`.`the_geom` is null) or `t`.`ID` = '2' )
|
|
|
+```
|
|
|
+```xml
|
|
|
+<ogc:Filter>
|
|
|
+ <ogc:Or>
|
|
|
+ <ogc:Not>
|
|
|
+ <ogc:PropertyIsNull>
|
|
|
+ <ogc:PropertyName>the_geom</ogc:PropertyName>
|
|
|
+ </ogc:PropertyIsNull>
|
|
|
+ </ogc:Not>
|
|
|
+ <ogc:PropertyIsEqualTo>
|
|
|
+ <ogc:PropertyName>ID</ogc:PropertyName>
|
|
|
+ <ogc:Literal>2</ogc:Literal>
|
|
|
+ </ogc:PropertyIsEqualTo>
|
|
|
+ </ogc:Or>
|
|
|
+</ogc:Filter>
|
|
|
+```
|
|
|
+
|
|
|
+### GetFeature - Filtr ogc:Function
|
|
|
+```sql
|
|
|
+ ( ! (`t`.`the_geom` is null) or GeometryType(`t`.`the_geom`) = 'POLYGON' )
|
|
|
+```
|
|
|
+
|
|
|
+```xml
|
|
|
+<ogc:Filter>
|
|
|
+ <ogc:Or>
|
|
|
+ <ogc:Not>
|
|
|
+ <ogc:PropertyIsNull>
|
|
|
+ <ogc:PropertyName>the_geom</ogc:PropertyName>
|
|
|
+ </ogc:PropertyIsNull>
|
|
|
+ </ogc:Not>
|
|
|
+ <ogc:PropertyIsEqualTo>
|
|
|
+ <ogc:Function name="GeometryType">
|
|
|
+ <ogc:PropertyName>the_geom</ogc:PropertyName>
|
|
|
+ </ogc:Function>
|
|
|
+ <ogc:Literal>POLYGON</ogc:Literal>
|
|
|
+ </ogc:PropertyIsEqualTo>
|
|
|
+ </ogc:Or>
|
|
|
+</ogc:Filter>
|
|
|
+```
|
|
|
+
|
|
|
+### GetFeature - Filtr ogc IsLessThan, IsGreaterThen
|
|
|
+```sql
|
|
|
+(
|
|
|
+ ( `t`.`A_RECORD_CREATE_DATE` < '2015-12-01' or `t`.`A_RECORD_CREATE_DATE` <= '2015-12-01' )
|
|
|
+ and ( `t`.`A_RECORD_UPDATE_DATE` > '2016-06-01' or `t`.`A_RECORD_UPDATE_DATE` >= '2016-06-01' )
|
|
|
+)
|
|
|
+```
|
|
|
+
|
|
|
+POST na `wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:TEST_PERMS&SRSNAME=EPSG:3003`
|
|
|
+```xml
|
|
|
+<GetFeature xmlns="http://www.opengis.net/wfs/2.0"
|
|
|
+ xmlns:ogc="http://www.opengis.net/ogc"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ service="WFS"
|
|
|
+ version="2.0.2"
|
|
|
+ xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
|
|
|
+ <ogc:Filter>
|
|
|
+ <ogc:And>
|
|
|
+ <ogc:Or>
|
|
|
+ <ogc:PropertyIsLessThan>
|
|
|
+ <ogc:PropertyName>A_RECORD_CREATE_DATE</ogc:PropertyName>
|
|
|
+ <ogc:Literal>2015-12-01</ogc:Literal>
|
|
|
+ </ogc:PropertyIsLessThan>
|
|
|
+ <ogc:PropertyIsLessThanOrEqualTo>
|
|
|
+ <ogc:PropertyName>A_RECORD_CREATE_DATE</ogc:PropertyName>
|
|
|
+ <ogc:Literal>2015-12-01</ogc:Literal>
|
|
|
+ </ogc:PropertyIsLessThanOrEqualTo>
|
|
|
+ </ogc:Or>
|
|
|
+ <ogc:Or>
|
|
|
+ <ogc:PropertyIsGreaterThan>
|
|
|
+ <ogc:PropertyName>A_RECORD_UPDATE_DATE</ogc:PropertyName>
|
|
|
+ <ogc:Literal>2016-06-01</ogc:Literal>
|
|
|
+ </ogc:PropertyIsGreaterThan>
|
|
|
+ <ogc:PropertyIsGreaterThanOrEqualTo>
|
|
|
+ <ogc:PropertyName>A_RECORD_UPDATE_DATE</ogc:PropertyName>
|
|
|
+ <ogc:Literal>2016-06-01</ogc:Literal>
|
|
|
+ </ogc:PropertyIsGreaterThanOrEqualTo>
|
|
|
+ </ogc:Or>
|
|
|
+ </ogc:And>
|
|
|
+ </ogc:Filter>
|
|
|
+</GetFeature>
|
|
|
+```
|
|
|
+
|
|
|
+### Error - Not implemented tag
|
|
|
+```xml
|
|
|
+ <ogc:Filter>
|
|
|
+ <ogc:Or>
|
|
|
+ <ogc:UnsupportedTag>
|
|
|
+ <ogc:PropertyName>A_STATUS</ogc:PropertyName>
|
|
|
+ <ogc:Literal>*O%23MA*</ogc:Literal>
|
|
|
+ </ogc:UnsupportedTag>
|
|
|
+ </ogc:Or>
|
|
|
+ </ogc:Filter>
|
|
|
+```
|
|
|
+Result:
|
|
|
+```xml
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<ServiceExceptionReport
|
|
|
+ xmlns="http://www.opengis.net/ogc"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd" version="1.2.0">
|
|
|
+ <ServiceException code="NotImplementedOgcTag" locator="request">Not Implemented tag 'ogc:UnsupportedTag'</ServiceException>
|
|
|
+</ServiceExceptionReport>
|
|
|
+```
|
|
|
+
|
|
|
+### Request-URI Too Long - ogc:Filter z POST
|
|
|
+Odczytuje ogc:Filter z Request. Przydatne w przypadku długich filtrów nie mieszczących się w limicie długości URI.
|
|
|
+
|
|
|
+Przykład - POST na: `/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:TEST_PERMS&SRSNAME=EPSG:3003`
|
|
|
+
|
|
|
+```xml
|
|
|
+<GetFeature xmlns="http://www.opengis.net/wfs/2.0"
|
|
|
+ xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
|
|
|
+ xmlns:ogc="http://www.opengis.net/ogc"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ service="WFS"
|
|
|
+ version="2.0.2"
|
|
|
+ xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
|
|
|
+ <ogc:Filter>
|
|
|
+ <ogc:Or>
|
|
|
+ <ogc:PropertyIsLike wildCard="*" singleChar="%23" escapeChar="!">
|
|
|
+ <ogc:PropertyName>A_STATUS</ogc:PropertyName>
|
|
|
+ <ogc:Literal>*O%23MA*</ogc:Literal>
|
|
|
+ </ogc:PropertyIsLike>
|
|
|
+ <ogc:PropertyIsLike wildCard="*" singleChar="%23" escapeChar="!">
|
|
|
+ <ogc:PropertyName>A_STATUS</ogc:PropertyName>
|
|
|
+ <ogc:Literal>*ARNING</ogc:Literal>
|
|
|
+ </ogc:PropertyIsLike>
|
|
|
+ </ogc:Or>
|
|
|
+ </ogc:Filter>
|
|
|
+</GetFeature>
|
|
|
+```
|
|
|
+
|
|
|
+## GetFeatureAdvanced
|
|
|
+Dodatkowe atrybuty z informają o uprawnieniach:
|
|
|
+
|
|
|
+- @atrybut p5:allow_create="true" - możliwość tworzenia nowego rekordu z tą kolumną
|
|
|
+- @atrybut p5:allow_write="true" - możliwość edycji tej kolumny
|
|
|
+- @atrybut p5:allow_read="false" - brak uprawnień do odczytania zawartości tej kolumny
|
|
|
+
|
|
|
+
|
|
|
+## GetFeature - Hits
|
|
|
+
|
|
|
+Parametr url dla GetFeature i GetFeatureAdvanced:
|
|
|
+
|
|
|
+- **resultType=hits**: zwraca liczbę pasujących rekordów do zapytania
|
|
|
+
|
|
|
+Przykład:
|
|
|
+```
|
|
|
+/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003
|
|
|
+ &REQUEST=GetFeatureAdvanced
|
|
|
+ &TYPENAME=p5_default_db:TEST_PERMS
|
|
|
+ &resultType=hits
|
|
|
+```
|
|
|
+
|
|
|
+Wynik:
|
|
|
+```xml
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<wfs:FeatureCollection
|
|
|
+ xmlns:wfs="http://www.opengis.net/wfs/2.0"
|
|
|
+ xmlns="http://www.opengis.net/wfs/2.0"
|
|
|
+ xmlns:gml="http://www.opengis.net/gml"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="39" numberReturned="0"/>
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
+# Modyfikacja danych
|
|
|
+
|
|
|
+## Edycja danych
|
|
|
+POST na adres `?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&`
|
|
|
+
|
|
|
+```xml
|
|
|
+ <Transaction xmlns="http://www.opengis.net/wfs"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ version="1.0.0"
|
|
|
+ xmlns:p5_default_db="https://biuro.biall-net.pl/"
|
|
|
+ service="WFS"
|
|
|
+ xmlns:gml="http://www.opengis.net/gml">
|
|
|
+ <Update xmlns="http://www.opengis.net/wfs" typeName="p5_default_db:TEST_PERMS">
|
|
|
+ <Property xmlns="http://www.opengis.net/wfs">
|
|
|
+ <Name xmlns="http://www.opengis.net/wfs">OPIS</Name>
|
|
|
+ <Value xmlns="http://www.opengis.net/wfs">testowy opis</Value>
|
|
|
+ </Property>
|
|
|
+ <Filter xmlns="http://www.opengis.net/ogc"><FeatureId xmlns="http://www.opengis.net/ogc" fid="TEST_PERMS.25"/></Filter>
|
|
|
+ </Update>
|
|
|
+ </Transaction>
|
|
|
+```
|
|
|
+
|
|
|
+## Wprowadzanie danych
|
|
|
+POST na adres `?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&`
|
|
|
+
|
|
|
+```xml
|
|
|
+<Transaction
|
|
|
+ xmlns="http://www.opengis.net/wfs"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ version="1.0.0"
|
|
|
+ service="WFS"
|
|
|
+ xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
|
|
|
+ xmlns:gml="http://www.opengis.net/gml">
|
|
|
+ <Insert xmlns="http://www.opengis.net/wfs">
|
|
|
+ <TEST_PERMS xmlns="https://biuro.biall-net.pl/wfs/default_db/TEST_PERMS">
|
|
|
+ <OPIS xmlns="https://biuro.biall-net.pl/wfs/default_db/TEST_PERMS">test</OPIS>
|
|
|
+ <the_geom xmlns="https://biuro.biall-net.pl/wfs/default_db/TEST_PERMS">
|
|
|
+ <gml:Polygon srsName="EPSG:4326">
|
|
|
+ <gml:outerBoundaryIs>
|
|
|
+ <gml:LinearRing>
|
|
|
+ <gml:coordinates cs="," ts=" ">18.44569262058692871,54.36867274376898251 18.44884659456100096,54.35193242036815064 18.48208462798003637,54.34368356535905065 18.44569262058692871,54.36867274376898251</gml:coordinates>
|
|
|
+ </gml:LinearRing>
|
|
|
+ </gml:outerBoundaryIs>
|
|
|
+ </gml:Polygon>
|
|
|
+ </the_geom>
|
|
|
+ </TEST_PERMS>
|
|
|
+ </Insert>
|
|
|
+</Transaction>
|
|
|
+```
|
|
|
+
|
|
|
+Jeśli zostanie wysłana również wartość dla klucza (ID) to zostanie wykonana operacja **Update**
|
|
|
+`<ID xmlns="https://biuro.biall-net.pl/wfs/default_db">24</ID>`
|
|
|
+
|
|
|
+```xml
|
|
|
+<Transaction
|
|
|
+ xmlns="http://www.opengis.net/wfs"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ version="1.0.0"
|
|
|
+ service="WFS"
|
|
|
+ xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
|
|
|
+ xmlns:gml="http://www.opengis.net/gml">
|
|
|
+ <Insert xmlns="http://www.opengis.net/wfs">
|
|
|
+ <TEST_PERMS xmlns="https://biuro.biall-net.pl/wfs/default_db/TEST_PERMS">
|
|
|
+ <ID xmlns="https://biuro.biall-net.pl/wfs/default_db/TEST_PERMS">24</ID>
|
|
|
+ <OPIS xmlns="https://biuro.biall-net.pl/wfs/default_db/TEST_PERMS">test</OPIS>
|
|
|
+ <the_geom xmlns="https://biuro.biall-net.pl/wfs/default_db/TEST_PERMS">
|
|
|
+ <gml:Polygon srsName="EPSG:4326">
|
|
|
+ <gml:outerBoundaryIs>
|
|
|
+ <gml:LinearRing>
|
|
|
+ <gml:coordinates cs="," ts=" ">18.44569262058692871,54.36867274376898251 18.44884659456100096,54.35193242036815064 18.48208462798003637,54.34368356535905065 18.44569262058692871,54.36867274376898251</gml:coordinates>
|
|
|
+ </gml:LinearRing>
|
|
|
+ </gml:outerBoundaryIs>
|
|
|
+ </gml:Polygon>
|
|
|
+ </the_geom>
|
|
|
+ </TEST_PERMS>
|
|
|
+ </Insert>
|
|
|
+</Transaction>
|
|
|
+```
|
|
|
+
|
|
|
+## Modyfikacja wielu danych
|
|
|
+POST na adres `?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&`
|
|
|
+
|
|
|
+Przykład - wprowadzenie trzech rekrodów do tabeli TEST_GEOM_LINESTRING:
|
|
|
+```xml
|
|
|
+<Transaction xmlns="http://www.opengis.net/wfs"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ version="1.0.0"
|
|
|
+ service="WFS"
|
|
|
+ xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
|
|
|
+ xmlns:gml="http://www.opengis.net/gml">
|
|
|
+ <Insert xmlns="http://www.opengis.net/wfs">
|
|
|
+ <TEST_GEOM_LINESTRING xmlns="https://biuro.biall-net.pl/wfs/default_db">
|
|
|
+ <OPIS xmlns="https://biuro.biall-net.pl/wfs/default_db">test1z3</OPIS>
|
|
|
+ <the_geom xmlns="https://biuro.biall-net.pl/wfs/default_db">
|
|
|
+ <gml:LineString srsName="EPSG:4326">
|
|
|
+ <gml:coordinates cs="," ts=" ">18.25240580856418049,54.48879768607960017 18.27014261382555915,54.46219247818753217</gml:coordinates>
|
|
|
+ </gml:LineString>
|
|
|
+ </the_geom>
|
|
|
+ </TEST_GEOM_LINESTRING>
|
|
|
+ </Insert>
|
|
|
+ <Insert xmlns="http://www.opengis.net/wfs">
|
|
|
+ <TEST_GEOM_LINESTRING xmlns="https://biuro.biall-net.pl/wfs/default_db">
|
|
|
+ <OPIS xmlns="https://biuro.biall-net.pl/wfs/default_db">test2z3</OPIS>
|
|
|
+ <the_geom xmlns="https://biuro.biall-net.pl/wfs/default_db">
|
|
|
+ <gml:LineString srsName="EPSG:4326">
|
|
|
+ <gml:coordinates cs="," ts=" ">18.2629370366881254,54.43447871996662712 18.28621659359368223,54.40621068658131065</gml:coordinates>
|
|
|
+ </gml:LineString>
|
|
|
+ </the_geom>
|
|
|
+ </TEST_GEOM_LINESTRING>
|
|
|
+ </Insert>
|
|
|
+ <Insert xmlns="http://www.opengis.net/wfs">
|
|
|
+ <TEST_GEOM_LINESTRING xmlns="https://biuro.biall-net.pl/wfs/default_db">
|
|
|
+ <OPIS xmlns="https://biuro.biall-net.pl/wfs/default_db">test3z3</OPIS>
|
|
|
+ <the_geom xmlns="https://biuro.biall-net.pl/wfs/default_db">
|
|
|
+ <gml:LineString srsName="EPSG:4326">
|
|
|
+ <gml:coordinates cs="," ts=" ">18.26404558701696246,54.39512518329294721 18.29841064721088273,54.39179953230643605</gml:coordinates>
|
|
|
+ </gml:LineString>
|
|
|
+ </the_geom>
|
|
|
+ </TEST_GEOM_LINESTRING>
|
|
|
+ </Insert>
|
|
|
+</Transaction>
|
|
|
+```
|
|
|
+Wynik:
|
|
|
+```
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<wfs:WFS_TransactionResponse version="1.0.0"
|
|
|
+ xmlns:wfs="http://www.opengis.net/wfs"
|
|
|
+ xmlns:ogc="http://www.opengis.net/ogc"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
|
+ <wfs:InsertResult>
|
|
|
+ <ogc:FeatureId fid="TEST_GEOM_LINESTRING.522" xmlns:ogc="http://www.opengis.net/ogc"/>
|
|
|
+ <ogc:FeatureId fid="TEST_GEOM_LINESTRING.523" xmlns:ogc="http://www.opengis.net/ogc"/>
|
|
|
+ <ogc:FeatureId fid="TEST_GEOM_LINESTRING.524" xmlns:ogc="http://www.opengis.net/ogc"/>
|
|
|
+ </wfs:InsertResult>
|
|
|
+ <wfs:TransactionResult>
|
|
|
+ <wfs:Status>
|
|
|
+ <wfs:SUCCESS/>
|
|
|
+ </wfs:Status>
|
|
|
+ </wfs:TransactionResult>
|
|
|
+</wfs:WFS_TransactionResponse>
|
|
|
+```
|
|
|
+ID rekordów podane w tagu `<wfs:InsertResult>` w takiej samej kolejności jak w treści zapytania.
|
|
|
+
|
|
|
+Czyli rekord 522 ma OPIS = test1z3, 523 ma OPIS = test2z3, 524 ma OPIS = test3z3
|
|
|
+
|
|
|
+
|
|
|
+## Usuwanie danych
|
|
|
+POST na adres `?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&`
|
|
|
+
|
|
|
+Usuwanie rekordów 1 i 2 z tabeli TEST_GEOM_POINT
|
|
|
+```xml
|
|
|
+<Transaction xmlns="http://www.opengis.net/wfs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" service="WFS" xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db" xsi:schemaLocation="https://biuro.biall-net.pl/wfs/default_db https://biuro.biall-net.pl/dev-pl/se-master/wfs-qgis.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=p5_default_db:TEST_GEOM_POINT&SRSNAME=EPSG:4326" xmlns:gml="http://www.opengis.net/gml">
|
|
|
+ <Delete xmlns="http://www.opengis.net/wfs" typeName="p5_default_db:TEST_GEOM_POINT">
|
|
|
+ <Filter xmlns="http://www.opengis.net/ogc">
|
|
|
+ <FeatureId xmlns="http://www.opengis.net/ogc" fid="TEST_GEOM_POINT.2" />
|
|
|
+ <FeatureId xmlns="http://www.opengis.net/ogc" fid="TEST_GEOM_POINT.1" />
|
|
|
+ </Filter>
|
|
|
+ </Delete>
|
|
|
+</Transaction>
|
|
|
+```
|
|
|
+
|
|
|
+## Wynik operacji
|
|
|
+```xml
|
|
|
+ <?xml version="1.0" encoding="UTF-8"?>
|
|
|
+ <wfs:WFS_TransactionResponse version="1.0.0"
|
|
|
+ xmlns:wfs="http://www.opengis.net/wfs"
|
|
|
+ xmlns:ogc="http://www.opengis.net/ogc"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
|
+ <wfs:InsertResult>
|
|
|
+ <ogc:FeatureId fid="TEST_PERMS.40" xmlns:ogc="http://www.opengis.net/ogc"/>
|
|
|
+ <ogc:FeatureId fid="TEST_PERMS.41" xmlns:ogc="http://www.opengis.net/ogc"/>
|
|
|
+ <!-- w takiej samej kolejności jak wysłano -->
|
|
|
+ </wfs:InsertResult>
|
|
|
+ <wfs:TransactionResult>
|
|
|
+ <wfs:Status>
|
|
|
+ <wfs:SUCCESS/>
|
|
|
+ </wfs:Status>
|
|
|
+ </wfs:TransactionResult>
|
|
|
+ </wfs:WFS_TransactionResponse>
|
|
|
+```
|
|
|
+
|
|
|
+# Pliki
|
|
|
+typeName: `p5_objects:File`
|
|
|
+
|
|
|
+Obecnie działa:
|
|
|
+- DescribeFeatureTypeAdvanced - file content is `xsd:base64Binary`
|
|
|
+- GetFeatureAdvanced - file content returned as base64
|
|
|
+- AddFeature
|
|
|
+
|
|
|
+## Pliki - download
|
|
|
+```
|
|
|
+https://biuro.biall-net.pl/SE/version-git/wfs-data.php/default_db/?SERVICE=WFS
|
|
|
+&VERSION=1.0.0
|
|
|
+&REQUEST=GetFeatureAdvanced
|
|
|
+&TYPENAME=p5_objects:File
|
|
|
+&SRSNAME=EPSG:3003
|
|
|
+&Filter=<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>id</ogc:PropertyName><ogc:Literal>35</ogc:Literal></ogc:Filter>
|
|
|
+```
|
|
|
+
|
|
|
+Wynik:
|
|
|
+```xml
|
|
|
+<?xml version="1.0" encoding="utf-8"?>
|
|
|
+<wfs:FeatureCollection
|
|
|
+ xmlns:wfs="http://www.opengis.net/wfs"
|
|
|
+ xmlns="http://www.opengis.net/wfs"
|
|
|
+ xmlns:gml="http://www.opengis.net/gml"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ xmlns:p5_objects="https://biuro.biall-net.pl/wfs/objects"
|
|
|
+ xmlns:p5="https://biuro.biall-net.pl/wfs"
|
|
|
+ xsi:schemaLocation="https://biuro.biall-net.pl/wfs/objects https://biuro.biall-net.pl/dev-pl/se-master/wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&TYPENAME=p5_objects:File&REQUEST=DescribeFeatureType">
|
|
|
+ <gml:featureMember>
|
|
|
+ <p5_objects:File fid="File.35">
|
|
|
+ <p5_objects:id>35</p5_objects:id>
|
|
|
+ <p5_objects:name>blank-test-wfs.gif</p5_objects:name>
|
|
|
+ <p5_objects:size>64</p5_objects:size>
|
|
|
+ <p5_objects:mimeType>image/gif</p5_objects:mimeType>
|
|
|
+ <p5_objects:version>0</p5_objects:version>
|
|
|
+ <p5_objects:content>R0lGODlhAQABAIAAAP///////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==</p5_objects:content>
|
|
|
+ </p5_objects:File>
|
|
|
+ </gml:featureMember>
|
|
|
+</wfs:FeatureCollection>
|
|
|
+```
|
|
|
+
|
|
|
+## Pliki - upload
|
|
|
+
|
|
|
+POST na: `wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003`
|
|
|
+```xml
|
|
|
+<Transaction
|
|
|
+ xmlns="http://www.opengis.net/wfs"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ version="1.0.0"
|
|
|
+ service="WFS"
|
|
|
+ xmlns:p5_objects="https://biuro.biall-net.pl/wfs/objects"
|
|
|
+ xmlns:gml="http://www.opengis.net/gml">
|
|
|
+ <Insert xmlns="http://www.opengis.net/wfs">
|
|
|
+ <File xmlns="https://biuro.biall-net.pl/wfs/objects">
|
|
|
+ <name xmlns="https://biuro.biall-net.pl/wfs/objects">blank.gif</name>
|
|
|
+ <content xmlns="https://biuro.biall-net.pl/wfs/objects">R0lGODlhAQABAIAAAP///////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==</content>
|
|
|
+ </File>
|
|
|
+ </Insert>
|
|
|
+</Transaction>
|
|
|
+```
|
|
|
+
|
|
|
+Wynik:
|
|
|
+```xml
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<wfs:WFS_TransactionResponse version="1.0.0"
|
|
|
+ xmlns:wfs="http://www.opengis.net/wfs"
|
|
|
+ xmlns:ogc="http://www.opengis.net/ogc"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
|
+ <wfs:InsertResult>
|
|
|
+ <ogc:FeatureId fid="File.35" xmlns:ogc="http://www.opengis.net/ogc"/>
|
|
|
+ </wfs:InsertResult>
|
|
|
+ <wfs:TransactionResult>
|
|
|
+ <wfs:Status>
|
|
|
+ <wfs:SUCCESS/>
|
|
|
+ </wfs:Status>
|
|
|
+ </wfs:TransactionResult>
|
|
|
+</wfs:WFS_TransactionResponse>
|
|
|
+```
|
|
|
+
|
|
|
+## Pliki - wgranie pliku wraz z przypisaniem do obiektu
|
|
|
+
|
|
|
+POST na: `wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003`
|
|
|
+```xml
|
|
|
+<Transaction
|
|
|
+ xmlns="http://www.opengis.net/wfs"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ version="1.0.0"
|
|
|
+ service="WFS"
|
|
|
+ xmlns:p5_objects="https://biuro.biall-net.pl/wfs/objects"
|
|
|
+ xmlns:gml="http://www.opengis.net/gml">
|
|
|
+ <Insert xmlns="http://www.opengis.net/wfs">
|
|
|
+ <TestPerms xmlns="https://biuro.biall-net.pl/wfs/objects">
|
|
|
+ <OPIS xmlns="https://biuro.biall-net.pl/wfs/objects">test addFeature p5_objects:TestPerms with p5_objects:File</OPIS>
|
|
|
+ <A_STATUS xmlns="https://biuro.biall-net.pl/wfs/objects">NORMAL</A_STATUS>
|
|
|
+ <p5_objects:File>
|
|
|
+ <p5_objects:name>blank-wfs.gif</p5_objects:name>
|
|
|
+ <p5_objects:content>R0lGODlhAQABAIAAAP///////yH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==</p5_objects:content>
|
|
|
+ </p5_objects:File>
|
|
|
+ <ADM_NAME xmlns="https://biuro.biall-net.pl/wfs/objects">Test Name</ADM_NAME>
|
|
|
+ </TestPerms>
|
|
|
+ </Insert>
|
|
|
+</Transaction>
|
|
|
+```
|
|
|
+
|
|
|
+Wynik:
|
|
|
+```xml
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<wfs:WFS_TransactionResponse version="1.0.0"
|
|
|
+ xmlns:wfs="http://www.opengis.net/wfs"
|
|
|
+ xmlns:ogc="http://www.opengis.net/ogc"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
|
+ <wfs:InsertResult>
|
|
|
+ <ogc:FeatureId fid="TestPerms.49" xmlns:ogc="http://www.opengis.net/ogc"/>
|
|
|
+ </wfs:InsertResult>
|
|
|
+ <wfs:TransactionResult>
|
|
|
+ <wfs:Status>
|
|
|
+ <wfs:SUCCESS/>
|
|
|
+ </wfs:Status>
|
|
|
+ </wfs:TransactionResult>
|
|
|
+</wfs:WFS_TransactionResponse>
|
|
|
+```
|