Skip to content

Commit

Permalink
Use self-reported URLs for all WFS operations
Browse files Browse the repository at this point in the history
  • Loading branch information
ejn committed Sep 24, 2024
1 parent 11a22aa commit e28b815
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/wfs/endpoint.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ describe('WfsEndpoint', () => {
outputFormat: 'application/gml+xml; version=3.2',
})
).toEqual(
'https://my.test.service/ogc/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Ahierarchisation_l&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&COUNT=200'
'https://www.pigma.org/geoserver/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Ahierarchisation_l&OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&COUNT=200'
);
});
it('returns a GetFeature requesting geojson url for a given feature type', () => {
Expand All @@ -454,7 +454,7 @@ describe('WfsEndpoint', () => {
asJson: true,
})
).toEqual(
'https://my.test.service/ogc/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Acomptages_routiers_l&OUTPUTFORMAT=application%2Fjson'
'https://www.pigma.org/geoserver/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Acomptages_routiers_l&OUTPUTFORMAT=application%2Fjson'
);
});
it('returns a GetFeature with a bbox and output crs for a given feature type', () => {
Expand All @@ -464,7 +464,7 @@ describe('WfsEndpoint', () => {
outputCrs: 'EPSG:2154',
})
).toEqual(
'https://my.test.service/ogc/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Ahierarchisation_l&SRSNAME=EPSG%3A2154&BBOX=1%2C2%2C3%2C4'
'https://www.pigma.org/geoserver/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=cd16%3Ahierarchisation_l&SRSNAME=EPSG%3A2154&BBOX=1%2C2%2C3%2C4'
);
});
it('throws an error if the feature type was not found', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/wfs/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ export default class WfsEndpoint {
return useCache(
() => {
const describeUrl = generateDescribeFeatureTypeUrl(
this._capabilitiesUrl,
this.getOperationUrl('DescribeFeatureType'),
this._version,
name
);
const getFeatureUrl = generateGetFeatureUrl(
this._capabilitiesUrl,
this.getOperationUrl('GetFeature'),
this._version,
name,
undefined,
Expand Down Expand Up @@ -310,7 +310,7 @@ export default class WfsEndpoint {
);
}
return generateGetFeatureUrl(
this._capabilitiesUrl,
this.getOperationUrl('GetFeature'),
this._version,
internalFeatureType.name,
format,
Expand Down

0 comments on commit e28b815

Please sign in to comment.