GF1信息整理

news/2024/11/15 17:30:20/

GF1卫星信息整理

  • 高分1号
  • 高分1 BCD星
  • pitch yaw roll解析
  • 经纬度坐标生成多边形kml,shp文件
  • aircas内网上GF1号卫星命名方式,metadata里是否包含satellite roll angel(matlab程序)
  • GDAL bigtiff
  • 注册中国资源卫星应用中心
  • 爬取数据遥感所内网影像的程序
    • 第一步:爬取遥感所内网的影像:
    • 第二步 预处理等步骤(matlab)
    • 第三步 修改名称
    • 第四步 选取符合条件的影像对(matlab)
  • 爬取自然资源卫星应用中心
    • 第一步 爬取影像,meta .html
    • 第二步 对爬取的数据提取有用的表格里面的信息(meta信息),并为选取合适的影像对做准备
  • matlab对txt文件字符串替换,改文件后缀名
  • 遥感所内网等需按区域所需要的shp文件怎么设置
  • 大兴安岭VS大兴安岭地区
  • 大兴安岭光学影像(google_earth地图)
  • arcgis如何创建dxalshapfile文件:
  • arcgis 怎么显示图层特征(多边形名称)
  • matlab
    • 运算符且 或 等
    • matlab日期相减(相差几天)
  • UTM坐标系的相关内容
  • python一些技巧
  • cmd进入D

仅做自己记录

高分1号

https://www.sohu.com/a/202609956_637217
在这里插入图片描述

高分1 BCD星

https://www.jianshu.com/p/df4a5c5e4f58

在这里插入图片描述

pitch yaw roll解析

https://blog.csdn.net/guyubit/article/details/52995676
在这里插入图片描述

经纬度坐标生成多边形kml,shp文件

使用simplekml的python库
参考网址:https://www.cnpython.com/qa/505798
https://www.pythonheidong.com/blog/article/1066606/52d6eba4bde63a9416a2/
https://vimsky.com/examples/detail/python-method-simplekml.Kml.html
http://cn.voidcc.com/question/p-gkrkfdha-ma.html
https://www.cnpython.com/qa/119407
https://www.zhihu.com/zvideo/1347226150465306624

安装simplekml库
https://blog.csdn.net/qq_16583687/article/details/68951790
https://www.cnpython.com/pypi/simplekml/dl-simplekml-1.3.5-py3-none-any.whl

aircas内网上GF1号卫星命名方式,metadata里是否包含satellite roll angel(matlab程序)

(1)命名方式:

(2)检查meta data是否包含satellite roll angel

