Friday, 5 November 2021

Convert coordinates to corresponding place in table

I have a table with data of an area from west europe. I want to convert coordinates to a value in this table. The problem is similar to this question, but I'm not sure how to work this out as I've never done something similar like this.

Let's say I want to get the value in the table for Amsterdam (lat: 52.35, long: 4.83). How would I convert that into the proper x and y values in the table? I first tried linear interpolation but found out that doesn't work because of the projection. I know of proj4js but I'm unsure how to define these values for the projection.

Per the docs I'm guessing I need to do something like this:

const firstProjection = "something something";
const secondProjection = "WGS84"; // ?
proj4(firstProjection, secondProjection, [52.35, 4.83]);
// [x?, y?]

area



from Convert coordinates to corresponding place in table

No comments:

Post a Comment