@@ -58,7 +58,7 @@ func (s *Search) Search() http.HandlerFunc {
5858 engine .RenderProblem (engine .ProblemBadRequest , w , err .Error ())
5959 return
6060 }
61- collections , searchTerms , outputSRID , bbox , bboxSRID , limit , err := parseQueryParams (r .URL .Query ())
61+ collections , searchTerms , outputSRID , outputCRS , bbox , bboxSRID , limit , err := parseQueryParams (r .URL .Query ())
6262 if err != nil {
6363 engine .RenderProblem (engine .ProblemBadRequest , w , err .Error ())
6464 return
@@ -77,7 +77,7 @@ func (s *Search) Search() http.HandlerFunc {
7777 handleQueryError (w , err )
7878 return
7979 }
80- if err = s .enrichFeaturesWithHref (fc ); err != nil {
80+ if err = s .enrichFeaturesWithHref (fc , outputCRS ); err != nil {
8181 engine .RenderProblem (engine .ProblemServerError , w , err .Error ())
8282 return
8383 }
@@ -94,7 +94,8 @@ func (s *Search) Search() http.HandlerFunc {
9494 }
9595}
9696
97- func (s * Search ) enrichFeaturesWithHref (fc * domain.FeatureCollection ) error {
97+ //nolint:nestif
98+ func (s * Search ) enrichFeaturesWithHref (fc * domain.FeatureCollection , outputCRS string ) error {
9899 for _ , feat := range fc .Features {
99100 collectionID , ok := feat .Properties [domain .PropCollectionID ]
100101 if ! ok || collectionID == "" {
@@ -114,6 +115,10 @@ func (s *Search) enrichFeaturesWithHref(fc *domain.FeatureCollection) error {
114115 }
115116 href += "?f=json"
116117
118+ if outputCRS != "" {
119+ href += "&crs=" + outputCRS
120+ }
121+
117122 // add href to feature both in GeoJSON properties (for broad compatibility and in line with OGC API Features part 5) and as a Link.
118123 feat .Properties [domain .PropHref ] = href
119124 feat .Links = []domain.Link {
0 commit comments