Skip to content

2.2云分析重构

Online子模块-17-云分析(需求):http://wiki.supermapol.cn/pages/viewpage.action?pageId=17432816

iServer+UGO,如何测试和定位问题(旧):http://wiki.supermapol.cn/pages/viewpage.action?pageId=328070

iCloud-Service服务扩展开发规范及注意事项(旧):http://wiki.supermapol.cn/pages/viewpage.action?pageId=328072

扩展iserver环境配置(旧):http://wiki.supermapol.cn/pages/viewpage.action?pageId=327708

online 扩展的 iserver 如何运维(旧): http://wiki.supermapol.cn/pages/viewpage.action?pageId=327972

online Geo-APIs部署情况(旧):http://wiki.supermapol.cn/pages/viewpage.action?pageId=327871

Online代码工程梳理(旧):http://wiki.supermapol.cn/pages/viewpage.action?pageId=327894

高德服务:https://lbs.amap.com/api/webservice/summary

百度服务:https://lbsyun.baidu.com/index.php?title=webapi

项目位置内网:

image-20230209113452108

如何重构?

重构2大前提:

1.代理(可与iserver扩展开发解耦):online-porta代理,主要目的扣key、高并发处理。

2.组件开发:基于组件ugo开发,不基于iserver扩展(iserver封装了ugo方法)。

线上问题

代理key的扣减

1.云分析的key可以互用,互用后key次数没有减少入库

2.云分析的key超过上限没有限制住,只有总量限制

需要解决online代理问题

重构后不再支持

1.没有本地搜索服务支持GET和HEAD请求,没有支持json\xml\jsonp等格式

2.请求后缀.json .xml 没有后缀等不支持

3.返回记录结果数,默认10,最大设置为20。——高德最大设置为50

4.精度后15位,——高德只有后6位

5.导入了内网ibase的service-model包和ugo 有100m大小

项目构建

cloud-server

——cloud-analysis(云分析)

——gis-tools (小工具)

data-convert (数据转换)

——————————————

——local-search(本地搜索)

——geocoding(地理编码,余志尧用的node)

——reverse-geocoding(逆地理编码)

——coordinate-convert(坐标转换)

——path-navigation(路径导航)

——plotting(标绘服务)

本地搜索

1.再创建几个百度key加上

2.百度换成高德的,有企业账号

3.在调高德前,先调自己的纠偏数据库,根据可信度再评分是否调用高德接口(以前想做没做,udb索引文件)

换高德poi接口

https://lbs.amap.com/api/webservice/guide/api/search

  • 关键字搜索:通过用POI的关键字进行条件搜索,例如:肯德基、朝阳公园等;同时支持设置POI类型搜索,例如:银行
  • 周边搜索:在用户传入经纬度坐标点附近,在设定的范围内,按照关键字或POI类型搜索;
  • 多边形搜索:在多边形区域内进行搜索
  • ID查询:通过POI ID,查询某个POI详情,建议可同输入提示API配合使用

换天地图poi接口

http://lbs.tianditu.gov.cn/server/search2.html

key:3a64335a1b1229854a507def6d6e025e

关键字搜索对比

超图

https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos.json?keywords=北京大学&city=北京&key=7ibPazapzmBlcnLXeLLMdkis

百度

https://api.map.baidu.com/place/v2/search?query=北京大学&region=北京&output=json&ak=lvviGcT7PD5BsLCIn1ps8MGx

高德:

https://restapi.amap.com/v3/place/text?keywords=北京大学&city=北京&key=286937d1f5dca00879230f126a1008fe

天地图:

http://api.tianditu.gov.cn/v2/search?postStr={"keyWord":"北京大学","level":12,"mapBound":"116.02524,39.83833,116.65592,39.99185","queryType":1,"start":0,"count":10}&type=query&tk=dec6df2e06800e0e72f94155a5729d63

返回数据:

范围搜索对比

高德多变形搜索

https://restapi.amap.com/v3/place/polygon?polygon=116.460988,40.006919|116.472596,39.985227&keywords=kfc&key=286937d1f5dca00879230f126a1008fe

百度多变形搜索

http://api.map.baidu.com/place/v2/search?query=银行&bounds=39.915,116.404,39.975,116.414&output=json&ak=lvviGcT7PD5BsLCIn1ps8MGx

天地图:

http://api.tianditu.gov.cn/v2/search?postStr={"keyWord":"kfc","polygon":"116.460988,40.006919,116.472596,39.985227","queryType":10,"start":0,"count":10}&type=query&tk=dec6df2e06800e0e72f94155a5729d63

距离搜索对比

高德

https://restapi.amap.com/v3/place/around?keywords=kfc&city=北京&location=116.473168,39.993015&radius=10000&key=286937d1f5dca00879230f126a1008fe

百度:

https://api.map.baidu.com/place/v2/search?query=kfc&location=116.473168,39.993015&radius=2000&output=xml&ak=lvviGcT7PD5BsLCIn1ps8MGx

天地图:

http://api.tianditu.gov.cn/v2/search?postStr={"keyWord":"kfc","level":12,"queryRadius":5000,"pointLonlat":"116.473168,39.993015","queryType":3,"start":0,"count":10}&type=query&tk=dec6df2e06800e0e72f94155a5729d63

本地-高德-超图接口对比(kfc)

超图-关键字

https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos.json?keywords=kfc&city=北京&key=7ibPazapzmBlcnLXeLLMdkis

超图-距离

https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos.json?keywords=kfc&city=北京&location={"x":116.473168,"y":39.993015}&radius=10000&key=7ibPazapzmBlcnLXeLLMdkis

超图-范围

