小编Luc*_*ual的帖子

如何在Python中从中心点创建坐标网格?

有没有一种方法可以从中心坐标中提取坐标网格(紫色点),例如每个坐标之间的距离为 100 米?

在此输入图像描述

例如输入纬度和经度中心坐标(红点):

lat = 40.8264859
lon = -3.6805897
Run Code Online (Sandbox Code Playgroud)

在一个函数中,该函数返回一个列表或数组的列表,其中包含相应的纬度、经度网格,彼此相距 100 米,以及距中心点的最大坐标数(在此图像情况下,该值将为2)。例如:

def get_grid_of_coordinates_from_center(lat, lon, meters_between_coor, coors_away_from_center):
    ...
    return list_of_lists
Run Code Online (Sandbox Code Playgroud)

python numpy python-3.x shapely pyproj

6
推荐指数
2
解决办法
6412
查看次数

将 ipywidget 按钮居中对齐

我希望将 ipywidget 函数中的按钮对象与中心对齐。这是我正在使用的代码示例

bt = widgets.Button(layout=Layout(width='180px'),style = 
    {'description_width': '25%'})
b_config_save = widgets.Button(
    description="Save",
    layout=bt.layout,
    style=bt.style,
    button_style='primary'
)
Run Code Online (Sandbox Code Playgroud)

python ipywidgets

3
推荐指数
1
解决办法
3164
查看次数

标签 统计

python ×2

ipywidgets ×1

numpy ×1

pyproj ×1

python-3.x ×1

shapely ×1