Projection Architecture - fgpv-vpgf/geoApi GitHub Wiki
The Projection section handles the projecting of geometries from one spatial reference to another.
We will support two types of projection services: the ESRI ArcGIS Server Geometry Service and the proj4 javascript library.
Projection function input parameters (names, order, and format TBD)
- Array of geometries to be projected. Will be in format of the Mapping API used by geoApi (currently ESRI).
- Target spatial reference to project to. Format in ESRI Native object for simplicity (alternately wrapped objects?)
- Projection method. Choice of proj4, ESRI server, or auto (would pick best service -- proj4 if no server url, server if spatial reference is not available for proj4)
- Server URL. Required only if using ESRI Projection Service
Output will be a promise (TODO verify) that returns an array of projected geometries (in same order as input) when fulfilled.
When using the proj4 option, the input geometry will be converted from ESRI format to GeoJSON format using the terraformer library, which is included in our build of proj4