https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos.json?keywords=kfc&city=北京&leftLocation={"x":116.460988,"y":40.006919}&rightLocation={"x":116.472596,"y":39.985227}&key=7ibPazapzmBlcnLXeLLMdkis

https://www.supermapol.com/iserver/services/localsearch/rest/searchdatas/China/poiinfos.json?keywords=kfc&city=北京&leftLocation={"x":116.00,"y":39.00}&rightLocation= {"x":116.70,"y":40.00}&key=7ibPazapzmBlcnLXeLLMdkis

地理编码

正地理编码

超图:

https://www.supermapol.com/iserver/services/location-china/rest/locationanalyst/China/geocoding.json?maxResult=10&address=杨家坪&city=重庆&batch=true

高德:

https://restapi.amap.com/v3/geocode/geo?address=杨家坪&city=重庆&key=286937d1f5dca00879230f126a1008fe

https://restapi.amap.com/v3/geocode/geo?output=json&address=杨家坪&city=重庆市&key=150e52df181bdc4cf32c60fc8ee59eee

百度

v2旧版本:

https://api.map.baidu.com/geocoder/v2/?address=杨家坪&city=重庆&ak=lvviGcT7PD5BsLCIn1ps8MGx

v3版key不可用:

https://api.map.baidu.com/geocoding/v3/?address=杨家坪&city=重庆&ak=lvviGcT7PD5BsLCIn1ps8MGx

纠偏数据:

超图:

https://www.supermapol.com/iserver/services/location-china/rest/locationanalyst/China/geocoding.json?maxResult=10&address=渔乐路500弄&city=上海&batch=true

高德:

https://restapi.amap.com/v3/geocode/geo?address=渔乐路500弄&city=上海&key=286937d1f5dca00879230f126a1008fe

{"status":"1","info":"OK","infocode":"10000","count":"1","geocodes":[{"formatted_address":"上海市崇明区渔乐路500弄","country":"中国","province":"上海市","citycode":"021","city":"上海市","district":"崇明区","township":[],"neighborhood":{"name":[],"type":[]},"building":{"name":[],"type":[]},"adcode":"310151","street":"渔乐路500弄","number":[],"location":"121.695245,31.391492","level":"道路"}]}

逆地理编码

超图:

https://www.supermapol.com/iserver/services/location-china/rest/locationanalyst/China/geodecoding.json?location={"x":104.096096,"y":30.6363}&key=286937d1f5dca00879230f126a1008fe

高德:

可支持多个坐标点

https://restapi.amap.com/v3/geocode/regeo?location=104.096096,30.6363&key=286937d1f5dca00879230f126a1008fe&extensions=all

路径导航

超图:

https://www.supermapol.com/iserver/services/navigation/rest/navigationanalyst/China/pathanalystresults.json?pathAnalystParameters=[{startPoint:{"x":116.467524,"y":39.914319},endPoint:{"x":116.25814,"y":40.666082}]

https://www.supermapol.com/iserver/services/navigation/rest/navigationanalyst/China/pathanalystresults.json?pathAnalystParameters=[{startPoint:{"x":116.467524,"y":39.914319},endPoint:{"x":116.25814,"y":40.666082}}]

高德:

https://restapi.amap.com/v3/direction/driving?origin=116.467524,39.914319&destination=116.25814,40.666082&extensions=all&output=xml&key=9c71a28f8140b32e7c56836fd6a4be5b

                <string>9c71a28f8140b32e7c56836fd6a4be5b</string>
                <string>ada46277e71645d68e8e9a149e84e99c</string>
                <string>28cc0d0eff7f25dd3e1a276c2dace4cd</string>

/Users/liuchenyun/dev/superMapWorkSpace/online-microservices/microservices/cloud-analysis/geocoding/target/classes/word-matcher/dic/province.dic

/Users/liuchenyun/dev/superMapWorkSpace/online-microservices/microservices/cloud-analysis/geocoding/target/classes/word-marcher/dic/province.dic

/Users/liuchenyun/word-matcher/dic

公交换乘

使用搜狗地图

xml
<?xml version="1.0" encoding="utf-8"?>
<application>
    <components>
        <!-- 公交换乘服务组件 -->
        <component name="trafficTransferAnalyst"
                   class="com.supermap.icloud.components.impl.IcloudTrafficTransferAnalystImpl"
                   interfaceNames="restjsr" providers="sogouTrafficTransferProvider,icloud-coordConvert">
            <!-- <config class="com.supermap.icloud.components.BaiduTrafficTransferAnalystConfig">
</config> -->
        </component>
    </components>
    <providers>
        <provider name="sogouTrafficTransferProvider"
                  class="com.supermap.icloud.providers.SogouTrafficTransferAnalystProvider">
            <config
                    class="com.supermap.icloud.components.spi.IcloudTrafficTransferProviderSetting">
                <name>China</name>
                <solutionServiceUrl>http://api.go2map.com/engine/api/bus/json</solutionServiceUrl>
                <transferDetailServiceUrl>http://api.go2map.com/engine/api/busdetail/json</transferDetailServiceUrl>
                <clientid>
                    <string>25a8acef6df6b77b</string>
                    <string>e49779e132179b88</string>
                </clientid>
            </config>
        </provider>
    </providers>
</application>

A173EE2D0D17FEB5E50958536F1852B5

高德:

数据库修改

services表

本地搜索

天地图传入和返回参数都有,程序上做调整,主要在返回的得到数据上有些问题:

问题:

1.数据较小,内容不全

如:成都超图:

CA39524D-21E1-4847-BAC2-A2AEABD6E523

如:北京超图

image-20230303141445556

2.数据信息出现编码符号

284A3ADA34D4E09CEA552F53326F2C91

总结:天地图数据量少,数据信息少,数据出现编码符号;百度中规中矩;高德最好最全,但费钱