koopjs / koop-provider-elasticsearch

A provider for koop that can connect to one or more elastic search instances and turn indices/aliases into individual feature services.
Apache License 2.0
13 stars 4 forks source link

Query: How to specify/change CRS for geo_point #51

Closed zakhtar1998 closed 2 years ago

zakhtar1998 commented 2 years ago

Hello,

Does anyone know how to change the Coordinate Reference System for geo_point fields.

I know that we can do it for geo_shape something like: geometry: feature.geometry ? { type: 'Polygon', coordinates: [(feature.geometry.rings || [[]])[0].map(coordinates => proj4('EPSG:3857', 'EPSG:4326', coordinates))] } : null }));

But if i have my geo_point like this: geometry: !!feature.attributes?.LATITUDE && !!feature.attributes?.LONGITUDE ? { lat: feature.attributes?.LATITUDE, lon: feature.attributes?.LONGITUDE } : null

How can i specify the projection for the geo_point because when reading the geohash i am getting the following: WARNING: [object Object] is not a valid spatial reference; defaulting to none WARNING: spatial reference "[object Object]" could not be normalized. Defaulting to EPSG:4326.