怎么用程序通过百度地图API批量获取具体地址的经纬度

怎么用程序通过百度地图API批量获取具体地址的经纬度,第1张

我也在研究这个问题。因为C语言编程差点能力,所以目前没有办法写出有效的程序,目前还在研究。如果我能写好,我再复制给你。
我现在是用网上一个软件批量解析,名称:XGeocoding。先获取百度API控制台的开发者账号,比较容易注册申请。>

不清楚你的实际文件/情况,仅以问题中的说明及猜测为据;以下代码复制粘贴到记事本,另存为xxbat,编码选ANSI,跟要处理的文件放一起双击运行

<# :
cls&echo off&cd /d "%~dp0"
rem 获取当前目录里多个jpg文件的经度、纬度和高度等GPS信息
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
set "current=%cd%"
powershell -NoProfile -ExecutionPolicy bypass "Get-Content -literal '%~f0'|Out-String|Invoke-Expression"
echo;%#% +%$%%$%/%_% %z%
pause
exit
#>
$outfile="xxxcsv";
Add-Type -AssemblyName 'Systemdrawing';
$current=$env:current;
$result=New-Object -TypeName SystemCollectionsArrayList;
$fs=New-Object SystemIOFileStream($outfile, [SystemIOFileMode]::Create);
$sw=New-Object SystemIOStreamWriter($fs, [TextEncoding]::GetEncoding('GB2312'));
$files=@(dir -literal $current|{(@("jpg") -contains $_Extension) -and ($_ -is [SystemIOFileInfo])});
for($i=0;$i -lt $fileslength;$i++){
    write-host $files[$i]FullNamereplace($current, '');
    $arr=@($files[$i]Name,'','','','','');
    $img=[SystemDrawingImage]::FromFile($files[$i]FullName);
    foreach($it in $imgPropertyItems){
        if($itId -eq 0x0001){
            $arr[1]=[SystemTextEncoding]::ASCIIGetString($itValue[0]);
        }
        if($itId -eq 0x0002){
            if($itValuelength -eq 24){
                $d1=[SystemBitConverter]::ToUInt32($itValue, 0) / [SystemBitConverter]::ToUInt32($itValue, 4);
                $m1=[SystemBitConverter]::ToUInt32($itValue, 8) / [SystemBitConverter]::ToUInt32($itValue, 12);
                $s1=[SystemBitConverter]::ToUInt32($itValue, 16) / [SystemBitConverter]::ToUInt32($itValue, 20);
                $arr[2]=$d1ToString()+';'+$m1ToString()+';'+$s1ToString();
            }
        }
        if($itId -eq 0x0003){
            $arr[3]=[SystemTextEncoding]::ASCIIGetString($itValue[0]);
        }
        if($itId -eq 0x0004){
            if($itValuelength -eq 24){
                $d2=[SystemBitConverter]::ToUInt32($itValue, 0) / [SystemBitConverter]::ToUInt32($itValue, 4);
                $m2=[SystemBitConverter]::ToUInt32($itValue, 8) / [SystemBitConverter]::ToUInt32($itValue, 12);
                $s2=[SystemBitConverter]::ToUInt32($itValue, 16) / [SystemBitConverter]::ToUInt32($itValue, 20);
                $arr[4]=$d2ToString()+';'+$m2ToString()+';'+$s2ToString();
            }
        }
        if($itId -eq 0x0006){
            if($itValuelength -eq 8){
                $alt=[SystemBitConverter]::ToUInt32($itValue, 0) / [SystemBitConverter]::ToUInt32($itValue, 4);
                $arr[5]=$altToString();
            }
        }
    }
    $imgDispose();
    $line='"'+$arr[0]+'",'+$arr[1]+' '+$arr[2]+','+$arr[3]+' '+$arr[4]+','+$arr[5];
    $swWriteLine($line);$swFlush();
}
$swClose();$fsClose();

1、建立一个数组,存放转换前的经纬度。创建百度的坐标点,但是用谷歌的经纬度
var points = [new BMapPoint(1163786889372559,3990762965106183),
new BMapPoint(11638632786853032,3990795884517671),
new BMapPoint(11639534009082035,39907432133833574),
new BMapPoint(11640624058825688,3990789300648029),
new BMapPoint(11641413701159672,3990795884517671)
];
2、然后调用官方公布的接口
BMapConvertortransMore(points,2,callback);

先用BAT命令批量导出文件名到TXT文件

大致就是用 “DIR  /B >LISTTXT“(也可以自己百度搜,很多方法)

全选TXT文件中所有文字,然后新建一个WORD,把文字黏贴进去

用“查找替换“功能,把“102路公交车站台_“替换成“”(空白),同理把“jpg”替换成空白

以上就已经把文件名都处理了。

接下去要想办法把重名的删除,你需要把WORD里面的东西全选,黏贴到EXCEL里去~

用EXCEL的的条件筛分来删除同样的东西,具体见下网页

>

除非自己用VB,或者C语言编程,否则没有一步到位的方法~~你就按上面步骤手动 *** 作吧,也不麻烦。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/yw/13402573.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-07-29
下一篇 2023-07-29

发表评论

登录后才能评论

评论列表(0条)

保存