feat: cache geojson data for vector files
This commit is contained in:
@@ -304,11 +304,11 @@ func (h *DatasetHandler) get(w http.ResponseWriter, r *http.Request) {
|
||||
httputil.WriteJSON(w, http.StatusOK, dataset)
|
||||
}
|
||||
|
||||
// geojson returns the dataset as a GeoJSON FeatureCollection (RFC 7946). A
|
||||
// vector_with_kato dataset always ignores its own geometry and instead joins the
|
||||
// districts table on KATO code: one feature per KATO with the observation values
|
||||
// mapped onto its district polygon. A plain vector dataset serves its own
|
||||
// geometry as a single feature.
|
||||
// geojson returns the dataset's pre-assembled GeoJSON FeatureCollection (RFC
|
||||
// 7946), generated and stored at processing time. A vector_with_kato dataset's
|
||||
// collection joins the districts table on KATO code (one feature per KATO with
|
||||
// the observation values mapped onto its district polygon); a plain vector
|
||||
// dataset's collection wraps its own geometry as a single feature.
|
||||
func (h *DatasetHandler) geojson(w http.ResponseWriter, r *http.Request) {
|
||||
id, ok := parseUUIDParam(w, r, "id")
|
||||
if !ok {
|
||||
@@ -321,7 +321,7 @@ func (h *DatasetHandler) geojson(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/geo+json")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
_ = json.NewEncoder(w).Encode(fc)
|
||||
_, _ = w.Write(fc)
|
||||
}
|
||||
|
||||
func (h *DatasetHandler) download(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user