精华内容
下载资源
问答
  • 全国省市区json数据(来自高德地图),可用于下拉联动菜单。
  • 高德地图最新省市区县JSON,包含坐标,身份证号前6位,区号,城市名,城市级别 精确到街道/乡镇级别 高德API地址:https://lbs.amap.com/api/webservice/guide/api/district/?sug_index=1
  • 高德地图城市json

    2017-02-08 16:51:29
    用于遍历出各城市按钮,进行城市选择。如美团、饿了么等城市切换的城市数据
  • 高德地图,全国省级数据Json(包括:经纬度,省份Code,省份名称等)
  • 高德官网获取,可用于联级选择 全国可用的城市json数据 带坐标 省市区三级,显示区域编码 2020年8月最新获取
  • 全国省市区乡镇街道四级行政区json数据,含城市电话区号,行政编码,高德地图坐标系准确的中心点和边界线。
  • 可用于数据可视化echarts实现地图下钻(二级下钻到市)
  • 因为网上找的地图数据精度都不是很理想,高德地图提供的数据精确多了,当然最重要的原因是项目因为网络限制,不让访问外网以至于没法直接使用高德地图提供的服务,所以有了此仓库。 思路 先看下 client/index.html ...
  • 之前的教程过于简单,昨天帮同事切分山东临沂地图正好把详细步骤记录下来,附件中包含教程、json格式化工具、坐标翻转工具、(压缩坐标还原坐标工具教程中未用到,项目如果不考虑文件大小数据可以不压缩)
  • python-to-amap 基于Python3实现高德地图POI检索数据获取,并写入json与exce文件。
  • 成都最新geojson数据,含高新东区、高新西区、高新南区、成都天府新区 适用于高德地图数据
  • 首先 进入高德开放平台 按官网教程获取key 这里以杭州某区域车站信息举例通过在线解析工具获取json格式的数据 通过此数据建立实体类package geturl;import java.util.List;public class JsonBean { private ...

    首先 进入高德开放平台 按官网教程获取key
    这里写图片描述

    这里写图片描述

    这里以杭州某区域车站信息举例

    通过在线解析工具获取json格式的数据
    这里写图片描述

    通过此数据建立实体类

    package geturl;
    
    import java.util.List;
    
    public class JsonBean {
    	private String status;
    	private String count;
    
    	public String getStatus() {
    		return status;
    	}
    
    	public void setStatus(String status) {
    		this.status = status;
    	}
    
    	public String getCount() {
    		return count;
    	}
    
    	public void setCount(String count) {
    		this.count = count;
    	}
    
    	public String getInfo() {
    		return info;
    	}
    
    	public void setInfo(String info) {
    		this.info = info;
    	}
    
    	public String getInfocode() {
    		return infocode;
    	}
    
    	public void setInfocode(String infocode) {
    		this.infocode = infocode;
    	}
    
    	public SuggestionBean getSuggestion() {
    		return suggestion;
    	}
    
    	public void setSuggestion(SuggestionBean suggestion) {
    		this.suggestion = suggestion;
    	}
    
    	public List<PoisBean> getPois() {
    		return pois;
    	}
    
    	public void setPois(List<PoisBean> pois) {
    		this.pois = pois;
    	}
    
    	private String info;
    	private String infocode;
    	private SuggestionBean suggestion;
    
    	private List<PoisBean> pois;
    
    	public static class SuggestionBean {
    		private List<?> keywords;
    		private List<?> cities;
    
    		public List<?> getKeywords() {
    			return keywords;
    		}
    
    		public void setKeywords(List<?> keywords) {
    			this.keywords = keywords;
    		}
    
    		public List<?> getCities() {
    			return cities;
    		}
    
    		public void setCities(List<?> cities) {
    			this.cities = cities;
    		}
    
    	}
    
    	public static class PoisBean {
    		private String id;
    		private String name;
    		private String tag;
    
    		public String getId() {
    			return id;
    		}
    
    		public void setId(String id) {
    			this.id = id;
    		}
    
    		public String getName() {
    			return name;
    		}
    
    		public void setName(String name) {
    			this.name = name;
    		}
    
    		public String getTag() {
    			return tag;
    		}
    
    		public void setTag(String tag) {
    			this.tag = tag;
    		}
    
    		public String getType() {
    			return type;
    		}
    
    		public void setType(String type) {
    			this.type = type;
    		}
    
    		public String getTypecode() {
    			return typecode;
    		}
    
    		public void setTypecode(String typecode) {
    			this.typecode = typecode;
    		}
    
    		public String getBiz_type() {
    			return biz_type;
    		}
    
    		public void setBiz_type(String biz_type) {
    			this.biz_type = biz_type;
    		}
    
    		public String getAddress() {
    			return address;
    		}
    
    		public void setAddress(String address) {
    			this.address = address;
    		}
    
    		public String getLocation() {
    			return location;
    		}
    
    		public void setLocation(String location) {
    			this.location = location;
    		}
    
    		public String getTel() {
    			return tel;
    		}
    
    		public void setTel(String tel) {
    			this.tel = tel;
    		}
    
    		public String getPostcode() {
    			return postcode;
    		}
    
    		public void setPostcode(String postcode) {
    			this.postcode = postcode;
    		}
    
    		public String getWebsite() {
    			return website;
    		}
    
    		public void setWebsite(String website) {
    			this.website = website;
    		}
    
    		public String getEmail() {
    			return email;
    		}
    
    		public void setEmail(String email) {
    			this.email = email;
    		}
    
    		public String getPcode() {
    			return pcode;
    		}
    
    		public void setPcode(String pcode) {
    			this.pcode = pcode;
    		}
    
    		public String getPname() {
    			return pname;
    		}
    
    		public void setPname(String pname) {
    			this.pname = pname;
    		}
    
    		public String getCitycode() {
    			return citycode;
    		}
    
    		public void setCitycode(String citycode) {
    			this.citycode = citycode;
    		}
    
    		public String getCityname() {
    			return cityname;
    		}
    
    		public void setCityname(String cityname) {
    			this.cityname = cityname;
    		}
    
    		public String getAdcode() {
    			return adcode;
    		}
    
    		public void setAdcode(String adcode) {
    			this.adcode = adcode;
    		}
    
    		public String getAdname() {
    			return adname;
    		}
    
    		public void setAdname(String adname) {
    			this.adname = adname;
    		}
    
    		public String getImportance() {
    			return importance;
    		}
    
    		public void setImportance(String importance) {
    			this.importance = importance;
    		}
    
    		public String getShopid() {
    			return shopid;
    		}
    
    		public void setShopid(String shopid) {
    			this.shopid = shopid;
    		}
    
    		public String getShopinfo() {
    			return shopinfo;
    		}
    
    		public void setShopinfo(String shopinfo) {
    			this.shopinfo = shopinfo;
    		}
    
    		public String getPoiweight() {
    			return poiweight;
    		}
    
    		public void setPoiweight(String poiweight) {
    			this.poiweight = poiweight;
    		}
    
    		public String getGridcode() {
    			return gridcode;
    		}
    
    		public void setGridcode(String gridcode) {
    			this.gridcode = gridcode;
    		}
    
    		public String getDistance() {
    			return distance;
    		}
    
    		public void setDistance(String distance) {
    			this.distance = distance;
    		}
    
    		public String getNavi_poiid() {
    			return navi_poiid;
    		}
    
    		public void setNavi_poiid(String navi_poiid) {
    			this.navi_poiid = navi_poiid;
    		}
    
    		public String getEntr_location() {
    			return entr_location;
    		}
    
    		public void setEntr_location(String entr_location) {
    			this.entr_location = entr_location;
    		}
    
    		public String getBusiness_area() {
    			return business_area;
    		}
    
    		public void setBusiness_area(String business_area) {
    			this.business_area = business_area;
    		}
    
    		public String getExit_location() {
    			return exit_location;
    		}
    
    		public void setExit_location(String exit_location) {
    			this.exit_location = exit_location;
    		}
    
    		public String getMatch() {
    			return match;
    		}
    
    		public void setMatch(String match) {
    			this.match = match;
    		}
    
    		public String getRecommend() {
    			return recommend;
    		}
    
    		public void setRecommend(String recommend) {
    			this.recommend = recommend;
    		}
    
    		public String getTimestamp() {
    			return timestamp;
    		}
    
    		public void setTimestamp(String timestamp) {
    			this.timestamp = timestamp;
    		}
    
    		public String getAlias() {
    			return alias;
    		}
    
    		public void setAlias(String alias) {
    			this.alias = alias;
    		}
    
    		public String getIndoor_map() {
    			return indoor_map;
    		}
    
    		public void setIndoor_map(String indoor_map) {
    			this.indoor_map = indoor_map;
    		}
    
    		public String getIndoor_data() {
    			return indoor_data;
    		}
    
    		public void setIndoor_data(String indoor_data) {
    			this.indoor_data = indoor_data;
    		}
    
    		public String getGroupbuy_num() {
    			return groupbuy_num;
    		}
    
    		public void setGroupbuy_num(String groupbuy_num) {
    			this.groupbuy_num = groupbuy_num;
    		}
    
    		public String getDiscount_num() {
    			return discount_num;
    		}
    
    		public void setDiscount_num(String discount_num) {
    			this.discount_num = discount_num;
    		}
    
    		public String getBiz_ext() {
    			return biz_ext;
    		}
    
    		public void setBiz_ext(String biz_ext) {
    			this.biz_ext = biz_ext;
    		}
    
    		public String getEvent() {
    			return event;
    		}
    
    		public void setEvent(String event) {
    			this.event = event;
    		}
    
    		public String getChildren() {
    			return children;
    		}
    
    		public void setChildren(String children) {
    			this.children = children;
    		}
    
    		public String getPhotos() {
    			return photos;
    		}
    
    		public void setPhotos(String photos) {
    			this.photos = photos;
    		}
    
    		private String type;
    		private String typecode;
    		private String biz_type;
    		private String address;
    		private String location;
    		private String tel;
    		private String postcode;
    		private String website;
    		private String email;
    		private String pcode;
    		private String pname;
    		private String citycode;
    		private String cityname;
    		private String adcode;
    		private String adname;
    		private String importance;
    		private String shopid;
    		private String shopinfo;
    		private String poiweight;
    		private String gridcode;
    		private String distance;
    		private String navi_poiid;
    		private String entr_location;
    		private String business_area;
    		private String exit_location;
    		private String match;
    		private String recommend;
    		private String timestamp;
    		private String alias;
    		private String indoor_map;
    		private String indoor_data;
    		private String groupbuy_num;
    		private String discount_num;
    		private String biz_ext;
    		private String event;
    		private String children;
    		private String photos;
    
    	}
    }
    
    

    数据库连接类

    package geturl;  
      
    import java.sql.Connection;  
    import java.sql.DriverManager;  
    import java.sql.PreparedStatement;  
    import java.sql.ResultSet;  
    import java.sql.SQLException;  
    import java.sql.Statement;
      
    public class Conn {  
          
        /** 
         * @method getConn() 
         * @return Connection 
         */  
        public Connection getConn() {  
            String driver = "org.postgresql.Driver";  
            String url = "jdbc:postgresql://localhost:5432/superpower";  
            String username = "postgres";  
            String password = "123456";  
            Connection conn = null;  
            
            try {  
                Class.forName(driver); // 
                conn = (Connection) DriverManager.getConnection(url, username, password);  
                
                System.out.println("数据库连接成功");
                
            } catch (ClassNotFoundException e) {  
                e.printStackTrace();  
            } catch (SQLException e) {  
                e.printStackTrace();  
            }  
            
            return conn;  
        }  
        
    
        
    }
    

    解析存储类

    package geturl;
    import geturl.JsonBean.PoisBean;
    
    import java.net.*;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.List;
    import java.io.*;
    
    import net.sf.json.JSONArray;
    import net.sf.json.JSONObject;
    
    
    public class Iputil
    {
       public static void main(String [] args)
       {
    	   JsonBean jsonBean=new JsonBean();
          try
          {
             URL url = new URL("http://restapi.amap.com/v3/place/text?&keywords=%E5%85%AC%E4%BA%A4%E7%AB%99%E7%82%B9&city=%E6%9D%AD%E5%B7%9E&output=json&offset=20&page=1&key=6b6ebee4f2f6ef4c55d1b4b52310acec&extensions=all");
             URLConnection urlConnection = url.openConnection();
             HttpURLConnection connection = null;
             if(urlConnection instanceof HttpURLConnection)
             {
                connection = (HttpURLConnection) urlConnection;
             }
             else
             {
                System.out.println("输入urlַ");
                return;
             }
             BufferedReader in = new BufferedReader(
             new InputStreamReader(connection.getInputStream()));
             String urlString = "";
             String current;
             while((current = in.readLine()) != null)
             {
                urlString += current;     
             }
             
             
             JSONObject json=JSONObject.fromObject(urlString);//大括号object 字符串string 数组list
             
               jsonBean.setStatus(json.optString("status"));
               jsonBean.setCount(json.optString("count"));
               jsonBean.setInfo(json.optString("info"));
               jsonBean.setInfocode(json.optString("infocode"));
    	           
    	           JSONObject suggestionObj=json.optJSONObject("suggestion");
    	           JsonBean.SuggestionBean suggestion=new JsonBean.SuggestionBean();
    	           
    		           List<String> keywordsList=new ArrayList<>();
    		           JSONArray keywordsArray=suggestionObj.optJSONArray("keywords");
    		           for (int i = 0; i < keywordsArray.size(); i++) {
    					      keywordsList.add(keywordsArray.optString(i));
    				   }
    		           suggestion.setKeywords(keywordsList);
    		           
    		           List<String> citiesList=new ArrayList<>();
    		           JSONArray citiesArray=suggestionObj.optJSONArray("cities");
    		           for (int i = 0; i < citiesArray.size(); i++) {
    		        	   citiesList.add(citiesArray.optString(i));
    				   }
    		           suggestion.setCities(citiesList);
    	           
    	           
    	           jsonBean.setSuggestion(suggestion);
               
               
               
               
               List<PoisBean> poisBeansList=new ArrayList<>();
               JSONArray poisArray=json.optJSONArray("pois");
               for (int i = 0; i < poisArray.size(); i++) {
    			    JSONObject poisObj = poisArray.optJSONObject(i);
    			    JsonBean.PoisBean poisBean=new JsonBean.PoisBean();
    			    poisBean.setId(poisObj.optString("id"));
    			    poisBean.setName(poisObj.optString("name"));
    			    poisBean.setTag(poisObj.optString("tag"));
    			    poisBean.setType(poisObj.optString("type"));
    			    poisBean.setTypecode(poisObj.optString("typecode"));
    			    poisBean.setBiz_type(poisObj.optString("biz_type"));    
    			    poisBean.setAddress(poisObj.optString("address"));
    			    poisBean.setLocation(poisObj.optString("location"));
    			    poisBean.setTel(poisObj.optString("tel"));
    			    poisBean.setPostcode(poisObj.optString("postcode"));
    			    poisBean.setWebsite(poisObj.optString("website"));
    			    poisBean.setEmail(poisObj.optString("email"));
    			    poisBean.setPcode(poisObj.optString("pcode"));
    			    poisBean.setPname(poisObj.optString("pname"));
    			    poisBean.setCitycode(poisObj.optString("citycode"));
    			    poisBean.setCityname(poisObj.optString("cityname"));
    			    poisBean.setAdcode(poisObj.optString("adcode"));
    			    poisBean.setAdname(poisObj.optString("adname"));
    			    poisBean.setImportance(poisObj.optString("importance"));
    			    poisBean.setShopid(poisObj.optString("shopid"));
    			    poisBean.setShopinfo(poisObj.optString("shopinfo"));
    			    poisBean.setPoiweight(poisObj.optString("poiweight"));
    			    poisBean.setGridcode(poisObj.optString("gridcode"));
    			    poisBean.setDistance(poisObj.optString("distance"));
    			    poisBean.setNavi_poiid(poisObj.optString("navi_poiid"));
    			    poisBean.setEntr_location(poisObj.optString("entr_location"));
    			    poisBean.setBusiness_area(poisObj.optString("business_area"));
    			    poisBean.setExit_location(poisObj.optString("exit_location"));
    			    poisBean.setMatch(poisObj.optString("match"));
    			    poisBean.setRecommend(poisObj.optString("recommend"));
    			    poisBean.setTimestamp(poisObj.optString("timestamp"));
    			    poisBean.setAlias(poisObj.optString("alias"));
    			    poisBean.setIndoor_map(poisObj.optString("indoor_map"));
    			    poisBean.setIndoor_data(poisObj.optString("indoor_data"));
    			    poisBean.setGroupbuy_num(poisObj.optString("groupbuy_num"));
    			    poisBean.setDiscount_num(poisObj.optString("discount_num"));
    			    poisBean.setBiz_ext(poisObj.optString("biz_ext"));
    			    poisBean.setEvent(poisObj.optString("event"));
    			    poisBean.setChildren(poisObj.optString("children"));
    			    poisBean.setPhotos(poisObj.optString("photos"));
    			  
    			  
    			   poisBeansList.add(poisBean);
    		   }
               
               jsonBean.setPois(poisBeansList);
      
          }catch(IOException e)
          {
             e.printStackTrace();
          }     //get数据
          
          
          
    		      Conn c=new Conn();  //连接数据库
    		      Connection con=	c.getConn();
    		      
    		      	try {
    		      		 Statement sql;
    		      		 ResultSet res;
    		      		 int a;
    		      		 
    		      		sql=con.createStatement();
    		      	/*	sql.executeQuery("CREATE TABLE Map (id varchar(255), name varchar(255),tag varchar(255),"
    		      				+ "type varchar(255),typecode varchar(255), biz_type varchar(255),address varchar(255),location varchar(255),"
    		      				+ "tel varchar(255),postcode varchar(255),website varchar(255),email varchar(255),pcode varchar(255),pname varchar(255),"
    		      				+ "citycode varchar(255), cityname varchar(255), adcode varchar(255),adname varchar(255), importance varchar(255),shopid varchar(255),shopinfo varchar(255),poiweight varchar(255),"
    		      				+ "gridcode varchar(255),distance varchar(255),navi_poiid varchar(255),entr_location varchar(255),business_area varchar(255),exit_location varchar(255),"
    		      				+ "match varchar(255),recommend varchar(255),timestamp varchar(255),alias varchar(255),indoor_map varchar(255),indoor_data varchar(255),"
    		      				+ "groupbuy_num varchar(255),discount_num varchar(255),biz_ext varchar(255),event varchar(255),children varchar(255),photos varchar(400))  ");
    		      			*/															
    
    			for (int i = 0; i < jsonBean.getPois().size(); i++) {
    				a = sql.executeUpdate("insert into Map (id,name,tag,type,typecode,biz_type,address,location,tel,postcode,website,email,pcode,pname,"
    						+ "citycode,cityname,adcode,adname,importance,shopid,shopinfo,poiweight,gridcode,distance,navi_poiid,entr_location,business_area,"
    						+ "exit_location,match,recommend,timestamp,alias,indoor_map,indoor_data,groupbuy_num,discount_num,biz_ext,event,children,photos) "
    						+ "values('"+jsonBean.getPois().get(i).getId()+"','"+jsonBean.getPois().get(i).getName()+"'"
    						+ ",'"+jsonBean.getPois().get(i).getTag()+"','"+jsonBean.getPois().get(i).getType()+"','"+jsonBean.getPois().get(i).getTypecode()+"'"
    						+ ",'"+jsonBean.getPois().get(i).getBiz_type()+"','"+jsonBean.getPois().get(i).getAddress()+"','"+jsonBean.getPois().get(i).getLocation()+"'  "
    						+ ",'"+jsonBean.getPois().get(i).getTel()+"','"+jsonBean.getPois().get(i).getPostcode()+"','"+jsonBean.getPois().get(i).getWebsite()+"','"+jsonBean.getPois().get(i).getEmail()+"'"
    						+ ",'"+jsonBean.getPois().get(i).getPcode()+"','"+jsonBean.getPois().get(i).getPname()+"','"+jsonBean.getPois().get(i).getCityname()+"','"+jsonBean.getPois().get(i).getCityname()+"'"
    					    + ",'"+jsonBean.getPois().get(i).getAdcode()+"','"+jsonBean.getPois().get(i).getAdname()+"','"+jsonBean.getPois().get(i).getImportance()+"','"+jsonBean.getPois().get(i).getShopid()+"'"
    					    + ",'"+jsonBean.getPois().get(i).getShopinfo()+"','"+jsonBean.getPois().get(i).getPoiweight()+"','"+jsonBean.getPois().get(i).getGridcode()+"','"+jsonBean.getPois().get(i).getDistance()+"'"
    					    + ",'"+jsonBean.getPois().get(i).getNavi_poiid()+"','"+jsonBean.getPois().get(i).getEntr_location()+"','"+jsonBean.getPois().get(i).getBusiness_area()+"','"+jsonBean.getPois().get(i).getExit_location()+"'"
    					    + ",'"+jsonBean.getPois().get(i).getMatch()+"','"+jsonBean.getPois().get(i).getRecommend()+"','"+jsonBean.getPois().get(i).getTimestamp()+"','"+jsonBean.getPois().get(i).getAlias()+"'"
    					    + ",'"+jsonBean.getPois().get(i).getIndoor_map()+"','"+jsonBean.getPois().get(i).getIndoor_data()+"','"+jsonBean.getPois().get(i).getGroupbuy_num()+"','"+jsonBean.getPois().get(i).getDiscount_num()+"' "
    					    + ",'"+jsonBean.getPois().get(i).getBiz_ext()+"','"+jsonBean.getPois().get(i).getEvent()+"','"+jsonBean.getPois().get(i).getChildren()+"','"+jsonBean.getPois().get(i).getPhotos()+"')");
    
    			}
    					
    					
    					
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
          
          
       }
    }
    

    解析类中的 建表与更新分两步进行

    所需jar包如下图
    这里写图片描述

    结果如图,已数组形式存储
    这里写图片描述

    展开全文
  • 2019-07关于省市区的高德json数据,可用于数据库数据插入。
  • 三级联动高德全国地区json数据,分级明确,包括省、市、区/县(包括所在第经纬度、区号、行政区编码),前端必备的地区选择控件数据
  • 此文件是我经过第一次数据筛选出的世界数据多边形json文件,目前自己已经解析出了多个国家的json数据,也成功通过echarts展示出来,中间一些筛选问题可以自己摸索,也可以参考我的。
  • 三级联动高德全国地区编码json数据,分级嵌套,包括省、市、区/县(包括所在第经纬度、区号、行政区编码),示列:{省:{市:{区:{ "citycode": "020", "adcode": "440106", "name": "天河区", "center": "113....
  • Echarts实例JSON数据

    2019-05-06 10:26:38
    echarts结合百度地图、高德地图实现风向图;echarts实例中json数据;echarts结合百度地图、高德地图实现风向图;echarts实例中json数据
  • 包含了广东省、全市、全区县。所有地图数据json文件。命名是区划编码。
  • 地图数据高德地图是同步的。调用的高德的api获取的行政边界坐标。所以都是最新的行政区划边界。 注意:如果程序报错地图出不来,请自行更换config/config.js 里面的mapkey (自行到高德开发平台申请一个web服务...
  • 实现思路: 1、将矢量文件上传至...5、获取服务端返回数据打印到地图上 6、通过输入经纬度查询最短距离街道 参照效果:http://39.105.201.84:8080/ 附件:https://download.csdn.net/download/ccl67650107...

    实现思路:

    1、将矢量文件上传至服务器

    2、通过geotools读取文件中的数据

    3、数据转换为geojson格式

    4、WGS84转GCj02

    5、获取服务端返回数据打印到地图上

    6、通过输入经纬度查询最短距离街道

     

    参照效果:http://39.105.201.84:8080/

    附件:https://download.csdn.net/download/ccl676501078/11175228

     

     

     

    展开全文
  • 使用高德地图,获取了全国3500+个县级、区级地区的经纬度数据
  • 高德API接口的数据返回的json格式说明 每个城市的线路信息: { "s":"武汉市地铁", "o":"732,573", "l":[ //各条线路属性列表 { //一条线路属性字典 "f":[], "lo":"0", "li":"420100034364|420100034365", ...

    高德API接口的数据返回的json格式说明

    每个城市的线路信息:
    {
    "s":"武汉市地铁",
    "o":"732,573",
    "l":[    //各条线路属性列表
           {    //一条线路属性字典
               "f":[],
               "lo":"0",
               "li":"420100034364|420100034365",
               "ln":"1号线",        //线路名称
               "ls":"420100034364",     //路线编号
                "c":[],
                "cl":"3080B7",
                "lp":["122 463"],
                "su":"1",
                "la":"",
                "st":[    //线路站点属性列表
                          {
                              "sl":"114.329481,30.711953",
                              "sid":"420100034364030",    //站点编号
                              "sp":"han kou bei",
                              "udsi":"420100034364030;420100034365002",
                              "n":"汉口北",            //站名
                              "udpx":"1233 58;1230 55",
                              "si":"420100034364030",        //站点编号
                              "udsu":"1;1",
                              "poiid":"BV10060938",
                              "t":"0",
                              "r":"420100034364",
                              "lg":"2",
                              "p":"1232 57",
                              "udli":"420100034364;420100034365",
                              "su":"1",            //可用状态(1可用,3正在建设)
                              "rs":"1232 57"
                          },
                          ...............
                          {},
                      ],
                "kn":"轨道交通1号线",
                "x":1
           },
           .............
           {},
         ],
    "i":"4201"        //城市编号
    }

    展开全文
  • 在项目中运用到图形展示数据太常见了,echarts是一款使用率非常高的插件工具,很多大平台都是使用echarts;以上是一份全国各个地区坐标数据
  • 完整的三级联动mysql和json数据 区域代码、名称、中心经纬度 "citycode": "010", "adcode": "110000", "name": "北京市", "center": "116.405285,39.904989", "level": "province
  • 长沙市地图JSON

    2016-02-01 13:59:26
    长沙市地图JSON,只包括边缘,不包含内6区边缘图纸。
  • 高德地图API调用和数据解析

    千次阅读 2019-09-04 11:35:18
    调用高德的关键字搜索接口,把获得的数据解析,然后存到自己的数据库中,可以获得你想要的经纬度、地址、邮编等信息。 本次调用的是搜索服务API是一类简单的HTTP接口,提供多种查询POI信息的能力,其中包括关键字...

    前言:

    调用高德的关键字搜索接口,把获得的数据解析,然后存到自己的数据库中,可以获得你想要的经纬度、地址、邮编等信息。

    本次调用的是搜索服务API是一类简单的HTTP接口,提供多种查询POI信息的能力,其中包括关键字搜索、周边搜索、多边形搜索、ID查询四种筛选机制

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

     

    使用说明:

    第一步,申请”Web服务API”密钥(Key);

    第二步,拼接HTTP请求URL,第一步申请的Key需作为必填参数一同发送;

    第三步,接收HTTP请求返回的数据(JSON或XML格式),解析数据。

    如无特殊声明,接口的输入参数和输出数据编码全部统一为UTF-8。

     

    具体步骤:

    1、在官网上创建引用,并获得请求接口所用到的key

     

    2、根据接口发起请求

    URL

    https://restapi.amap.com/v3/place/text

    请求方式

    GET

    示例:

    用的的依赖包

    <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>4.0.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
    </dependency>
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>fastjson</artifactId>
        <version>1.2.38</version>
    </dependency>
    @GetMapping("/getInfos")
    public ResponseEntity getInfo(@RequestParam String keyWord, @RequestParam String city){
        String url = "https://restapi.amap.com/v3/place/text?keywords="+keyWord+"&city="+city+"&output=JSON&offset=2000&page=0&key=2c29679501f73bb9f587a8cf0a87ed13&citylimit=true&extensions=all";
        GaodeLocation result = gaoDeMapUtil.getLocatoin(url);
        return ResponseEntity.ok(result);
    }
    /**
         * 输入地址返回识别后的信息
         *
         * @param address
         * @return 返回的类gaodelocation,详见类
         */
        public GaodeLocation getLocatoin(String address) {
            GaodeLocation location = null;
            if (address != null) {
                try {
                    String result = "";
                    location = new GaodeLocation();
                    OkHttpClient client = new OkHttpClient();
                    Request request = new Request.Builder().url(address).build();
                    try {
                        Response response = client.newCall(request).execute();
                        result = response.body().string();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
    //                String result = OKHttpUtil.httpGet(address);
    
                    JSONObject jsonObject = JSONObject.parseObject(result);
    
                    // 解析json
                    location.setStatus(jsonObject.getString("status"));
                    location.setInfo(jsonObject.getString("info"));
                    location.setCount(jsonObject.getString("count"));
                    List<Geocodes> geocodes = new ArrayList<>();
                    JSONArray jsonArray = jsonObject.getJSONArray("pois");
                    // 遍历解析出来的结果
                    if ((jsonArray != null) && (jsonArray.size() > 0)) {
                        for (int i = 0; i < jsonArray.size(); i++) {
                            JSONObject jo = (JSONObject) jsonArray.get(i);
                            Geocodes go = new Geocodes();
                            go.setFormatted_address(jo.getString("address"));
                            go.setProvince(jo.getString("pname"));
                            go.setCitycode(jo.getString("citycode"));
                            go.setCity(jo.getString("cityname"));
                            go.setDistrict(jo.getString("adname"));
                            // 地址所在的乡镇
                            JSONArray ts = jo.getJSONArray("township");
                            if (ts != null && ts.size() > 0) {
                                go.setTownship(ts.getString(0));
                            }
                            // 地址编号
                            go.setAdcode(jo.getString("adcode"));
                            // 街道
                            JSONArray jd = jo.getJSONArray("street");
                            if (jd != null && jd.size() > 0) {
                                go.setStreet(jd.getString(0));
                            }
                            // 号码
                            JSONArray hm = jo.getJSONArray("number");
                            if (hm != null && hm.size() > 0) {
                                go.setStreet(hm.getString(0));
                            }
                            go.setLocation(jo.getString("location"));
                            go.setLevel(jo.getString("level"));
                            geocodes.add(go);
                        }
                    }
                    locationRepository.saveAll(geocodes);
                    location.setGeocodes(geocodes);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return location;
        }

     

    对应的实体类

    @Data
    public class GaodeLocation {
        private String status;// 结果状态0,表示失败,1:表示成功
        private String count;// 返回结果的数目
        private String info;// 返回状态说明
        private List<Geocodes> geocodes;// 识别的结果列表
    }

     

    @Data
    @Table(name = "address")
    @Entity
    public class Geocodes {
        @Id
        @GenericGenerator(name = "user-info-uuid", strategy = "uuid")
        @GeneratedValue(generator = "user-info-uuid")
        @Column(name = "id")
        private String id;
    
        // 结构化地址信息
        @Column(name = "formatted_address")
        private String formatted_address;
        // 所在省
        @Column(name = "province")
        private String province;
        // 城市
        @Column(name = "city")
        private String city;
        // 城市编码
        @Column(name = "citycode")
        private String citycode;
        // 地址所在的区
        @Column(name = "district")
        private String district;
        // 地址所在的乡镇
        @Column(name = "township")
        private String township;
        // 街道
        @Column(name = "street")
        private String street;
        // 门牌
        @Column(name = "number")
        private String number;
        // 区域编码
        @Column(name = "adcode")
        private String adcode;
        // 坐标点
        @Column(name = "location")
        private String location;
        // 匹配级别
        @Column(name = "level")
        private String level;
    }

    3、注意事项:

    高德的接口返回的数据可以是json格式还可以是xml格式,本次解析的是json格式。

    注意:在此接口之中,您可以通过city&citylimit参数指定希望搜索的城市或区县。而city参数能够接收citycode和adcode,citycode仅能精确到城市,而adcode却能够精确到区县。

    例如:北京,citycode:010,adcode:110000

               北京-海淀区,citycode:010,adcode:110108

    故使用citycode仅能在北京范围内搜索,而adcode能够指定在海淀区搜索。

    综上所述,为了您查询的精确,我们强烈建议您使用adcode。

    另外,无论您指定多少个type,每次请求最多返回1000个POI信息,若场景需要获取更可能多的POI;建议您不要在type之中指定过多的类别,而是分多次请求从而得到更加准确的结果。

     

    下载code编码地址:https://lbs.amap.com/api/webservice/download

     

     

    如果有什么不懂,可以在评论区随时联系我

     

     

     

     

     

     

     

    展开全文
  • 文件中包含全国地图省市县Json文件,echarts 3D地图展示核心代码,地图展示中包含二级穿透效果,示例为辽宁省的,研究了一段时间亲手所写,希望能帮到各位哦!
  • 使用ArcGIS API for JavaScript4.10加载高德地图和高德影像,通过扩展BaseTileLayer来自定义GaodeMapLayer模块。
  • 获取高德地图POI数据

    2021-05-22 15:10:37
    'keywords': keywords, 'types':types, 'region':region, 'page':1, 'city_limit':'true', 'extensions':'all' } filename=region+keywords+types+'POI数据.csv' headers=['id','名称','区县','商圈','地址','经度,...
  • 且只返回第一级的地理坐标 reqs1=requests.get(url=url,params=parameters) jsondata=reqs1.json() #因为上面设置的是返回json格式所以.json return jsondata 高德开发平台 以宁波市为例,获取宁波市行政区域数据。...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 3,497
精华内容 1,398
关键字:

高德地图json地址数据