-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wfs): creating an indepedant source for from wfs-datasource (#120)
Creating an indepedant source for from wfs-datasource. Previously dependent of feature-datasource. Adding possibilities for creating an initial filter (into context.json) for wfs datasets based on a new IGO object, called IgoOgcFilterObject. This structure for logical filters: {"logical" : "Or", "filters": [ {"operator" : "During","propertyName" : "date", "begin" : "2014" ,"end" : "2016"}, {"operator" : "PropertyIsEqualTo","propertyName" : "name", "pattern" : "Québec"}, {"operator" : "PropertyIsLike","propertyName" : "number", "pattern" : "3*"} ] }, This structure for simple OGC filters: {"operator" : "PropertyIsLike","propertyName" : "number", "pattern" : "3*"} In this pull request, I renamed some properties to clearly separate TimeFilter from OgcFilter. Next pull request will use these properties to populate a component. Documentation for additionnal mandatory and optional parameters for wfs datasources will soon follow. Tested on WFS with : Mapserver 7.0.7 and 7.0.3 (https://ws.mapserver.transports.gouv.qc.ca/swtq?service=wfs&request=getcapabilities) == > GML 3.1.1 and geojson ArcGIS (https://infogeo.education.gouv.qc.ca/arcgis/services/DonneesOuvertes/SW_MEES/MapServer/WFSServer?request=GetCapabilities&service=WFS) == > GML 3.1.1 Geomedia == > GML 3.1.1
- Loading branch information
Showing
31 changed files
with
732 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
{ | ||
"uri": "test_wfs", | ||
"title": "test_wfs", | ||
"map": { | ||
"view": { | ||
"projection": "EPSG:3857", | ||
"center": [-72, 50], | ||
"zoom": 7, | ||
"geolocate": true | ||
} | ||
}, | ||
|
||
"layers": [{ | ||
"title": "OSM", | ||
"type": "osm" | ||
}, | ||
{ | ||
"name": "cs sans filtre gml", | ||
"visible": false, | ||
"id": "cs sans filtre gml", | ||
"title": "cs sans filtre gml", | ||
"type": "wfs", | ||
"source": { | ||
"url": "https://ws.mapserver.transports.gouv.qc.ca/swtq", | ||
"featureTypes": "bgr_v_centr_servc_geomt_act", | ||
"fieldNameGeometry": "geometry", | ||
"maxFeatures": 10000, | ||
"version": "2.0.0", | ||
"outputFormat": "text/xml; subtype=gml/3.1.1", | ||
"outputFormatDownload": "shp" | ||
} | ||
}, | ||
{ | ||
"name": "cs avec filtre gml", | ||
"visible": false, | ||
"id": "cs avec filtre gml", | ||
"title": "cs avec filtre gml", | ||
"type": "wfs", | ||
"source": { | ||
"url": "https://ws.mapserver.transports.gouv.qc.ca/swtq", | ||
"featureTypes": "bgr_v_centr_servc_geomt_act", | ||
"fieldNameGeometry": "geometry", | ||
"maxFeatures": 10000, | ||
"version": "2.0.0", | ||
"outputFormat": "text/xml; subtype=gml/3.1.1", | ||
"outputFormatDownload": "shp" | ||
}, | ||
"filters": { | ||
"logical": "Or", | ||
"filters": [ | ||
{"operator": "During", "propertyName": "dat_debut_", "begin": "2014", "end": "2016"}, | ||
{"operator": "PropertyIsEqualTo", "propertyName": "nom_unite_", "pattern": "CS de Lévis"}, | ||
{"operator": "PropertyIsLike", "propertyName": "ide_unite_", "pattern": "3*"} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "cs avec filtre geojson", | ||
"visible": false, | ||
"id": "cs avec filtre", | ||
"title": "cs avec filtre", | ||
"type": "wfs", | ||
"source": { | ||
"url": "https://ws.mapserver.transports.gouv.qc.ca/swtq", | ||
"featureTypes": "bgr_v_centr_servc_geomt_act", | ||
"fieldNameGeometry": "geometry", | ||
"maxFeatures": 10000, | ||
"version": "2.0.0", | ||
"outputFormat": "geojson", | ||
"outputFormatDownload": "shp" | ||
}, | ||
"filters": { | ||
"logical": "Or", | ||
"filters": [ | ||
{"operator": "During", "propertyName": "dat_debut_", "begin": "2014", "end": "2016"}, | ||
{"operator": "PropertyIsEqualTo", "propertyName": "nom_unite_", "pattern": "CS de Lévis"}, | ||
{"operator": "PropertyIsLike", "propertyName": "ide_unite_", "pattern": "3*"} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "vg avec filtre", | ||
"visible": false, | ||
"id": "vg", | ||
"title": "vg avec filtre", | ||
"type": "wfs", | ||
"source": { | ||
"url": "https://geoegl.msp.gouv.qc.ca/ws/igo_gouvouvert.fcgi", | ||
"featureTypes": "vg_observation_v_inondation_embacle_wmst", | ||
"fieldNameGeometry": "geometry", | ||
"maxFeatures": 10000, | ||
"version": "2.0.0", | ||
"outputFormat": "geojson", | ||
"outputFormatDownload": "shp" | ||
}, | ||
"filters": {"operator": "PropertyIsEqualTo", "propertyName": "cap_severite", "pattern": "Mineure"} | ||
}, | ||
{ | ||
"name": "vg sans filtre", | ||
"visible": false, | ||
"id": "vg sans filtre", | ||
"title": "vg sans filtre", | ||
"type": "wfs", | ||
"source": { | ||
"url": "https://geoegl.msp.gouv.qc.ca/ws/igo_gouvouvert.fcgi", | ||
"featureTypes": "vg_observation_v_inondation_embacle_wmst", | ||
"fieldNameGeometry": "geometry", | ||
"maxFeatures": 10000, | ||
"version": "2.0.0", | ||
"outputFormat": "geojson", | ||
"outputFormatDownload": "shp" | ||
} | ||
}, | ||
{ | ||
"name": "edu sans filtre", | ||
"visible": false, | ||
"id": "edu sans filtre", | ||
"title": "edu sans filtre", | ||
"type": "wfs", | ||
"minScaleDenom": 200000, | ||
"maxScaleDenom": 5000000, | ||
"source": { | ||
"url": "https://infogeo.education.gouv.qc.ca/arcgis/services/DonneesOuvertes/SW_MEES/MapServer/WFSServer", | ||
"featureTypes": "Établissement_privé", | ||
"fieldNameGeometry": "SHAPE", | ||
"maxFeatures": 10000, | ||
"version": "2.0.0", | ||
"outputFormat": "text/xml; subType=gml/3.1.1" | ||
} | ||
}, | ||
{ | ||
"name": "edu avec filtre", | ||
"visible": false, | ||
"id": "edu avec filtre", | ||
"title": "edu avec filtre", | ||
"type": "wfs", | ||
"minScaleDenom": 200000, | ||
"maxScaleDenom": 5000000, | ||
"source": { | ||
"url": "https://infogeo.education.gouv.qc.ca/arcgis/services/DonneesOuvertes/SW_MEES/MapServer/WFSServer", | ||
"featureTypes": "Établissement_privé", | ||
"fieldNameGeometry": "SHAPE", | ||
"maxFeatures": 10000, | ||
"version": "2.0.0", | ||
"outputFormat": "text/xml; subType=gml/3.1.1" | ||
|
||
}, | ||
"filters": {"operator": "PropertyIsLike", "propertyName": "Code_d_organisme", "pattern": "01*"} | ||
} | ||
|
||
], | ||
"toolbar": [ | ||
"searchResults", | ||
"mapDetails", | ||
"timeAnalysis", | ||
"contextManager", | ||
"print" | ||
], | ||
|
||
"tools": [ | ||
{ | ||
"name": "searchResults" | ||
}, | ||
{ | ||
"name": "mapDetails" | ||
}, | ||
{ | ||
"name": "timeAnalysis" | ||
}, | ||
{ | ||
"name": "contextManager" | ||
}, | ||
{ | ||
"name": "print" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 16 additions & 3 deletions
19
src/lib/datasource/shared/datasources/wfs-datasource.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
import { FeatureDataSourceOptions, FeatureDataSourceContext } from './feature-datasource.interface'; | ||
|
||
export interface WFSDataSourceOptions extends FeatureDataSourceOptions {} | ||
import { IgoOgcFilterObject } from '../../../filter'; | ||
import { DataSourceOptions, DataSourceContext } from './datasource.interface'; | ||
|
||
export interface WFSDataSourceContext extends FeatureDataSourceContext {} | ||
|
||
export interface WFSDataSourceOptions extends DataSourceOptions, olx.source.VectorOptions { | ||
version?: string; | ||
url: string; | ||
featureTypes: string; | ||
fieldNameGeometry: string; | ||
maxFeatures?: Number; | ||
outputFormat?: string; | ||
outputFormatDownload?: string; | ||
srsname?: string; | ||
filters?: IgoOgcFilterObject; | ||
} | ||
|
||
export interface WFSDataSourceContext extends DataSourceContext, WFSDataSourceOptions {} |
Oops, something went wrong.