fclose all
clear all
clcfilepath='F:\GF\GF-1_ininternet\GF1_yao\';
files = dir(filepath);
size0 = size(files);
length = size0(1);
%names = files(3:length);
%class_num = size(names);
for i=3:lengthfileName = strcat(filepath,files(i,1).name); names(:,:,i-2) = char(fileName);
end
class_num = size(names);
for j=1:class_num(3)
xml_file=dir([[names(1,:,j),'\'],'*.meta.xml']);
% read xml file
xmlDoc = xmlread([xml_file.folder,'\',xml_file.name]);
%read RollSatelliteAngel
phone_array = xmlDoc.getElementsByTagName('RollSatelliteAngle');
phone = phone_array.item(0);
% does the meta file have the rollsatelliteangel? 
if isempty(phone)==0  % yes,it does.  print the file name into the have_yaw_angel.txt
%disp(char(phone.getTextContent()));
fid=fopen('D:\have_yaw_angel.txt','a');
fprintf(fid,'%7s %7s\r\n',xml_file.name,char(phone.getTextContent()) );
fclose(fid);
else % no ,print the file name into the dont_have_yaw_angel.txt
fid=fopen('D:\dont_have_yaw_angel.txt','a');
fprintf(fid,'%7s\r\n',xml_file.name);
fclose(fid);   
endend

GDAL bigtiff

(1)简单理解是:bigtiff是tiff的变种,适用于影像大于4GB的情况。
参考链接:https://blog.csdn.net/u014311125/article/details/105778268
官方链接(推荐):https://gdal.org/drivers/raster/gtiff.html

注册中国资源卫星应用中心

http://36.112.130.153:7777/DSSPlatform/shirologin.html
因为注册需要填很多信息,包括一些并不知道怎么填的必填信息,像下面红框里的。后来,因为自己属于空天院,发现空天院的这方面信息都是公开可获得的。
空天院电话:010-82177608
传真:010-82178009
空天院单位全称:中国科学院空天信息创新研究院
组织机构代码:12100000MB1E85344J在这里插入图片描述

爬取数据遥感所内网影像的程序

https://blog.csdn.net/qq_34965596/article/details/102814192
https://www.sojson.com/simple_json.html

https://blog.csdn.net/weixin_42210687/article/details/103480208

第一步:爬取遥感所内网的影像:

from pprint import pprintimport requests  # 导入requests包
import json
import timedef get_date(num=None):headers = {'User-Agent': "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36",'Accept-Language': "zh-CN,zh;q=0.9",'Cookie': 'td_cookie=1800153597; JSESSIONID=52F8F0201F668756C78BF7413FB86365; td_cookie=1793278618; _pk_ref.34.ff60=%5B%22%22%2C%22%22%2C1636641473%2C%22http%3A%2F%2Flogindataservices.ceode.ac.cn%2Fweb%2Fuserreg%22%5D; _pk_testcookie.34.ff60=1; _pk_id.34.ff60=63fbe21024296aab.1635731779.31.1636641473.1636641473.; _pk_ses.34.ff60=1'}url = 'http://ids.ceode.ac.cn/gfds/contract/query/list'From_data = {"fromDate": "2013-04-26","toDate": "2021-11-03","symbol": "","querytimemode": "imagetime","imagemode": "","orbitsense": "","NAD": "1","FWD": "1","BWD": "1","productid": "","productlevel": "","cloudcoveravg": "0.5","pageSize": num,"pageNumber": "1","sortName": "begintime","sortOrder": "desc","sensorlist[]": "'GF01';'PA1', 'PA2', 'PM1', 'PM2'",#"sensorlist[]": "'GF01';'PM1', 'PM2'",#"sensorlist[]":"'GF1BCD';'PAN'",#"sensorlist[]": "'GF01';'PA1', 'PA2', 'PM1', 'PM2'","area_id": "0","spatialClause": '{"type":"polygon","coordinates":[[[120.68392676506365,49.53215484219334],[119.43148535881399,50.70149673127322],[120.11263770256382,51.76086468296725],[120.61800879631369,52.07257906055418],[120.48617285881372,52.48929742611664],[119.82699317131389,52.55614336917213],[120.0906650463138,52.92860329922983],[121.29916114006349,53.57276965872703],[123.82601660881282,53.65098156977507],[125.6058017650624,53.166363216326765],[126.48470801506215,52.68953025731929],[126.74837989006208,51.99147086180133],[126.96810645256203,51.44698331765673],[124.28744239006274,48.45087722164997],[122.09017676506332,46.187240137132555],[120.02474707756386,46.1568082068753],[119.62923926506397,46.732136323857574],[119.18978614006409,47.83509275112183],[120.50814551506373,49.317775795934246],[120.68392676506365,49.53215484219334]]]}'#"spatialClause": '{"type": "polygon", "coordinates": [[[113.3593749999949, 42.127005882097244], [115.6445312499943, 42.127005882097244],[115.6445312499943, 40.67673648795837], [113.3593749999949, 40.67673648795837],[113.3593749999949, 42.127005882097244]]]}'}# 请求表单数据response = requests.post(url, data=From_data, headers=headers, verify=False)# response = requests.post(url, headers=headers, verify=False)# response = requests.post(url, verify=False)# 将Json格式字符串转字典print(response.raw)content = json.loads(response.text)# content = response.textpprint(content)# with open("./data.txt", "w") as f:#     f.write(str(content))temp_num_data=content['rows']for i, meta in enumerate(temp_num_data[2426:2427]):#for i, meta in enumerate(content['rows']):m_url = 'http://ids.ceode.ac.cn/gfds' + meta['metafilename']time.sleep(0.1)res = requests.get(url=m_url, headers=headers)print(res.text)# 把所有获取的meta信息写入到一个meta_data.txt文件里面#with open('meta_data.txt', 'a', encoding='utf-8') as f:#    f.writelines("第{}个:\n".format(i + 1))#    f.write(res.text)#    f.writelines("")#把所有获取的meta信息写入到不同的txt文件里。文件命名为影像的id。my_str = meta['metafilename']strlist = my_str.split('/')  # 用逗号分割str字符串,并保存到列表#print(strlist[4])temp_meta_file_name =strlist[4]+ '.txt'with open(temp_meta_file_name, 'w', encoding='utf-8') as f:#f.writelines("第{}个:\n".format(i+1))f.write(res.text)f.writelines("")if __name__ == '__main__':get_date(2426)

第二步 预处理等步骤(matlab)

%第一部分:将获取的txt文件中一些特定字符改为xml的字符  <   >
%第二部分:将txt文件后缀名改为xml
%第三部分:将这些所有的txt文件,改为后缀为xml的文件
%第四部分:将所有的文件按是否包含RollSatelliteAngle开
%第五部分:提取所有影像元数据信息,并以 经度_纬度_年月日_SatelliteRollAngel_影像原始文件名记录下来。
clc
clear all
close all
%% 将获取的txt文件中一些特定字符改为xml的字符  <   >
file_path='D:\dxal_polygon_search\dxal_search3\';
files = dir(file_path);
size0 = size(files);
length = size0(1);
for i=3:lengthfileName = strcat(file_path,files(i,1).name); fid=fopen(fileName);count=1;str=[];
while ~feof(fid)tline = fgetl(fid);str{count}=tline;count=count+1;
end
fclose(fid);for j=1:(count-1)str{j}=strrep(str{j},'&lt;','<');str{j}=strrep(str{j},'?&gt;','?>');str{j}=strrep(str{j},'&gt;','>'); 
end
%% 把替换好的str写入到原来txt文件里。fid=fopen(fileName,'w');
for z=1:(count-1)fprintf(fid,'%7s\r\n',str{z});
end
fclose(fid);
%% 将这些所有的txt文件,改为后缀为xml的文件
newName=[fileName(1:end-4) '.xml'];
movefile(fileName,newName);%移入新扩展名的文件中
end%% 按metadata是否包含RollSatelliteAngle分为两部分
files = dir(file_path);
size0 = size(files);
length = size0(1);
%names = files(3:length);
%class_num = size(names);
% for i=3:length
%    fileName = strcat(filepath,files(i,1).name); 
%    names(:,:,i-2) = char(fileName);
% end
% class_num = size(names);
xml_file=dir([file_path,'*.xml']);for p=1:length-2
xmlDoc = xmlread([xml_file(p).folder,'\',xml_file(p).name]);
% read xml file
%xmlDoc = xmlread([char(p),'.xml']);
%read RollSatelliteAngel
phone_array = xmlDoc.getElementsByTagName('RollSatelliteAngle');
phone = phone_array.item(0);
% does the meta file have the rollsatelliteangel? 
if isempty(phone)==0  % yes,it does.  print the file name into the have_yaw_angel.txt
%disp(char(phone.getTextContent()));
%fid=fopen('D:\dxal_polygon_search\dxal_search1\have_yaw_angel.txt','a');
fid=fopen([file_path,'have_yaw_angel.txt'],'a')
fprintf(fid,'%7s\r\n',xml_file(p).name);
fclose(fid);
else % no ,print the file name into the dont_have_yaw_angel.txt
%fid=fopen('D:\dxal_polygon_search\dxal_search1\dont_have_yaw_angel.txt','a');
fid=fopen([file_path,'dont_have_yaw_angel.txt'],'a');
fprintf(fid,'%7s\r\n',xml_file(p).name);
fclose(fid);   
end
end
%% 第五部分:提取所有影像元数据信息,并以 经度_纬度_年月日_SatelliteRollAngel_影像原始文件名记录下来。
% 逐行读取txt文件的内容

第三步 修改名称

% 将有roll角的GF1影像按着经度_纬度_年月日_StelliteRollAngel_影像id 记录下来
fclose all
clear all
clcfile_path='D:\dxal_polygon_search\dxal_search3\';
%fid = fopen('D:\matlab测试\have_yaw_angel.txt');
fid = fopen([file_path,'have_yaw_angel.txt']);
tline = fgetl(fid);
i=0;
while ischar(tline)
i=i+1;
%disp(tline);
xml_file_name=[file_path,tline];
%xmlDoc=xmlread('D:\matlab测试\GF01_PA2_041390_20201230_MY941_01_035_L1A_01.xml');
xmlDoc=xmlread(xml_file_name);
% name node
SceneCenterLat = xmlDoc.getElementsByTagName('SceneCenterLat');
SceneCenterLat_num = char(SceneCenterLat.item(0).getTextContent());
%disp(['SceneCenterLat:' SceneCenterLat_num]);
SceneCenterLong = xmlDoc.getElementsByTagName('SceneCenterLong');
SceneCenterLong_num = char(SceneCenterLong.item(0).getTextContent());
%disp(['SceneCenterLong:' SceneCenterLong_num]);
ProductID = xmlDoc.getElementsByTagName('ProductID');
ProductID_num = char(ProductID.item(0).getTextContent());
%disp(['ProductID:' ProductID_num]);
RollSatelliteAngle = xmlDoc.getElementsByTagName('RollSatelliteAngle');
RollSatelliteAngle_num = char(RollSatelliteAngle.item(0).getTextContent());
%disp(['RollSatelliteAngle:' RollSatelliteAngle_num]);
image_get_time=strsplit(ProductID_num,'_');
need_record_info=[SceneCenterLong_num,'_',SceneCenterLat_num,'_',char(image_get_time(4)),'_',RollSatelliteAngle_num,'_',ProductID_num];
%disp(need_record_info);%have_roll_angel_image_txt=fopen('D:\matlab测试\have_roll_angel_image.txt','a');
have_roll_angel_image_txt=fopen([file_path,'have_roll_angel_image.txt'],'a');
fprintf(have_roll_angel_image_txt,'%7s\r\n',need_record_info);
fclose(have_roll_angel_image_txt); 
tline = fgetl(fid);
disp(i);
end
fclose(fid);

第四步 选取符合条件的影像对(matlab)

% 筛选可能合适的影像对   按位置进行筛选
fclose all
clear all
clcfile_path='D:\dxal_polygon_search\dxal_search1\';
%fid1 = fopen('D:\matlab测试\have_roll_angel_image.txt');
fid1 = fopen([file_path,'have_roll_angel_image.txt']);
tline1 = fgetl(fid1);
yuzhi_lon=0.1;
yuzhi_lat=0.1;
num_file1=0;
count=0;
file1_count=0;
load_file1=load([file_path,'have_roll_angel_image.txt']);
size_file1=size(load_file1);
while ischar(tline1)if file1_count > size_file1(1)/2+1breakend%disp(tline1);num_file1=num_file1+1;file1_info=strsplit(tline1,'_');file1_lon=str2num(char(file1_info(1)));file1_lat=str2num(char(file1_info(2)));file1_roll_angel=str2num(char(file1_info(4)));%fid2=fopen('D:\matlab测试\have_roll_angel_image_copy.txt');fid2=fopen([file_path,'have_roll_angel_image_copy.txt']);tline2=fgetl(fid2);num_file2=0;while ischar(tline2)num_file2=num_file2+1;file2_info=strsplit(tline2,'_');file2_lon=str2num(char(file2_info(1)));file2_lat=str2num(char(file2_info(2)));file2_roll_angel=str2num(char(file2_info(4)));deta_lon=abs(file1_lon-file2_lon);deta_lat=abs(file1_lat-file2_lat);deta_roll_angel=abs(file1_roll_angel-file2_roll_angel);
%         if num_file1 ~= num_file2
%             if deta_lon < yuzhi_lon
%                 if deta_lat <yuzhi_lat
%                     if deta_roll_angel > 5 
%                        %record_fid=fopen('D:\matlab测试\possible_image_pairs.txt','a');
%                         record_fid=fopen([file_path,'possible_image_pairs.txt'],'a');
%                         fprintf(record_fid,'%7s %7s\r\n',tline1,tline2);
%                         fclose(record_fid);  
%                     end
%                 end                  
%             end
%         endif num_file1 ~= num_file2 && deta_lon < yuzhi_lon && deta_lat<yuzhi_lat && deta_roll_angel >20%record_fid=fopen([file_path,'possible_image_pairs.txt'],'a');record_fid=fopen([file_path,'possible_rollangel_gt25_image_pairs.txt'],'a');fprintf(record_fid,'%7s %7s\r\n',tline1,tline2);fclose(record_fid);% %             count=count+1;
%               if strcmp(char(file1_info(5)),'GF01')==1
%                   need_download_file1=[char(file1_info(5)),'_',char(file1_info(6)),'_',char(file1_info(7)),'_',char(file1_info(8)),'_',char(file1_info(9)),'_',char(file1_info(10)),'_',char(file1_info(11)),'_',char(file1_info(12)),'_',char(file1_info(13))];
%               else
%                   need_download_file1=[char(file1_info(5)),'_',char(file1_info(6)),'_',char(file1_info(7)),'_',char(file1_info(8)),'_',char(file1_info(9)),'_',char(file1_info(10)),'_',char(file1_info(11)),'_',char(file1_info(12))];
% 
%               end
%               if strcmp(char(file2_info(5)),'GF01')==1
%                   need_download_file2=[char(file2_info(5)),'_',char(file2_info(6)),'_',char(file2_info(7)),'_',char(file2_info(8)),'_',char(file2_info(9)),'_',char(file2_info(10)),'_',char(file2_info(11)),'_',char(file2_info(12)),'_',char(file2_info(13))];
%               else
%                   need_download_file2=[char(file2_info(5)),'_',char(file2_info(6)),'_',char(file2_info(7)),'_',char(file2_info(8)),'_',char(file2_info(9)),'_',char(file2_info(10)),'_',char(file2_info(11)),'_',char(file2_info(12))];
% 
%               end
%                   
%              need_download_fid=fopen([file_path,'need_download_file.txt'],'a');
%              fprintf(need_download_fid,['%7s',',','%7s',','],need_download_file1,need_download_file2);
%              fclose(need_download_fid);endtline2=fgetl(fid2);endfclose(fid2);tline1 = fgetl(fid1);file1_count=file1_count+1;end
fclose(fid1);

爬取自然资源卫星应用中心

第一步 爬取影像,meta .html

(注意:此网站影像的命名规则,product id 唯一确定一张影像)

from pprint import pprintimport requests  # 导入requests包
import json
import time
import numpy as np
import re# 一些需要修改的变量
#v_Cookie='',
#v_url='http://36.112.130.153:7777/KQGis/rest/services/GF1/MapServer/Query',    #确定选取的是哪一种传感器类型的卫星(GF6  GF1  GF1B   GF1C   GF1D?)
#v_geometry='{"type":"PolyGon","rings":[[[120.20414115423888,49.322944195365714],[120.18512677602973,50.26088835965418],[119.3191010751725,50.674115594540396],[120.04640104167767,51.69577930222572],[120.61683238795649,52.14768164587974],[120.50274611870077,52.322794930483205],[120.56929644243314,52.51461829831373],[119.94182196152678,52.53201521454525],[119.9133003942128,52.78061077928981],[120.77845460273532,53.32480864660704],[122.35664799410607,53.55754345580476],[123.4214531738262,53.648019586215234],[125.89458996624718,53.077434565613764],[126.56009320357224,52.46625719403239],[127.20658206268797,51.08636216252175],[123.92739408734495,48.72900554611164],[122.04367450588052,46.28045687825926],[120.9647162826103,44.028602584693886],[118.11255955121747,42.955794538140765],[116.7340171310442,43.02558700023069],[116.87662496761368,44.062889677522996],[119.21047973633256,46.64274978636518],[119.44356602586743,48.22330866611077],[120.20414115423888,49.322944195365714]]]}'  #确定选取的区域,可是是shp,经纬度,图形框选等。
v_geometry='{"type":"PolyGon","rings":[[[120.20414115423888,49.322944195365714],[120.18512677602973,50.26088835965418],[119.3191010751725,50.674115594540396],[120.04640104167767,51.69577930222572],[120.61683238795649,52.14768164587974],[120.50274611870077,52.322794930483205],[120.56929644243314,52.51461829831373],[119.94182196152678,52.53201521454525],[119.9133003942128,52.78061077928981],[120.77845460273532,53.32480864660704],[122.35664799410607,53.55754345580476],[123.4214531738262,53.648019586215234],[125.89458996624718,53.077434565613764],[126.56009320357224,52.46625719403239],[127.20658206268797,51.08636216252175],[123.92739408734495,48.72900554611164],[122.04367450588052,46.28045687825926],[120.9647162826103,44.028602584693886],[118.11255955121747,42.955794538140765],[116.7340171310442,43.02558700023069],[116.87662496761368,44.062889677522996],[119.21047973633256,46.64274978636518],[119.44356602586743,48.22330866611077],[120.20414115423888,49.322944195365714]]]}'
#v_fields='UFJPRFVDVElELE9CSkVDVElELE1FVEFEQVRBSUQsU0FURUxMSVRFSUQsU0VOU09SSUQsUkVDRUlWRVNUQVRJT05JRCxTQ0VORURBVEUsQ0VOVEVSTE9OR0lUVURFLENFTlRFUkxBVElUVURFLFRPUExFRlRMT05HSVRVREUsVE9QTEVGVExBVElUVURFLFRPUFJJR0hUTE9OR0lUVURFLFRPUFJJR0hUTEFUSVRVREUsQk9UVE9NUklHSFRMT05HSVRVREUsQk9UVE9NUklHSFRMQVRJVFVERSxCT1RUT01MRUZUTE9OR0lUVURFLEJPVFRPTUxFRlRMQVRJVFVERSxUSFVNQkZJTEVMT0NBVElPTixCUk9XU0VGSUxFTE9DQVRJT04sU0NFTkVQQVRILFNDRU5FUk9XLElTUkVMRUFTRSxTQ0VORUlELFBST0RVQ1RMRVZFTCxTVFJJUElELERJUkVDVElPTixTSEFQRQ=='
v_fields='UFJPRFVDVElELE9CSkVDVElELE1FVEFEQVRBSUQsU0FURUxMSVRFSUQsU0VOU09SSUQsUkVDRUlWRVNUQVRJT05JRCxTQ0VORURBVEUsQ0VOVEVSTE9OR0lUVURFLENFTlRFUkxBVElUVURFLFRPUExFRlRMT05HSVRVREUsVE9QTEVGVExBVElUVURFLFRPUFJJR0hUTE9OR0lUVURFLFRPUFJJR0hUTEFUSVRVREUsQk9UVE9NUklHSFRMT05HSVRVREUsQk9UVE9NUklHSFRMQVRJVFVERSxCT1RUT01MRUZUTE9OR0lUVURFLEJPVFRPTUxFRlRMQVRJVFVERSxUSFVNQkZJTEVMT0NBVElPTixCUk9XU0VGSUxFTE9DQVRJT04sU0NFTkVQQVRILFNDRU5FUk9XLElTUkVMRUFTRSxTQ0VORUlELFBST0RVQ1RMRVZFTCxTVFJJUElELERJUkVDVElPTixTSEFQRQ=='
#v_where='IGNsb3VkcGVyY2VudCA8PSAxIGFuZCBTQ0VORURBVEUgPiA9MjAyMTExMTUgYW5kIFNDRU5FREFURSA8PTIwMjExMTE2IGFuZCBzZW5zb3JpZCBpbignUE1TMScsJ1BNUzInKSBhbmQgSVNSRUxFQVNFID0gJ1RSVUUn'
v_where='IGNsb3VkcGVyY2VudCA8PSAxIGFuZCBTQ0VORURBVEUgPiA9MjAxMzA0MjYgYW5kIFNDRU5FREFURSA8PTIwMjExMTE2IGFuZCBzZW5zb3JpZCBpbignUE1TMScsJ1BNUzInKSBhbmQgSVNSRUxFQVNFID0gJ1RSVUUn'
v_detail_url='http://36.112.130.153:7777/DSSPlatform/scene/sceneview.html'
v_sateliteid='GF1'
#v_sensorid= 'PMS1'
v_layers='WllXWC5NRVRBX0dGMV8x'def get_date(num=None):headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9','Accept-Encoding': 'gzip,deflate','Accept-Language': "zh-CN,zh;q=0.9",'Content-Length': '90','Content-Type': 'application/x-www-form-urlencoded','Host': '36.112.130.153:7777','Origin': 'http://36.112.130.153:7777','Proxy-Connection': 'keep-alive','User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36',}url = 'http://36.112.130.153:7777/KQGis/rest/services/GF1/MapServer/Query'From_data = {'base64': '1','page': '0','pageSize': num,'geometry':v_geometry,'fields':v_fields,'where':v_where,'layers':v_layers,#'geometry': '{"type":"PolyGon","rings":[[[120.20414115423888,49.322944195365714],[120.18512677602973,50.26088835965418],[119.3191010751725,50.674115594540396],[120.04640104167767,51.69577930222572],[120.61683238795649,52.14768164587974],[120.50274611870077,52.322794930483205],[120.56929644243314,52.51461829831373],[119.94182196152678,52.53201521454525],[119.9133003942128,52.78061077928981],[120.77845460273532,53.32480864660704],[122.35664799410607,53.55754345580476],[123.4214531738262,53.648019586215234],[125.89458996624718,53.077434565613764],[126.56009320357224,52.46625719403239],[127.20658206268797,51.08636216252175],[123.92739408734495,48.72900554611164],[122.04367450588052,46.28045687825926],[120.9647162826103,44.028602584693886],[118.11255955121747,42.955794538140765],[116.7340171310442,43.02558700023069],[116.87662496761368,44.062889677522996],[119.21047973633256,46.64274978636518],[119.44356602586743,48.22330866611077],[120.20414115423888,49.322944195365714]]]}',#'fields': 'UFJPRFVDVElELE9CSkVDVElELE1FVEFEQVRBSUQsU0FURUxMSVRFSUQsU0VOU09SSUQsUkVDRUlWRVNUQVRJT05JRCxTQ0VORURBVEUsQ0VOVEVSTE9OR0lUVURFLENFTlRFUkxBVElUVURFLFRPUExFRlRMT05HSVRVREUsVE9QTEVGVExBVElUVURFLFRPUFJJR0hUTE9OR0lUVURFLFRPUFJJR0hUTEFUSVRVREUsQk9UVE9NUklHSFRMT05HSVRVREUsQk9UVE9NUklHSFRMQVRJVFVERSxCT1RUT01MRUZUTE9OR0lUVURFLEJPVFRPTUxFRlRMQVRJVFVERSxUSFVNQkZJTEVMT0NBVElPTixCUk9XU0VGSUxFTE9DQVRJT04sU0NFTkVQQVRILFNDRU5FUk9XLElTUkVMRUFTRSxTQ0VORUlELFBST0RVQ1RMRVZFTCxTVFJJUElELERJUkVDVElPTixTSEFQRQ==',#'layers': 'WllXWC5NRVRBX0dGNl8x','unionGeometry': '1',#'where': 'IGNsb3VkcGVyY2VudCA8PSAxMDAgYW5kIFNDRU5FREFURSA+ID0yMDE5MTEwNSBhbmQgU0NFTkVEQVRFIDw9MjAyMTExMTIgYW5kIHNlbnNvcmlkIGluKCdQTVMnKSBhbmQgSVNSRUxFQVNFID0gJ1RSVUUn'}# 请求表单数据# response = requests.post(url, data=From_data, headers=headers, verify=False)# response = requests.post(url,  headers=headers)# response = requests.post(url, headers=headers, verify=False)response = requests.post(url, data=From_data, verify=False)# 将Json格式字符串转字典#print(response.text)content = json.loads(response.text)#print(content)allcount = int(content['allCount'])print(allcount)id = content['features'][0]['attributes']['PRODUCTID']#print(allcount,id)list_id = []id = content['features'][0]['attributes']['PRODUCTID']# print(allcount,id)list_id = []list_sensorid=[]list_product_level=[]list_satelliteid=[]list_sceneid=[]#print(content['features'][5990]['attributes'])#print(content['features'][6000]['attributes'])for i in range(allcount):list_id.append(content['features'][i]['attributes']['PRODUCTID'])list_sensorid.append(content['features'][i]['attributes']['SENSORID'])list_product_level.append(content['features'][i]['attributes']['PRODUCTLEVEL'])list_satelliteid.append(content['features'][i]['attributes']['SATELLITEID'])list_sceneid.append(content['features'][i]['attributes']['SCENEID'])#print(list_id)#url_detail = 'http://36.112.130.153:7777/DSSPlatform/scene/sceneview.html'def detail_form(id=None,sensorid=None,productlevel=None,satelliteid=None,sceneid=None):return {'productid': id,'sensorid':sensorid,'sceneid': sceneid,'method': 'view','satelliteid': satelliteid,'productlevel': productlevel}#把所有获取的meta信息写入到一个meta_data.txt文件里面len_list_id = len(list_id)with open('D:/li_zi.txt', 'a', encoding='utf-8') as f:# f.writelines("第{}个:\n".format(i+1))#f.writelines(i)#f.write(str(np.array(list_id)))for i in list(range(0,len_list_id)):f.write(str(list_id[i]))f.write('\n')#print(list_id)print(len_list_id)#num_list=list(range(0,len_list_id,1))#new_list_id=[num_list,len_list_id]for i in list(range(10800,11000,1)):#print(i,id)#time.sleep(0.1)id=list_id[i]temp_sensorid=list_sensorid[i]temp_productlevel=list_product_level[i]temp_satelliteid=list_satelliteid[i]temp_sceneid=list_sceneid[i]response = requests.post(v_detail_url, headers=headers, data=detail_form(id,temp_sensorid,temp_productlevel,temp_satelliteid,temp_sceneid), verify=False)temp_meta_file_name ='D:/ziranziyuan3/'+str(id)+temp_sensorid+temp_productlevel+ '.html'#temp_meta_file_name = 'D:/ziranziyuan/' + str(id) + str(temp_sensorid) + str(temp_productlevel)+str(temp_satelliteid)+str(temp_sceneid) + '.html'#print(temp_meta_file_name)with open(temp_meta_file_name, 'w', encoding='utf-8') as f:f.write(response.text)if i % 100==0:time.sleep(15)if __name__ == '__main__':get_date(20000)

第二步 对爬取的数据提取有用的表格里面的信息(meta信息),并为选取合适的影像对做准备

#import BeautifulSoup4
from bs4 import BeautifulSoup
# import bs4
#
import re
import numpy as np
import osfile_path='D:/dxal_ziranziyuanweixing_20130426_202111_15/'
record_txt_name='meta_file.txt'
dir_list_name=[]
list_ziranziyuanweixing=os.listdir(file_path)
for file_name in list_ziranziyuanweixing:#print(file_name)f=open(file_path+file_name,"r",encoding='utf-8')#print(file_path+file_name)#f = open("D:/ziranziyuan/1119940978.html","r",encoding='utf-8')html = f.read()table = re.findall(r'<table(.*?)</table>', html, re.S)#查找html中table之间的内容#print(table)###################################################################################################获取td1中的卫星相关信息nowtable=table[1]nowtable = nowtable.replace('\t','')#将空格换行等去除nowtable = nowtable.replace('\n','')nowtable = nowtable.replace(' ','')#print(nowtable)td1_info1=re.findall(r'class="tab_value">(.*?)</th>', nowtable, re.S)#成绩想关的信息都在tdclass="center"td之间#print(td1_info1)td1_info2 = re.findall(r'<tdclass="tab_value">(.*?)</td>', nowtable, re.S)#成绩想关的信息都在tdclass="center"td之间#print(td1_info1+td1_info2)td1_info=td1_info1+td1_info2td1_label=['卫星','传感器','采集时间','左上角经纬度','右上角经纬度','景中心经纬度','左下角经纬度','右下角经纬度','接收站','轨道圈号','景','星下点path/row','产品起始行时间','产品中间运行时间','产品结束运行时间']#print(td1_label)td1=[td1_label,td1_info]#print('/')td1_array=np.array(td1)#print(td1_array[:,0])########################################################################################################获取td2中的卫星相关信息nowtable=table[2]nowtable = nowtable.replace('\t','')#将空格换行等去除nowtable = nowtable.replace('\n','')nowtable = nowtable.replace(' ','')td2_info1=re.findall(r'class="tab_value">(.*?)</th>', nowtable, re.S)#成绩想关的信息都在tdclass="center"td之间#print(td2_info1)td2_info2 = re.findall(r'<tdclass="tab_value">(.*?)</td>', nowtable, re.S)#成绩想关的信息都在tdclass="center"td之间#print(td2_info1+td2_info2)td2_info=td2_info1+td2_info2td2_label=['产品级别','景序列号','产品序列号','生产日期','产品谱段','产品分辨率','产品类型','连续景数','浮动比例','产品格式','产品宽高(像素)','原始数据条带号','云覆盖量','产品大小','椭球模型','重采样方法','辐射校正方法','DEM数据来源','地图投影','投影带号','地球模型']#print(td1_label)td2=[td2_label,td2_info]#print('***************')td2_array=np.array(td2)#print(td2_array[:,12])########################################################################################################获取td3中的卫星相关信息nowtable=table[3]nowtable = nowtable.replace('\t','')#将空格换行等去除nowtable = nowtable.replace('\n','')nowtable = nowtable.replace(' ','')td3_info1=re.findall(r'class="tab_value">(.*?)</th>', nowtable, re.S)#成绩想关的信息都在tdclass="center"td之间#print(td3_info1)td3_info2 = re.findall(r'<tdclass="tab_value">(.*?)</td>', nowtable, re.S)#成绩想关的信息都在tdclass="center"td之间#print(td2_info1+td2_info2)td3_info=td3_info1+td3_info2td3_label=['卫星平台平均航偏角(度)','卫星平台平均俯仰角(度)','卫星平台滚动角(度)','卫星方位角','卫星高度角','相机侧视角','太阳高度角','太阳方位角','相机前后视角','增益模式','积分时间(秒)','积分级数']#print(td1_label)td3=[td3_label,td3_info]#print(td3)#print('***************')td3_array=np.array(td3)#print(td3_array)#print(td3_array[:,0])#########################################################################################将从自然资源网站读取的信息以特定的方式 保存satellite_roll_angel=td3_info[2]sensortype=td1_info[1]scene_center_latlon=td1_info[5]scene_get_date=td1_info[2]scene_orbit=td1_info[9]product_id=td2_info[2]#########################################################################################将从自然资源网站读取的信息以特定的命名方式 保存#temp_meta_file_name = file_path + str(id) + '.txt'with open(file_path+record_txt_name, 'a', encoding='utf-8') as f:# f.writelines("第{}个:\n".format(i+1))#f.write(response.text)# temp_tex=response.textf.writelines(scene_center_latlon+'_'+scene_get_date+'_'+sensortype+'_'+scene_orbit+'_'+satellite_roll_angel+'_'+product_id)f.writelines('\n')

matlab对txt文件字符串替换,改文件后缀名

matlab,python,等将程序写成函数,会提高运行速率。
https://blog.csdn.net/techfield/article/details/19681665
https://zhidao.baidu.com/question/269277700
https://blog.csdn.net/FX677588/article/details/53207378
python分割字符串
https://blog.csdn.net/weixin_42156097/article/details/109727550
matlab逐行读取txt文件字符串。
https://blog.csdn.net/u013249853/article/details/101440962
matlab元胞数组类似于python的字符串数组。但是使用起来比较麻烦,运行速率会慢。

遥感所内网等需按区域所需要的shp文件怎么设置

情景:所获得的shp文件是投影坐标系(高斯克吕格投影),需要将其转换为经纬度投影

shp文件的条件:

1.上传的shp文件不能自相交;2.必须是经纬度投影;3.只能上传多边形shp,且不能是复杂shp(最多只能二级嵌套)

如何修改shp文件的投影信息:
https://jingyan.baidu.com/article/ff411625f7e2d812e48237d1.html
另外,就是创建自己想要的shp文件:
具体操作步骤见下面创建shp文件部分,
有一点要注意,就是:

红5那两个框不要勾选

在这里插入图片描述

大兴安岭VS大兴安岭地区

注意:大兴安岭和大兴安岭地区不是同一个概念
大兴安岭:https://baike.baidu.com/item/%E5%A4%A7%E5%85%B4%E5%AE%89%E5%B2%AD/563782?fr=aladdin
大兴安岭地区:https://baike.baidu.com/item/%E5%A4%A7%E5%85%B4%E5%AE%89%E5%B2%AD%E5%9C%B0%E5%8C%BA/2921262?fr=aladdin
内蒙古大兴安岭林区:
https://baike.baidu.com/item/%E5%86%85%E8%92%99%E5%8F%A4%E5%A4%A7%E5%85%B4%E5%AE%89%E5%B2%AD%E6%9E%97%E5%8C%BA/18714959?fr=aladdin
在这里插入图片描述

在这里插入图片描述
大兴安岭林区示意图:

在这里插入图片描述

黑龙江部分:

在这里插入图片描述
内蒙古大兴安岭林区地图
在这里插入图片描述

在这里插入图片描述

大兴安岭光学影像(google_earth地图)

链接:https://pan.baidu.com/s/1EhtFlQgrQulFq25D6gFMsw
提取码:p16r

arcgis如何创建dxalshapfile文件:

此shpfile仅用来大概指示大兴安岭山脉(林区)。
参考创建流程:
https://blog.csdn.net/liukunrs/article/details/81037571
(1)arcgis加载大兴安岭山脉google earth地图,国界线shp文件
在这里插入图片描述
(2)创建dxal林区shp文件
参考文章:https://blog.csdn.net/liukunrs/article/details/81037571
几点注意:
~1. 几个图层的坐标系要一致:经纬度坐标系?投影坐标系列?WGS84坐标系?
~2. 红1是开始编辑,保存编辑,结束编辑
红2是创建要素。
在这里插入图片描述
在这里插入图片描述

arcgis 怎么显示图层特征(多边形名称)

在这里插入图片描述
在这里插入图片描述

matlab

运算符且 或 等

https://www.cnblogs.com/shenxiaolin/p/6829180.html

matlab日期相减(相差几天)

https://blog.csdn.net/weixin_30356433/article/details/115983434
在线计算网页:http://bjtime.cn/riqi/

UTM坐标系的相关内容

https://blog.csdn.net/yyx20125084014/article/details/83116822

python一些技巧

python读取html文件中的表格table内容 https://www.cnblogs.com/wwwwwei/p/10728060.html
python中正则表达式findall https://zhuanlan.zhihu.com/p/139596371
python读取文件夹目录[https://www.cnblogs.com/yuanyongqiang/p/11714281.html](https://www.cnblogs.com
/yuanyongqiang/p/11714281.html)

cmd进入D


http://www.ppmy.cn/news/284348.html

相关文章

window下C++怎么安装boost库

在Windows下使用NuGet安装的Boost库&#xff0c;需要在Visual Studio中进行配置才能使用。 以下是一些简单的步骤&#xff1a; 使用NuGet安装Boost库。在Visual Studio中打开NuGet包管理器控制台&#xff0c;执行以下命令&#xff1a; Install-Package boost配置Visual Stud…

属性动画实现旋转入场效果

属性动画和硬件加速 日常杂谈 06月07日 首先&#xff0c;我感觉这部分内容真的挺无聊的&#xff0c;没有什么让人新奇的感觉。不过为了博客的整体性&#xff0c;我还是想随便整理一下相关的知识和内容。 一如既往&#xff0c;聊聊我的日常生活&#xff0c;最近可能比较忙&a…

IP2723中文规格书

IP2723T 是一款集成多种协议、用于 USB 输出端口的快充协议 IC。支持多种快充协议&#xff0c;包括 USBTypeC DFP&#xff0c;PD2.0/PD3.0/PPS,HVDCPQC4/QC4/QC3.0/QC2.0 &#xff08; Quick Charge &#xff09;&#xff0c; FCP&#xff08;Hisilicon Fast Charge Protocol&a…

Linux下安装TP-LINK WN 725N无线网卡驱动

新买了个TP-LINK无线USB网卡&#xff0c;但纠结的是居然没提供Linux驱动。各种Google后终于找到解决方案&#xff0c;希望为后来人提供一点线索&#xff0c;少走点儿弯路。 首先请确认你的无线网卡型号&#xff1a;TL-WN725N 122TE1。 系统环境&#xff1a;ubuntu 12.04.2 64位…

STM32驱动NRF24L01

前言&#xff1a; 为了方便查看博客&#xff0c;特意申请了一个公众号&#xff0c;附上二维码&#xff0c;有兴趣的朋友可以关注&#xff0c;和我一起讨论学习&#xff0c;一起享受技术&#xff0c;一起成长。 1. 简介 NRF24L01是 nordic 的无线通信芯片&#xff0c;它具有以…

nRF24L01无线介绍

CE&#xff1a;RX或TX模式选择 CSN&#xff1a;SPI片选信号 SCK&#xff1a;SPI时钟 MOSI&#xff1a;SPI数据输入 MISO&#xff1a;SPI数据输出 IRQ&#xff1a;可屏蔽中断脚 51测试程序 实测可用! #define TX_ADR_WIDTH 5 #define RX_ADR_WIDTH 5 #define TX_PLOAD_WI…

深入理解深度学习——注意力机制(Attention Mechanism):Bahdanau注意力

分类目录&#xff1a;《深入理解深度学习》总目录 之前我们探讨了机器翻译问题&#xff1a; 通过设计一个基于两个循环神经网络的编码器—解码器架构&#xff0c; 用于序列到序列学习。 具体来说&#xff0c;循环神经网络编码器将长度可变的序列转换为固定形状的上下文变量&…

TP-LINK TL-WR740N 升级系统 总结

今天把家里的TP-LINK路由器型号TL-WR740N升级了下其固件&#xff0c;本来家里的网络就经常会掉&#xff0c;昨晚又一直掉&#xff0c;小米盒子论坛说该路由器可能和新小米盒子有点问题&#xff08;关于最近小米盒子连接WIFI后其他设备无法上网的说明&#xff09;&#xff0c;那…