I wanted to create a square cell on a map with size 500m times 500m. Therefore, I wrote the following code:
from pyproj import Transformer
bl_lat, bl_lon = 40.64423086189233, -74.0307935018417
trans_coord_to_meter = Transformer.from_crs('epsg:4326', 'epsg:3857')
bl_t = trans_coord_to_meter.transform(bl_lat, bl_lon)
print(trans_coord_to_meter.transform(bl_t[0], bl_t[1], direction='INVERSE')) # blue
# 40.64423086189233, -74.0307935018417 (lat, lon)
print(trans_coord_to_meter.transform(bl_t[0]+500, bl_t[1], direction='INVERSE')) # red, + x_axis
# 40.64423086189233, -74.02630192542111
print(trans_coord_to_meter.transform(bl_t[0], bl_t[1]-500, direction='INVERSE')) # green, - y_axis
# 40.640822707278815, -74.0307935018417
print(trans_coord_to_meter.transform(bl_t[0]+500, bl_t[1]-500, direction='INVERSE')) # yellow, + x and y axis
I thought that this adds 500m in both dimensions (maybe I misunderstood the function). But, when I check the result, I observed the following:
So, how do I really get points an actual distance of 500m in between? (for x and y)
I want to keep using Python, but I'm flexible with the library.