All Projects → wuwenrufeng → amap

wuwenrufeng / amap

Licence: MIT license
行政区域查询,根据经纬度快速地查找特定的行政区域信息、省市区信息、中国省市区数据。Administrative region query: to quickly find specific administrative region information based on latitude and longitude provincial information urban China data

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to amap

node-isochrone
NodeJS isochrone map library
Stars: ✭ 27 (-12.9%)
Mutual labels:  map, geojson
Mapbox Gl Js
Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
Stars: ✭ 8,017 (+25761.29%)
Mutual labels:  map, geojson
Mapbox Gl Native
Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
Stars: ✭ 4,091 (+13096.77%)
Mutual labels:  map, geojson
China geojson
中国行政区划地图数据(省、市、县),geojson格式,可直接用于D3.js,Echarts.js可视化
Stars: ✭ 51 (+64.52%)
Mutual labels:  map, geojson
Gcoord
地理坐标系转换工具
Stars: ✭ 2,206 (+7016.13%)
Mutual labels:  map, geojson
L7
🌎 Large-scale WebGL-powered Geospatial Data Visualization analysis framework which relies on Mapbox GL or AMap to render basemaps.
Stars: ✭ 2,517 (+8019.35%)
Mutual labels:  map, geojson
Vector Datasource
Tilezen vector tile service - OpenStreetMap data in several formats
Stars: ✭ 427 (+1277.42%)
Mutual labels:  map, geojson
Geojson2svg
Converts geojson to svg string given svg viewport size and maps extent.
Stars: ✭ 117 (+277.42%)
Mutual labels:  map, geojson
Mapbox Gl Native Android
Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL
Stars: ✭ 135 (+335.48%)
Mutual labels:  map, geojson
Mapboxstatic.swift
Static map snapshots with overlays in Swift or Objective-C on iOS, macOS, tvOS, and watchOS
Stars: ✭ 162 (+422.58%)
Mutual labels:  map, geojson
vaguely-rude-places
The map of Vaguely Rude Place Names
Stars: ✭ 19 (-38.71%)
Mutual labels:  map, geojson
MinedMap
Minecraft map renderer and viewer
Stars: ✭ 35 (+12.9%)
Mutual labels:  map
GpsPrune
GpsPrune is a map-based application for viewing, editing and converting coordinate data from GPS systems.
Stars: ✭ 46 (+48.39%)
Mutual labels:  geojson
pdq evaluation
Evaluation code for using probabilistic detection quality (PDQ) measure for probabilistic object detection tasks. Currently supports COCO and robotic vision challenge (RVC) data.
Stars: ✭ 34 (+9.68%)
Mutual labels:  map
mapgen
map generator stuff
Stars: ✭ 26 (-16.13%)
Mutual labels:  map
vue-qqmap
基于Vue3的腾讯地图地址可视化拾取、描点,路径规划插件
Stars: ✭ 21 (-32.26%)
Mutual labels:  map
linq
A familiar set of functions that operate on JavaScript iterables (ES2015+) in a similar way to .NET's LINQ does with enumerables.
Stars: ✭ 39 (+25.81%)
Mutual labels:  map
ExtApp
ExtApp是一个基于三层架构,使用NHibernate、API Controller和ExtJs创建的,用于简化政府和企业应用开发的Web应用程序框架。
Stars: ✭ 14 (-54.84%)
Mutual labels:  map
mapzap.github.io
Build custom responsive web mapping applications without any coding!
Stars: ✭ 22 (-29.03%)
Mutual labels:  geojson
examples-android
Android demo application for GLMap framework
Stars: ✭ 14 (-54.84%)
Mutual labels:  map

🌐 amap 根据经纬度快速查询全国行政区域信息、省市区信息

行政区域查询,根据经纬度快速地查找特定的省市区、行政区域信息。 https://wuwenrufeng.github.io/amap/

Features

  • 免费,免费,免费
  • 打破官方请求量限制,一次生产,终生使用
  • 数据源可靠,数据源来自高德地图开放的HTTP接口
  • 手把手教你自建全国行政区域信息库
  • 手把手教你实现行政区域信息查询算法
  • 快速地查找特定的行政区域信息
  • APi接口调用

项目由来

官方服务有请求限制,又不想升级plus

配置环境

运行环境:需要运行在 python 3.7.4+

1. 安装依赖

git clone https://github.com/wuwenrufeng/amap.git

pip install -r requirements.txt

快速开始

1. 下载数据库文件cn_area.sql,并导入到mysql中

链接:https://pan.baidu.com/s/1zJZTccPjrY4RD_TgAUh84A 提取码:cmuv

2. 数据库访问配置

文件地址:amap/utils/settings.py

# mysql
MYSQL_PARAM = {
    'provider': 'mysql',
    'host': 'localhost',
    'port': 3306,
    'user': 'admin',
    'passwd': '123456',
    'db': 'cn_area'
}

3. 开启api查询服务

   python amapSearchApi.py

4. 开始查询

URL: http://127.0.0.1/search?point=117.195907,39.118327

使用手册

第一步:高德地图-初始化出各省级(有边界信息)、市级和区级的初始信息

   python amapInit.py

第二步:高德地图-补充市、区的边界信息 (ps: 高德不提供有关街道的边界顶点信息)

   python amapPopulate.py

第三步:计算出province, city, district表中的最大最小边界经纬度,并填充到数据库中

   python amapMaxMin.py

第四步:开启服务,查询给定坐标点所属的行政区域信息

   python amapSearchApi.py

点在区域内的判定算法

使用外包矩形+闭合路径包含算法

一级过滤:外包矩形算法

   def in_box(point, maxP, minP):
    """
    判断点是否在多边形的外包矩形中 
    point: 待判定的坐标点 
    maxP: 最大坐标点 
    minP: 最小坐标点 
    """
    return (minP.x <= point.x <= maxP.x) and (minP.y <= point.y <= maxP.y)

二级过滤:闭合路径包含算法

   def in_polyline(point, polyline):
    """
    根据经纬度,判断是否在区域内 
    point: 待判定的坐标点 
    polyline: 边界坐标
    """
    lats = []
    lngs = []
    for pol in polyline:
        lats.append(pol.x)
        lngs.append(pol.y)
    xc = np.array(lats)
    yc = np.array(lngs)
    xycrop=np.vstack((xc,yc)).T
    pth=Path(xycrop,closed=False)
    mask=pth.contains_points([[point.x,point.y]])
    if mask:
        return True
    return False

测试结果

测试环境:个人PC

1.查询耗时

2.查询准确率

PS: 准确率测试是使用区级center进行查询的,所得准确率应该是100%,丢失的准确率是因为官方将center标记错误了!
比如抚顺县的实际地理区域是不包含抚顺县的,但官方的center却标到了抚顺县。

😜

后续更新。。。

GPS坐标、mapbar坐标、baidu坐标转换成高德坐标

逆地址地理信息解析

交流 & 讨论

如果您对amap有任何疑问,欢迎添加作者微信(微信号:wuwenrufeng)来交流讨论。或者,您可以扫下方二维码给作者打赏去升级其他地图api套件或买一杯咖啡哈🥰

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].