convert coordinate to point, angular, openlayers

Viewed 112

Data from me; coordinateX: 4833590.9447487565 coordinateY: 3395367.0520476755 in this way. When I click on a point on the map, the getCoord() function runs and gives me the above data. But I need to keep it in geomwkt form. because I'm prompted to call it in the following structure.

The following function getCoord()

  getCoord(event: any){

   var coordinate = this.map.getEventCoordinate(event);
   this.xCoordinate=transform(coordinate, 'EPSG:3857', 'EPSG:4326')[0];
   this.yCoordinate=transform(coordinate, 'EPSG:3857', 'EPSG:4326')[1];
   console.log(this.xCoordinate);
   console.log(this.yCoordinate);

}

public async Task<List<KadastroParselModel>> ListParselAsync(string geomWkt)
    {

        List<KadastroParselModel> result = new List<KadastroParselModel>();
        try
        {
            IGeometry tempGeom = geomWkt.ToGeometry();
            if(!tempGeom.IsValid){
                tempGeom= tempGeom.Centroid;
            }
            using (IntegrationTestContext context = new IntegrationTestContext())
            {
                try
                {
                    //var xx=await context.ST_InterSects(geomWkt);
                    
                    result = (await context.ST_InterSects(geomWkt)).ToKadastroParselModel();
                    // var rresult = await context.KadastroParsel.
                }
                catch (Exception e)
                {
                    throw new Exception("Veritabanına ulaşım sırasında hata oluştu.. :" + e.Message);
                }
            }
        }
        catch (Exception e)
        {
            return result;
        }


        return result;
    }
0 Answers
Related