Update girds

update cells set grid_id = cast(floor((y(geom)-2575200)/5)*25160+floor((x(geom)-12572400)/5)+1 as integer);

update grid5 set grid_id = cast(floor((y(center)-2575200)/5)*25160+floor((x(center)-12572400)/5)+1 as integer);

gleft   = 112.940000000           # 原点x

gbottom = 22.53000000             # 原点y

gright  = 114.07000000            # 右边界

gtop    = 23.95000000000          # 上边界

step    = 12.50000000000          # 网格中心点步距(单位:米)

lng2km  = 102.70000000            # 从经度换算到公里

lat2km  = 111.70000000            # 从纬度换算到公里

lngstep = step/1000/lng2km        # 步距换算成经度  //0.000121713729308666

latstep = step/1000/lat2km        # 步距换算成纬度  //0.000111906893464637


ngalaxylngs=((gright-gleft)/lngstep).floor   # 9284

ngalaxylats=((gtop-gbottom)/latstep).floor   # 12689






你可能感兴趣的:(update)