CN111260521B - A method, device, intelligent terminal and storage medium for acquiring city boundaries - Google Patents
A method, device, intelligent terminal and storage medium for acquiring city boundaries Download PDFInfo
- Publication number
- CN111260521B CN111260521B CN201911141024.8A CN201911141024A CN111260521B CN 111260521 B CN111260521 B CN 111260521B CN 201911141024 A CN201911141024 A CN 201911141024A CN 111260521 B CN111260521 B CN 111260521B
- Authority
- CN
- China
- Prior art keywords
- rectangle
- rectangles
- leaf node
- quadtree
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000012545 processing Methods 0.000 claims abstract description 8
- 238000010276 construction Methods 0.000 claims description 15
- 238000007499 fusion processing Methods 0.000 claims description 9
- 238000004364 calculation method Methods 0.000 claims description 4
- 230000011218 segmentation Effects 0.000 claims description 4
- 238000012216 screening Methods 0.000 claims description 2
- 230000008030 elimination Effects 0.000 claims 1
- 238000003379 elimination reaction Methods 0.000 claims 1
- 230000004927 fusion Effects 0.000 abstract description 6
- 238000003672 processing method Methods 0.000 abstract description 2
- 238000004590 computer program Methods 0.000 description 6
- 238000011161 development Methods 0.000 description 4
- 230000018109 developmental process Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 238000000844 transformation Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/10—Services
- G06Q50/26—Government or public services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A30/00—Adapting or protecting infrastructure or their operation
- Y02A30/60—Planning or developing urban green infrastructure
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Tourism & Hospitality (AREA)
- General Physics & Mathematics (AREA)
- Economics (AREA)
- Health & Medical Sciences (AREA)
- Primary Health Care (AREA)
- Strategic Management (AREA)
- Human Resources & Organizations (AREA)
- General Business, Economics & Management (AREA)
- General Health & Medical Sciences (AREA)
- Marketing (AREA)
- Educational Administration (AREA)
- Development Economics (AREA)
- Remote Sensing (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
Description
技术领域technical field
本发明涉空间数据分析技术领域,尤其涉及一种城市边界获取方法、装置、智能终端及存储介质。The present invention relates to the technical field of spatial data analysis, in particular to a method, device, intelligent terminal and storage medium for acquiring city boundaries.
背景技术Background technique
城市计算表示利用计算机技术,从城市多源异构大数据中挖掘有价值的信息,探索城市中内涵的科学规律,从而更好的为人类生活服务促使城市高效健康的运转。Urban computing refers to the use of computer technology to mine valuable information from urban multi-source heterogeneous big data and explore the scientific laws inherent in the city, so as to better serve human life and promote the efficient and healthy operation of the city.
城市表示人类居住生活高度集中的区域,城市边界的准确描述能够帮助政府监测城市建设区是否无序扩张和协调规划城市居民出行和公共设施配置之间的关系,为城市可持续发展做出贡献,因此是城市计算的一项重要内容。A city represents an area where human living is highly concentrated. An accurate description of the city boundary can help the government monitor the disorderly expansion of the urban construction area and coordinate the relationship between the planning of urban residents' travel and the allocation of public facilities, contributing to the sustainable development of the city. Therefore, it is an important part of urban calculation.
目前,城市的边界由地方当局或政府决定,这种自上而下的界定方式可能会与真实人类活动的区域有所出入。除此之外,有些技术通过信息熵法、断裂点分析法、遥感夜光灯判读等方法界定城市的边界,这些方法主要有两个弊端:1.人为阈值的界定比较模糊而且效率,主观性较强,难以做到准确客观2.界定范围时所依托的数据结构(如三角面)构建效率非常低,当数据量大时将无法得出理想结果。Currently, the boundaries of cities are determined by local authorities or governments, and this top-down approach may differ from real human-occupied areas. In addition, some technologies define the boundaries of cities through methods such as information entropy method, breaking point analysis method, and remote sensing luminous lamp interpretation. Strong, it is difficult to be accurate and objective 2. The data structure (such as triangular surface) relied on to define the scope is very inefficient to construct, and the ideal result cannot be obtained when the amount of data is large.
因此,现有技术还有待于改进和发展。Therefore, the prior art still needs to be improved and developed.
发明内容Contents of the invention
鉴于上述现有技术的不足,本发明的目的在于提供一种城市边界获取方法、装置、智能终端及存储介质,旨在解决现有技术中城市边界划分方法效率低下,主观性强的问题。In view of the above deficiencies in the prior art, the purpose of the present invention is to provide a method, device, intelligent terminal and storage medium for acquiring city boundaries, aiming at solving the problems of low efficiency and strong subjectivity in the prior art for dividing the city boundaries.
本发明为解决上述技术问题所采用的技术方案如下:The technical scheme that the present invention adopts for solving the problems of the technologies described above is as follows:
第一方面,本发明实施例提供一种城市边界获取方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a method for obtaining a city boundary, the method comprising:
根据路网数据获取道路交叉点集,对所述道路交叉点集内的道路交叉点构建四叉树,所述四叉树的每一叶子节点存储一个所述道路交叉点;Acquiring a road intersection set according to the road network data, constructing a quadtree for the road intersections in the road intersection set, each leaf node of the quadtree stores one road intersection;
根据所述每一叶子节点所对应的矩形的几何信息计算密度值,并根据所述密度值将所述每一叶子节点所对应的矩形分为目标类矩形和背景类矩形;所述密度值为所述矩形面积的倒数;Calculate the density value according to the geometric information of the rectangle corresponding to each leaf node, and divide the rectangle corresponding to each leaf node into a target-type rectangle and a background-type rectangle according to the density value; the density value is the reciprocal of the area of said rectangle;
对分类后的目标类矩形按照相邻接的拓扑关系进行非跨区域融合处理,得到城市边界。According to the adjacent topological relationship, non-cross-regional fusion processing is performed on the classified object class rectangles to obtain the city boundary.
所述的城市边界获取方法,其中,所述构建四叉树,具体构建过程:The method for obtaining the city boundary, wherein, the construction of the quadtree, the specific construction process:
计算所有所述道路交叉点的外包络矩形,并将所述外包络矩形作为根节点;Calculating the outer envelope rectangles of all road intersections, and using the outer envelope rectangles as root nodes;
生成深度为N满四叉树,并计算每个道路交叉点和叶子节点矩形的关系,保存叶子节点矩形中的点数≤1的矩形;所述N为大于1且小于9的自然数;Generate a quadtree full of N in depth, and calculate the relationship between each road intersection and the leaf node rectangle, and save the rectangle with the number of points≤1 in the leaf node rectangle; the N is a natural number greater than 1 and less than 9;
对每个点数大于1的矩形,独立生成四叉树,直到所有叶子节点矩形中的点数≤1为止,并保存这些矩形;整合所有点数≤1的矩形,结束。For each rectangle whose number of points is greater than 1, independently generate a quadtree until the number of points in all leaf node rectangles ≤ 1, and save these rectangles; integrate all rectangles with a number of points ≤ 1, and end.
所述的城市边界获取方法,其中,所述步骤根据所述叶子节点所对应的矩形的几何信息计算密度值,根据所述密度值将所述叶子节点所对应的矩形分为目标类矩形和背景类矩形,具体为:The method for obtaining the city boundary, wherein, the step calculates a density value according to the geometric information of the rectangle corresponding to the leaf node, and divides the rectangle corresponding to the leaf node into a target rectangle and a background rectangle according to the density value. Rectangle-like, specifically:
利用公式(1)将所有矩形分为目标类矩形和背景类矩形两个部分Use formula (1) to divide all rectangles into two parts: target rectangle and background rectangle
其中,d为目标与背景的分割阈值,σw为目标和背景密度值的差,w0为目标点数占图像比例,σ0为目标点数占图像比例的方差,w1为背景点数占图像比例,σ1为背景点数占图像比例的方差;提取处于目标类的所有矩形信息。Among them, d is the segmentation threshold of the target and the background, σ w is the difference between the density value of the target and the background, w 0 is the proportion of the target points in the image, σ 0 is the variance of the target points in the image proportion, and w 1 is the proportion of the background points in the image , σ 1 is the variance of the proportion of background points in the image; extract all the rectangular information in the target class.
所述的城市边界获取方法,其中,所述步骤对分类后的目标类矩形按照相邻接的拓扑关系进行非跨区域融合处理,得到城市边界,其中非跨区域融合处理包括步骤:The method for obtaining the city boundary, wherein, the step performs non-cross-region fusion processing on the classified target rectangles according to the adjacent topological relationship to obtain the city boundary, wherein the non-cross-region fusion processing includes the steps of:
从分类后的目标类矩形中的任一矩形开始,筛选出与该矩形的邻接矩形,将所述邻接矩形存入到预先设置的集合中;Starting from any rectangle in the classified target class rectangles, filter out the adjacent rectangles to the rectangle, and store the adjacent rectangles into a preset set;
遍历每个邻接矩形,重复步骤筛选出与该矩形的邻接矩形,将所述邻接矩形存入到预先设置的集合中,直到不再有新的邻接矩形为止;Traverse each adjacent rectangle, repeat the steps to filter out the adjacent rectangles to the rectangle, and store the adjacent rectangles in the preset collection until there are no new adjacent rectangles;
消除所述集合中的所有矩形的共同边,生成城市边界,结束。Eliminate common sides of all rectangles in the set, generate city boundaries, end.
所述的城市边界获取方法,其中,所述N为7。The method for obtaining city boundaries, wherein the N is 7.
第二方面,一种城市边界获取装置,所述装置包括:In a second aspect, a device for acquiring city boundaries, the device includes:
四叉树构建单元,用于根据路网数据获取道路交叉点集,对所述道路交叉点集内的道路交叉点构建四叉树,所述四叉树的每一叶子节点存储一个所述道路交叉点;A quadtree construction unit, configured to obtain a road intersection set according to road network data, and construct a quadtree for road intersections in the road intersection set, each leaf node of the quadtree stores one road intersection;
矩形分类单元,根据所述每一叶子节点所对应的矩形的几何信息计算密度值,并根据所述密度值将所述每一叶子节点所对应的矩形分为目标类和背景类;所述密度值为所述矩形面积的倒数;The rectangle classification unit calculates a density value according to the geometric information of the rectangle corresponding to each leaf node, and divides the rectangle corresponding to each leaf node into a target class and a background class according to the density value; the density The value is the reciprocal of the area of the rectangle;
处理单元,用于对分类后的目标类矩形按照相邻接的拓扑关系进行非跨区域融合处理,得到城市边界。The processing unit is configured to perform non-cross-region fusion processing on the classified object class rectangles according to the adjacent topological relationship to obtain the city boundary.
所述的装置,其中,所述四叉树构建单元包括:The device, wherein the quadtree construction unit includes:
计算子单元,用于计算所有所述道路交叉点的外包络矩形,并将所述外包络矩形作为根节点;a calculation subunit, configured to calculate the outer envelope rectangles of all road intersections, and use the outer envelope rectangles as the root node;
生成子单元,生成深度为N满四叉树,并计算每个道路交叉点和叶子节点矩形的关系,保存叶子节点矩形中的点数≤1的矩形;所述N为大于1且小于9的自然数;Generate subunits, generate a full quadtree with a depth of N, and calculate the relationship between each road intersection and the leaf node rectangle, and save the rectangle with the number of points in the leaf node rectangle ≤ 1; the N is a natural number greater than 1 and less than 9 ;
存储子单元,用于对每个点数大于1的矩形,独立生成四叉树,直到所有叶子节点矩形中的点数≤1为止,并保存这些矩形;整合所有点数≤1的矩形,结束。The storage sub-unit is used to independently generate a quadtree for each rectangle whose number of points is greater than 1, until the number of points in all leaf node rectangles is ≤1, and save these rectangles; integrate all rectangles with a number of points ≤1, and end.
所述的装置,其中,所述处理单元包括:The device, wherein the processing unit includes:
筛选自单元,用于从分类后的目标类矩形中的任一矩形开始,筛选出与该矩形的邻接矩形,将所述邻接矩形存入到预先设置的集合中;The self-screening unit is used to start from any rectangle in the classified target class rectangles, filter out the adjacent rectangles with the rectangle, and store the adjacent rectangles in the preset set;
遍历子单元,用于遍历每个邻接矩形,重复步骤筛选出与该矩形的邻接矩形,将所述邻接矩形存入到预先设置的集合中,直到不再有新的邻接矩形为止;The traversing subunit is used to traverse each adjacent rectangle, repeat the steps to filter out the adjacent rectangles to the rectangle, and store the adjacent rectangles in the preset collection until there are no new adjacent rectangles;
消除自单元,用于消除所述集合中的所有矩形的共同边,生成城市边界,结束。Eliminate self-units for eliminating common sides of all rectangles in the set, generating city boundaries, end.
第三方面,本发明实施例还提供一种智能终端,包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于执行如上述所述的方法。In the third aspect, the embodiment of the present invention also provides an intelligent terminal, including a memory, and one or more programs, wherein one or more programs are stored in the memory, and configured to be executed by one or more processors The one or more programs include methods for performing the methods described above.
第四方面,本发明实施例还提供一种非临时性计算机可读存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如上述所述的方法。In a fourth aspect, the embodiment of the present invention further provides a non-transitory computer-readable storage medium, and when instructions in the storage medium are executed by a processor of the electronic device, the electronic device can execute the method as described above.
本发明的有益效果:本发明通过建立空间四叉树,对全国范围内道路交叉口快速聚类并生成城市边界范围方法,能准确描述能够帮助政府监测城市建设区是否无序扩张和协调规划城市居民出行和公共设施配置之间的关系,对城市可持续发展有着重要意义。Beneficial effects of the present invention: the present invention quickly clusters road intersections across the country and generates urban boundary range methods by establishing a spatial quadtree, which can accurately describe and can help the government monitor whether the urban construction area is expanding out of order and coordinate the planning of the city The relationship between residents' travel and the configuration of public facilities is of great significance to the sustainable development of cities.
附图说明Description of drawings
图1是本发明提供的城市边界获取方法的较佳实施例的流程图。Fig. 1 is a flowchart of a preferred embodiment of the method for acquiring city boundaries provided by the present invention.
图2是本发明提供的城市边界获取方法的较佳实施例步骤S100的流程图。FIG. 2 is a flow chart of step S100 of a preferred embodiment of the method for acquiring city boundaries provided by the present invention.
图3是本发明提供的智能终端的功能原理图。Fig. 3 is a functional schematic diagram of the smart terminal provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案及优点更加清楚、明确,以下参照附图并举实施例对本发明进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention more clear and definite, the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.
由于现有技术中的对城市边界的划分、获取多采用如下方式:Due to the division and acquisition of city boundaries in the prior art, the following methods are often used:
一是相关部门规划设定,采用这种规划设定的方式,主观性较强,所得到的城市边界与实际的城市边界有出入。二是依托数据信息,通过信息熵法、断点分析法、遥感夜光灯判读等方法,这些方法在界定范围时所依托的数据结构构建效率非常低,当数据量较大时将无法得出想要的结果。The first is the planning and setting of relevant departments. Using this method of planning and setting is highly subjective, and the obtained city boundaries are different from the actual city boundaries. The second is to rely on data information, through methods such as information entropy method, breakpoint analysis method, and remote sensing luminous lamp interpretation. These methods rely on very low data structure construction efficiency when defining the scope. desired result.
为了解决上述技术问题,在本发明实施例中,当需要对某个城市进行边界界定时,可以先获取全国路网数据或者该城市所在的省路网数据。根据上述路网数据从中分析出道路交叉点(道路交叉口点),将道路交叉口点汇聚在一起形成点集,接着对道路交叉口点构建满四叉树,令四叉树上的每一个叶子节点只存储一个对应的道路交叉口点。计算叶子节点所对应的矩形的面积,从而计算出点密度值,根据点密度值对与之对应的矩形进行分类,分类可以分为两类,如目标(城市)、背景(非城市),即可以根据点密度值将点集中的点分为目标类和背景类。对目标类中的矩形按照相邻接的拓扑关系进行非跨区域融合Dissolve处理,得到城市边界。In order to solve the above technical problems, in the embodiment of the present invention, when it is necessary to define the boundary of a certain city, the national road network data or the road network data of the province where the city is located can be obtained first. According to the above road network data, the road intersection points (road intersection points) are analyzed, the road intersection points are brought together to form a point set, and then a full quadtree is constructed for the road intersection points, so that each of the quadtrees A leaf node only stores a corresponding road intersection point. Calculate the area of the rectangle corresponding to the leaf node, so as to calculate the point density value, and classify the corresponding rectangle according to the point density value. The classification can be divided into two categories, such as target (city), background (non-city), namely The points in the point set can be divided into object class and background class according to the point density value. Perform non-cross-regional fusion Dissolve on the rectangles in the target class according to the adjacent topological relationship to obtain the city boundary.
本发明通过建立空间四叉树,对全国范围内道路交叉口快速聚类并生成城市边界范围方法,能准确描述能够帮助政府监测城市建设区是否无序扩张和协调规划城市居民出行和公共设施配置之间的关系,对城市可持续发展有着重要意义。The invention establishes a spatial quadtree, quickly clusters road intersections across the country and generates a method of urban boundaries, which can accurately describe and help the government monitor whether the urban construction area is expanding out of order and coordinate the planning of urban residents' travel and public facility configuration. The relationship between them is of great significance to the sustainable development of cities.
举例说明,若用户想定义深圳的边界,则只需要使用全国或全广东省的路网数据,取得道路交叉口点集,然后按照上述步骤生成全广东或全国所有城市的边界(包括深圳市)。由于城市边界代表了人类活动相对集中的区域,所以要确定一个城市的边界,则必须选择一个比其更大的区划范围来对其进行界定。否则如果仅使用深圳市内的道路交叉口,得到的结果不会是深圳城市边界,而是深圳各个区的边界。For example, if the user wants to define the boundary of Shenzhen, he only needs to use the road network data of the whole country or Guangdong Province to obtain the road intersection point set, and then follow the above steps to generate the boundaries of all cities in Guangdong or the whole country (including Shenzhen) . Since the city boundary represents the relatively concentrated area of human activities, in order to determine the boundary of a city, it is necessary to select a larger area to define it. Otherwise, if only the road intersections in Shenzhen are used, the result will not be the city boundary of Shenzhen, but the boundaries of various districts in Shenzhen.
下面结合附图,详细说明本发明的各种非限制性实施方式。Various non-limiting embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings.
示例性方法exemplary method
参见图1,本实施例提供一种城市边界获取方法,包括如下步骤:Referring to Fig. 1, the present embodiment provides a method for acquiring city boundaries, comprising the following steps:
步骤100、根据路网数据获取道路交叉点集,对所述道路交叉点集内的道路交叉点构建四叉树,所述四叉树的每一叶子节点存储一个所述道路交叉点。Step 100: Obtain a road intersection set according to the road network data, construct a quadtree for the road intersections in the road intersection set, and store one road intersection in each leaf node of the quadtree.
具体来说,路网数据主要是公路网数据,也可以结合铁路网数据,上述路网数据的获得,可以通过大数据进行采集,路网数据具体的获取可以是现有技术中的任何一种方式,只要能满足需要即可。从已知的路网数据中分析出道路的交叉口,路网数据中的每个交叉口记为一个点,将所得到的所有道路交叉口点形成点集。对点集内的所有点构建四叉树。Specifically, road network data is mainly road network data, and can also be combined with railway network data. The above-mentioned road network data can be collected through big data. The specific acquisition of road network data can be any of the existing technologies. method, as long as it can meet the needs. The road intersections are analyzed from the known road network data, each intersection in the road network data is recorded as a point, and all road intersection points obtained form a point set. Construct a quadtree for all points in the point set.
在本实施例中,获取路网中的道路交叉点集,是因为道路交叉口密度反应了城市基础设施的建设情况,通过对其聚类可以有效判定城市土地的实际空间发展。In this embodiment, the road intersection set in the road network is obtained because the density of road intersections reflects the construction of urban infrastructure, and the actual spatial development of urban land can be effectively determined by clustering them.
参见图2,步骤S100中,四叉树的构建步骤为:Referring to Fig. 2, in step S100, the construction step of quadtree is:
S110、计算所有所述道路交叉点的外包络矩形,并将所述外包络矩形作为根节点;S110. Calculate the outer envelope rectangles of all road intersections, and use the outer envelope rectangles as a root node;
S120、生成深度为N满四叉树,并计算每个道路交叉点和叶子节点矩形的关系,保存叶子节点矩形中的点数≤1的矩形;所述N为大于1且小于9的自然数;S120. Generate a full quadtree with a depth of N, and calculate the relationship between each road intersection and the leaf node rectangle, and save the rectangle with the number of points in the leaf node rectangle≤1; the N is a natural number greater than 1 and less than 9;
S130、对每个点数大于1的矩形,独立生成四叉树,直到所有叶子节点矩形中的点数≤1为止,并保存这些矩形;整合所有点数≤1的矩形,结束。S130. For each rectangle with a number of points greater than 1, independently generate a quadtree until the number of points in all leaf node rectangles is ≤1, and save these rectangles; integrate all rectangles with a number of points ≤1, and end.
具体来说,通常地理空间划分往往使用满四叉树结构来可视化不同尺度的空间信息(如栅格切片),但是此方式存在的缺点较为明显。普遍来讲,地图层级由全球范围到街道尺度多达15-20层,如果以满四叉树方式构建,到达第十六层需要的矩形数量高达50亿之多,占用空间高达几TB字节,往往超出了计算机内存的处理能力。本发明采取了先广度再深度的四叉树构建方法,具体来讲,先通过广度优先的方法生成N层(如7-9层)的满四叉树,并且在最后一层子节点中存储空间实体信息,接着对子节点中包含较多要素的区域进行深度优先方式递归做到只有一个空间要素为止。为了避免四叉树结构的不平衡以及存储空间的浪费,将地理实体信息存储在完全包含它的最小矩形节点中,不存储在它的父节点中,每个地理实体只在树中存储一次,避免存储空间的浪费。Specifically, usually the full quadtree structure is often used in geospatial division to visualize spatial information of different scales (such as raster slices), but the disadvantages of this method are obvious. Generally speaking, the map level ranges from the global scale to the street scale as many as 15-20 layers. If it is constructed in a full quadtree, the number of rectangles required to reach the sixteenth layer is as high as 5 billion, and the space occupied is as high as several terabytes. , often beyond the processing capabilities of the computer's memory. The present invention adopts the quadtree construction method of first breadth and then depth, specifically, first generates a full quadtree of N layers (such as 7-9 layers) by a breadth-first method, and stores it in the last layer of child nodes Spatial entity information, and then perform depth-first recursive recursion on the area containing more elements in the child nodes until there is only one spatial element. In order to avoid the imbalance of the quadtree structure and the waste of storage space, the geographic entity information is stored in the smallest rectangular node that completely contains it, not in its parent node, and each geographic entity is only stored once in the tree. Avoid wasting storage space.
在本实施例中,构建成的四叉树为深度为7的满四叉树,其中7层的满四叉树节点个数为16384个,在该层基础上能够顺利进行后续步骤,如若四叉树为深度9层,则所需要的内存在32G左右。In this embodiment, the constructed quadtree is a full quadtree with a depth of 7, wherein the number of full quadtree nodes in the 7th layer is 16384, and subsequent steps can be carried out smoothly on the basis of this layer, if four The fork tree has a depth of 9 layers, and the required memory is about 32G.
S200、根据所述每一叶子节点所对应的矩形的几何信息计算密度值,并根据所述密度值将所述每一叶子节点所对应的矩形分为目标类矩形和背景类矩形;所述密度值为所述矩形面积的倒数。S200. Calculate a density value according to the geometric information of the rectangle corresponding to each leaf node, and divide the rectangle corresponding to each leaf node into a target-type rectangle and a background-type rectangle according to the density value; the density The value is the reciprocal of the area of the rectangle in question.
步骤S200具体为,将每个矩形看做像素,计算每个点对应的密度值(1/矩形面积)看作像素值来计算阈值,阈值为最大类间方差(公Step S200 is specifically, regard each rectangle as a pixel, calculate the density value (1/rectangle area) corresponding to each point as the pixel value to calculate the threshold, and the threshold is the maximum between-class variance (common
式1)所计算出来的结果。公式(1)如下:The result calculated by formula 1). Formula (1) is as follows:
其中,d为目标与背景的分割阈值,σw为目标和背景密度值的差,w0为目标点数占图像比例,σ0为目标点数占图像比例的方差,w1为背景点数占图像比例,σ1为背景点数占图像比例的方差;Among them, d is the segmentation threshold of the target and the background, σ w is the difference between the density value of the target and the background, w 0 is the proportion of the target points in the image, σ 0 is the variance of the target points in the image proportion, and w 1 is the proportion of the background points in the image , σ 1 is the variance of the proportion of background points in the image;
当像素值小于公式(1)计算出来的像素阈值时,则表示该矩形为目标,像素值大于公式(1)计算出来的像素阈值时,则表示该矩形为背景,即通过采用上述方式提取出处于前景类的所有矩形信息。因为是两类分类,则将处于前景类的所有矩形信息后,背景矩形信息也可以得到。When the pixel value is less than the pixel threshold calculated by the formula (1), it means that the rectangle is the target, and when the pixel value is greater than the pixel threshold calculated by the formula (1), it means that the rectangle is the background, that is, by using the above method to extract Information about all rectangles in the foreground class. Because it is a two-class classification, after all the rectangle information of the foreground class, the background rectangle information can also be obtained.
S300、对分类后的矩形按照相邻接的拓扑关系进行非跨区域融合处理,得到城市边界。S300. Perform non-cross-region fusion processing on the classified rectangles according to adjacent topological relationships to obtain city boundaries.
具体来说,对分类后的矩形按照拓扑关系进行非跨区域融合Dissolve处理,其中Dissolve处理表示融合相邻接(共边)的目标矩形,流程如下:在前景类矩形中,由任意矩形开始找到与该矩形相邻接的矩形,存放到指定集合中,遍历每个邻接矩形,重复上述步骤,直到不再有新的邻接矩形为止。消除集合中所有矩形的共同边,形成新的多边形,所得到的新多边形即为城市边界。Specifically, non-cross-region fusion Dissolve processing is performed on the classified rectangles according to the topological relationship, where Dissolve processing refers to the fusion of adjacent (co-edge) target rectangles. The process is as follows: in the foreground class rectangle, start from any rectangle to find The rectangles adjacent to this rectangle are stored in the specified collection, each adjacent rectangle is traversed, and the above steps are repeated until there are no new adjacent rectangles. Eliminate the common sides of all rectangles in the set to form a new polygon, and the resulting new polygon is the city boundary.
基于上述实施例,本发明还提供了一种智能终端,其原理框图可以如图3所示。该智能终端包括通过系统总线连接的处理器、存储器、网络接口、显示屏、温度传感器。其中,该智能终端的处理器用于提供计算和控制能力。该智能终端的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该智能终端的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种城市边界获取方法。该智能终端的显示屏可以是液晶显示屏或者电子墨水显示屏,该智能终端的温度传感器是预先在智能终端内部设置,用于检测内部设备的当前运行温度。Based on the above embodiments, the present invention also provides a smart terminal, the functional block diagram of which can be shown in FIG. 3 . The intelligent terminal includes a processor, a memory, a network interface, a display screen and a temperature sensor connected through a system bus. Wherein, the processor of the smart terminal is used to provide calculation and control capabilities. The memory of the smart terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the smart terminal is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, a method for acquiring city boundaries is realized. The display screen of the smart terminal may be a liquid crystal display screen or an electronic ink display screen, and the temperature sensor of the smart terminal is pre-set inside the smart terminal to detect the current operating temperature of the internal device.
本领域技术人员可以理解,图3中示出的原理框图,仅仅是与本发明方案相关的部分结构的框图,并不构成对本发明方案所应用于其上的智能终端的限定,具体的智能终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the functional block diagram shown in Figure 3 is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the intelligent terminal to which the solution of the present invention is applied. The specific intelligent terminal More or fewer components than shown in the figures may be included, or certain components may be combined, or have a different arrangement of components.
在一个实施例中,提供了一种智能终端,包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于进行以下操作的指令:In one embodiment, an intelligent terminal is provided, including a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be executed by one or more processors. One or more programs contain instructions for:
根据路网数据获取道路交叉点集,对所述道路交叉点集内的道路交叉点构建四叉树,所述四叉树的每一叶子节点存储一个所述道路交叉点;Acquiring a road intersection set according to the road network data, constructing a quadtree for the road intersections in the road intersection set, each leaf node of the quadtree stores one road intersection;
根据所述每一叶子节点所对应的矩形的几何信息计算密度值,并根据所述密度值对所述叶子节点所对应的矩形进行分类;所述密度值为所述矩形面积的倒数;calculating a density value according to the geometric information of the rectangle corresponding to each leaf node, and classifying the rectangle corresponding to the leaf node according to the density value; the density value is the reciprocal of the area of the rectangle;
对分类后的矩形按照相邻接的拓扑关系进行非跨区域融合处理,得到城市边界。The classified rectangles are processed by non-cross-regional fusion according to the adjacent topological relationship to obtain the city boundary.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本发明所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any reference to memory, storage, database or other media used in the various embodiments provided by the present invention may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
综上所述,本发明公开了一种城市边界获取方法、装置、智能终端以及存储介质。所述方法包括:根据路网数据获取道路交叉点集,对所述点集内的道路交叉点构建四叉树,所述四叉树的每一叶子节点存储一个所述道路交叉点;根据所述叶子节点所对应的矩形的几何信息计算密度值,并根据所述密度值对所述叶子节点所对应的矩形进行分类;所述密度值为所述矩形面积的倒数;对分类后的矩形按照相邻接的拓扑关系进行非跨区域融合Dissolve处理,得到城市边界。本发明改进了对城市大数据空间信息的空间四叉树索引处理方法,并依据该类型数据的非线性的密度特征进行聚类。相较于传统的城市数据的聚类方法,该方法不需提前设置参数,并且速度快、可扩展性强,能够有效帮助挖掘城市化或人类城市活动的非线性空间规律。To sum up, the present invention discloses a method, a device, an intelligent terminal and a storage medium for acquiring a city boundary. The method includes: obtaining a road intersection set according to road network data, constructing a quadtree for the road intersections in the point set, each leaf node of the quadtree stores one road intersection; according to the Calculate the density value of the geometric information of the rectangle corresponding to the leaf node, and classify the rectangle corresponding to the leaf node according to the density value; the density value is the reciprocal of the area of the rectangle; the classified rectangle according to The adjacent topological relationship is processed by non-cross-region fusion Dissolve to obtain the city boundary. The invention improves the spatial quadtree index processing method for urban big data spatial information, and performs clustering according to the nonlinear density feature of this type of data. Compared with the traditional clustering method of urban data, this method does not need to set parameters in advance, and is fast and scalable, which can effectively help to mine the nonlinear spatial laws of urbanization or human urban activities.
应当理解的是,本发明的应用不限于上述的举例,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,所有这些改进和变换都应属于本发明所附权利要求的保护范围。It should be understood that the application of the present invention is not limited to the above examples, and those skilled in the art can make improvements or transformations according to the above descriptions, and all these improvements and transformations should belong to the protection scope of the appended claims of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911141024.8A CN111260521B (en) | 2019-11-20 | 2019-11-20 | A method, device, intelligent terminal and storage medium for acquiring city boundaries |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911141024.8A CN111260521B (en) | 2019-11-20 | 2019-11-20 | A method, device, intelligent terminal and storage medium for acquiring city boundaries |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111260521A CN111260521A (en) | 2020-06-09 |
CN111260521B true CN111260521B (en) | 2023-04-28 |
Family
ID=70946700
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911141024.8A Active CN111260521B (en) | 2019-11-20 | 2019-11-20 | A method, device, intelligent terminal and storage medium for acquiring city boundaries |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111260521B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112257207B (en) * | 2020-10-27 | 2021-08-06 | 智慧足迹数据科技有限公司 | Road network boundary determining method and device, electronic equipment and storage medium |
CN113591192B (en) * | 2021-07-30 | 2024-03-22 | 北京软通智慧科技有限公司 | Urban ventilation system analysis method and device, storage medium and electronic equipment |
CN117272914B (en) * | 2023-10-31 | 2024-03-12 | 北京智芯仿真科技有限公司 | Method and device for quickly determining copper-clad shape to form topological structure based on quadtree |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108133098A (en) * | 2017-12-21 | 2018-06-08 | 华东交通大学 | Based on the bridge local vibration of FE-SEA mixing methods and the Forecasting Methodology of construct noise |
CN108304773A (en) * | 2017-12-25 | 2018-07-20 | 广州市高科通信技术股份有限公司 | A kind of vehicle density analysis method, device, electronic equipment and storage medium based on wavelet transformation |
CN109948861A (en) * | 2019-03-26 | 2019-06-28 | 西南交通大学 | A short-term passenger flow prediction method for urban rail transit based on modal decomposition and deep learning |
CN109947889A (en) * | 2019-03-21 | 2019-06-28 | 佳都新太科技股份有限公司 | Spatial data management method, apparatus, equipment and storage medium |
CN110046215A (en) * | 2019-04-17 | 2019-07-23 | 腾讯科技(深圳)有限公司 | The processing method and client and server of a kind of road net data |
-
2019
- 2019-11-20 CN CN201911141024.8A patent/CN111260521B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108133098A (en) * | 2017-12-21 | 2018-06-08 | 华东交通大学 | Based on the bridge local vibration of FE-SEA mixing methods and the Forecasting Methodology of construct noise |
CN108304773A (en) * | 2017-12-25 | 2018-07-20 | 广州市高科通信技术股份有限公司 | A kind of vehicle density analysis method, device, electronic equipment and storage medium based on wavelet transformation |
CN109947889A (en) * | 2019-03-21 | 2019-06-28 | 佳都新太科技股份有限公司 | Spatial data management method, apparatus, equipment and storage medium |
CN109948861A (en) * | 2019-03-26 | 2019-06-28 | 西南交通大学 | A short-term passenger flow prediction method for urban rail transit based on modal decomposition and deep learning |
CN110046215A (en) * | 2019-04-17 | 2019-07-23 | 腾讯科技(深圳)有限公司 | The processing method and client and server of a kind of road net data |
Also Published As
Publication number | Publication date |
---|---|
CN111260521A (en) | 2020-06-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111260521B (en) | A method, device, intelligent terminal and storage medium for acquiring city boundaries | |
CN110019568B (en) | Spatial clustering-based addressing method and device, computer equipment and storage medium | |
Wei et al. | On the spatial distribution of buildings for map generalization | |
CN112733781B (en) | Identification method, storage medium and electronic device of urban functional area combined with POI data | |
CN103092853B (en) | The method for building up of a kind of spatial index, using method and device | |
CN108427965A (en) | A kind of hot spot region method for digging based on road network cluster | |
CN109798903A (en) | Method and device for acquiring road information from map data | |
CN111062368B (en) | City update region monitoring method based on Landsat time sequence remote sensing image | |
CN106650618A (en) | Random forest model-based population data spatialization method | |
CN109933635A (en) | A kind of method and device updating map data base | |
CN112288247A (en) | Soil heavy metal risk identification method based on space interaction relation | |
CN110222959A (en) | A kind of urban employment accessibility measuring method and system based on big data | |
CN117033366B (en) | Knowledge-graph-based ubiquitous space-time data cross verification method and device | |
Shi et al. | Capturing urban recreational hotspots from GPS data: A new framework in the lens of spatial heterogeneity | |
He et al. | Using tencent user location data to modify night-time light data for delineating urban agglomeration boundaries | |
CN113033516A (en) | Object identification statistical method and device, electronic equipment and storage medium | |
Venerandi et al. | Exploring the similarities between informal and medieval settlements: A methodology and an application | |
CN101710331A (en) | System and method for layering population sample survey sample | |
Ruiz-Lendínez et al. | Method for an automatic alignment of imagery and vector data applied to cadastral information in Poland | |
Zhang et al. | Semantic segmentation method accelerated quantitative analysis of the spatial characteristics of traditional villages | |
CN115424131B (en) | Cloud detection optimal threshold selection method, cloud detection method and cloud detection system | |
CN117036733A (en) | Urban road scene characteristic line extraction method | |
CN111710157B (en) | Method for extracting hot spot area of taxi | |
CN113076803B (en) | Building vector extraction method and system based on high-resolution remote sensing image | |
CN108132992B (en) | Personnel information basic address coding method and system and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |