Mercurial > gemma
comparison client/src/application/lib/geo.js @ 1020:e89be4af3a9f
restructure surveyrequest
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 24 Oct 2018 10:56:41 +0200 |
parents | ca628dce90dd |
children | dd67e46366ef |
comparison
equal
deleted
inserted
replaced
1019:ca628dce90dd | 1020:e89be4af3a9f |
---|---|
17 * | 17 * |
18 * Distance calculations | 18 * Distance calculations |
19 * JS transposition of cross.go functions | 19 * JS transposition of cross.go functions |
20 * | 20 * |
21 */ | 21 */ |
22 | |
23 import { GeoJSON } from "ol/format.js"; | |
24 import Feature from "ol/Feature"; | |
22 | 25 |
23 const EARTHRADIUS = 6378137.0; | 26 const EARTHRADIUS = 6378137.0; |
24 | 27 |
25 /** | 28 /** |
26 * Converts to radiant | 29 * Converts to radiant |
158 minAlt: minAlt, | 161 minAlt: minAlt, |
159 maxAlt: maxAlt | 162 maxAlt: maxAlt |
160 }; | 163 }; |
161 }; | 164 }; |
162 | 165 |
163 export { prepareProfile }; | 166 const generateFeatureRequest = (profileLine, survey) => { |
167 const feature = new Feature({ | |
168 geometry: profileLine, | |
169 bottleneck: survey.bottleneck_id, | |
170 date: survey.date_info | |
171 }); | |
172 return new GeoJSON({ geometryName: "geometry" }).writeFeature(feature); | |
173 }; | |
174 | |
175 export { generateFeatureRequest, prepareProfile }; |