CN109002451B - Map data thinning method and device - Google Patents

Map data thinning method and device Download PDF

Info

Publication number
CN109002451B
CN109002451B CN201710693584.9A CN201710693584A CN109002451B CN 109002451 B CN109002451 B CN 109002451B CN 201710693584 A CN201710693584 A CN 201710693584A CN 109002451 B CN109002451 B CN 109002451B
Authority
CN
China
Prior art keywords
map
level
target
point
grid
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
Application number
CN201710693584.9A
Other languages
Chinese (zh)
Other versions
CN109002451A (en
Inventor
蒋文平
张乐天
林圣拿
胡靓瑾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Publication of CN109002451A publication Critical patent/CN109002451A/en
Application granted granted Critical
Publication of CN109002451B publication Critical patent/CN109002451B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Instructional Devices (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a map data rarefying method and device, and belongs to the field of geographic spatial information. The method comprises the following steps: at least acquiring a target geographic area and an initial map level to be rarefied; in the initial map level and each map level above the initial map level, acquiring a plurality of point positions in a geographic coordinate range indicated by each grid contained in a target geographic area; determining a target point location for each map level from a plurality of point locations for said each map level; and setting the starting display level of the target point location as the level number of the map level to which the target point location belongs, wherein the starting display level of the target point location is used for indicating that the target point location is displayed in the map level with the level number equal to or greater than the starting display level. The invention can meet the requirement of continuously displaying point locations in a plurality of map levels, and only displays the target point location in each grid of each level, thereby achieving the aim of rarefaction and ensuring that the point locations on the map can be uniformly distributed.

Description

Map data thinning method and device
The present application claims priority of chinese patent application having application number 201710425305.0 entitled "map data rarefying method and apparatus" filed by chinese patent office on 2017, 06, 07 th.e., 2017, the entire contents of which are incorporated herein by reference.
Technical Field
The invention relates to the field of geographic spatial information, in particular to a map data rarefying method and device.
Background
With the development of the geospatial information technology, maps are gradually popularized, and great convenience is brought to the travel life of people. With the increasing amount of map data, a large amount of map data (point locations) on a map easily causes spatial overlapping, which not only affects the beauty, but also increases the difficulty of data processing. Therefore, a method for rarefying map data is needed to rarefy map data so as to present a better map display effect.
In the related technology, methods such as Sub Points thinning and Subsets point thinning are adopted to perform thinning processing on map data. The Sub Points point thinning method comprises the following steps: comparing the priority among a plurality of adjacent points, comparing the NAME fields if the priority is high and the priority is the same, and randomly selecting when the length of the reserved NAME fields is short and the length of the priority is the same as that of the NAME fields. The Subset point thinning method comprises the following steps: the map data is thinned out according to a percentage, for example, 100 map data are originally on the map, and the thinning-out is 70 map data according to the percentage.
In the process of implementing the invention, the inventor finds that the prior art has at least the following problems:
in the related art, the Sub Points point thinning method must contain fields of 'priority' and 'NAME'; the Subset point thinning method performs thinning on different local ranges on the map according to the same percentage, keeps the density degree of the original map, cannot enable data to be uniformly distributed, and is dense after the local range with high original data density is thinned. Moreover, the above-mentioned technologies do not consider the continuity of the rarefaction display, the result displayed by each map level after rarefaction is performed on the map data is different, it is assumed that the rarefaction result of the 11-level map includes the point location a, but the rarefaction result of the 12-level map is not related to the rarefaction result of the 11-level map, and the point location displayed after rarefaction may not include the point location a, so that it is difficult to meet the requirement for continuous display of the point location in a plurality of map levels.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for rarefying map data. The technical scheme is as follows:
in a first aspect, a method for rarefying map data is provided, the method comprising:
at least acquiring a target geographic area and an initial map level to be rarefied;
in the initial map level and each map level above the initial map level, acquiring a plurality of point positions in a geographic coordinate range indicated by each grid included in the target geographic area;
determining a target point of each map level from the multiple point positions of each map level, wherein the target point is firstly diluted and the point position displayed in the current map level is determined;
and setting the starting display level of the target point location as the level number of the map level to which the target point location belongs, wherein the starting display level of the target point location is used for indicating that the target point location is displayed in the map level with the level number equal to or greater than the starting display level.
In a first implementation manner of the first aspect, the obtaining a plurality of point locations within a geographic coordinate range indicated by each grid included in the target geographic area in each map hierarchy includes:
acquiring geographic coordinate ranges of a plurality of grids contained in the target geographic area in each map level;
and acquiring a plurality of point positions with the geographic coordinates positioned in the geographic coordinate range of each grid in the grids from a database.
In a second implementation manner of the first aspect, the obtaining geographic coordinate ranges of a plurality of grids included in the target geographic area in each map hierarchy includes:
obtaining geographic coordinate ranges of a plurality of grids contained in the target geographic area in each map level by applying the following formula, wherein the geographic coordinate range of each grid comprises a minimum longitude, a minimum latitude, a maximum longitude and a maximum latitude:
minx=x*gridnLonlat
miny=y*gridnLonlat
maxx=minx+gridnLonlat
maxy=miny+gridnLonlat
the minimum longitude, the minimum latitude, the maximum longitude and the maximum latitude are respectively referred to minx, miny, maxx and maxy, the horizontal subscript and the vertical subscript of the grids are respectively referred to x and y, the horizontal subscript and the vertical subscript are used for indicating the coordinate position of each grid in the map hierarchy, and gridnLonlat is the longitude length and the latitude length actually represented by the length and the width of each grid in the map hierarchy.
In a third implementation manner of the first aspect, the obtaining at least the target geographic area and the initial map level to be rarefied includes:
obtaining the target geographic area and a plurality of map levels to be rarefied, including the initial map level.
In a fourth implementation manner of the first aspect, the determining, from the plurality of point locations of each map level, the target point location of each map level includes:
in each map level, if one point position with the minimum display starting level exists in a plurality of point positions within the geographic coordinate range indicated by each grid in the map level, and the point position with the minimum display starting level is determined as the target point position;
and if a plurality of point locations with the minimum display starting level and smaller than the hierarchy number of the map hierarchy exist in the plurality of point locations in the geographic coordinate range indicated by each grid in the map hierarchy, determining the point location with the highest priority in the plurality of point locations with the minimum display starting level as the target point location.
In a fifth implementation manner of the first aspect, after the setting the starting display level of the target point location to the number of levels of the map level to which the target point location belongs, the method further includes:
setting the display starting level of the other points except the target point among the plurality of points of each map level to be null.
In a sixth implementation form of the first aspect, the method further comprises:
when point locations are newly added, determining a grid to which the geographic coordinates of the newly added point locations in the map hierarchy with the minimum number of hierarchies belong;
and taking the geographical coordinate range indicated by the grid to which the geographical coordinates of the newly added point belong as the target geographical area, and executing the map data rarefying method.
In a seventh implementation manner of the first aspect, the method further includes:
when point locations are deleted, determining grids to which the geographic coordinates of the deleted point locations in the map hierarchy with the minimum number of hierarchies belong;
and taking the geographic coordinate range indicated by the grid to which the geographic coordinate of the point location is deleted as the target geographic area, and executing the map data rarefying method.
In an eighth implementation form of the first aspect, the method further includes:
when the point location is moved, determining a grid to which a geographic coordinate before the movement of the point location in a map hierarchy with the minimum number of hierarchies belongs;
taking the geographic coordinate range indicated by the grid to which the geographic coordinate before the movement of the mobile point location belongs as the target geographic area, and executing the map data rarefying method;
determining a grid to which the mobile point location belongs after moving in a map hierarchy with the minimum number of hierarchies;
and taking the geographical coordinate range indicated by the grid to which the geographical coordinates after the movement of the mobile point location belong as the target geographical area, and executing the map data rarefying method.
In a ninth implementation form of the first aspect, the individual meshes in different map hierarchies are the same size, or the individual meshes in different map hierarchies are different sizes.
In a second aspect, there is provided a map data thinning apparatus, the apparatus comprising:
the acquisition module is used for at least acquiring a target geographic area and an initial map level to be rarefied;
the obtaining module is further configured to obtain, in each map level of the initial map level and above, a plurality of point locations within a geographic coordinate range indicated by each grid included in the target geographic area;
the determining module is used for determining a target point of each map level from the plurality of point locations of each map level, wherein the target point is firstly diluted out, and the point location required to be displayed in the current map level is determined;
and the setting module is used for setting the starting display level of the target point to be the level number of the map level to which the target point belongs, and the starting display level of the target point is used for indicating that the target point is displayed in the map level of which the level number is equal to or greater than the starting display level.
In a first implementation manner of the second aspect, the obtaining module is configured to obtain geographic coordinate ranges of a plurality of grids included in the target geographic area in each map level; and acquiring a plurality of point positions with the geographic coordinates positioned in the geographic coordinate range of each grid in the grids from a database.
In a second implementation manner of the second aspect, the obtaining module is configured to obtain geographic coordinate ranges of a plurality of grids included in the target geographic area in each map hierarchy by applying the following formula, where the geographic coordinate range of each grid includes a minimum longitude, a minimum latitude, a maximum longitude, and a maximum latitude:
minx=x*gridnLonlat
miny=y*gridnLonlat
maxx=minx+gridnLonlat
maxy=miny+gridnLonlat
the minimum longitude, the minimum latitude, the maximum longitude and the maximum latitude are respectively referred to minx, miny, maxx and maxy, the horizontal subscript and the vertical subscript of the grids are respectively referred to x and y, the horizontal subscript and the vertical subscript are used for indicating the coordinate position of each grid in the map hierarchy, and gridnLonlat is the longitude length and the latitude length actually represented by the length and the width of each grid in the map hierarchy.
In a third implementation manner of the second aspect, the obtaining module is configured to obtain the target geographic area and a plurality of map levels to be rarefied, where the plurality of map levels to be rarefied include the initial map level.
In a fourth implementation manner of the second aspect, the determining module is configured to, in each map hierarchy, determine, as the target point location, a point location with a smallest display starting level if there is a point location with a smallest display starting level that is smaller than the number of hierarchies of the map hierarchy among the plurality of point locations within the geographic coordinate range indicated by each grid in the map hierarchy; and if a plurality of point locations with the minimum display starting level and smaller than the hierarchy number of the map hierarchy exist in the plurality of point locations in the geographic coordinate range indicated by each grid in the map hierarchy, determining the point location with the highest priority in the plurality of point locations with the minimum display starting level as the target point location.
In a fifth implementation manner of the second aspect, the setting module is further configured to set, to be null, display start levels of other points except the target point among the plurality of points in each map hierarchy.
In a sixth implementation manner of the second aspect, the apparatus further includes an execution module:
the determining module is further configured to determine, when a point location is newly added, a grid to which a geographic coordinate of the newly added point location in a map hierarchy with the smallest number of hierarchies belongs;
and the execution module is used for taking the geographical coordinate range indicated by the grid to which the geographical coordinates of the newly added point belong as the target geographical area and executing the map data rarefying method.
In a seventh implementation manner of the second aspect, the determining module is further configured to, when a point location is deleted, determine a grid to which a geographic coordinate of the deleted point location in a map hierarchy with a smallest number of hierarchies belongs;
the execution module is further configured to take a geographic coordinate range indicated by the grid to which the geographic coordinate of the point location is deleted belongs as the target geographic area, and execute the map data rarefying method.
In an eighth implementation manner of the second aspect, the determining module is further configured to, when the point location is moved, determine a grid to which a geographic coordinate before the point location is moved belongs in a map hierarchy with a smallest number of hierarchies;
the execution module is further configured to take a geographic coordinate range indicated by a grid to which the geographic coordinate before the movement of the mobile point location belongs as the target geographic area, and execute the map data rarefying method;
the determining module is further configured to determine a grid to which the geographic coordinate of the moved point location belongs in a map hierarchy with the minimum number of hierarchies;
the execution module is further configured to take a geographic coordinate range indicated by a grid to which the geographic coordinate after the movement of the mobile point location belongs as the target geographic area, and execute the map data rarefying method.
In a ninth implementation manner of the second aspect, the obtaining module is configured to obtain the target geographic area and a plurality of map levels to be rarefied, where the plurality of map levels to be rarefied include the initial map level.
In a third aspect, a computer device is provided, which is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus; a memory for storing a computer program; a processor for executing the computer program stored in the memory to perform the method steps of the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the method steps of the first aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
by rarefying the map levels needing rarefaction and setting the starting display level of the target point position in each map level as the level number of the map level, the target point position is continuously displayed in the map levels with the level number equal to or greater than the map level from the map level, and the requirement of continuously displaying the point position in a plurality of map levels can be met. And because the target point is determined from a plurality of point locations in the geographic coordinate range indicated by each grid, namely only the target point location is displayed in each grid of each level, the aim of rarefaction is achieved, and the point locations on the map can be uniformly distributed.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a method for rarefying map data according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for rarefying map data according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a rarefaction process for a target geographic area provided by an embodiment of the present invention;
FIG. 4 is a schematic diagram of a single grid thinning process provided by an embodiment of the present invention;
FIG. 5 is a schematic diagram of a grid provided by an embodiment of the present invention;
fig. 6 is a schematic diagram of a thinning process of newly added point locations according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a point deletion thinning process according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of a rarefaction procedure for moving point locations according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of a map data thinning apparatus according to an embodiment of the present invention;
FIG. 10 is a schematic structural diagram of a map data thinning apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a server 1100 according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of a computer device 1200 according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a flowchart of a method for rarefying map data according to an embodiment of the present invention. Referring to fig. 1, the method includes:
101. at least a target geographic area and an initial map level to be rarefied are obtained.
102. And acquiring a plurality of point positions in the geographic coordinate range indicated by each grid contained in the target geographic area in each map level of the initial map level and above.
103. And determining a target point of each map level from the plurality of point locations of each map level, wherein the target point is firstly diluted and the point location displayed in the current map level is determined.
104. And setting the starting display level of the target point to be the number of levels of the map level to which the target point belongs, wherein the starting display level of the target point is used for indicating that the target point is displayed in the map level with the level number equal to or greater than the starting display level.
According to the method provided by the embodiment of the invention, the map levels needing to be thinned are thinned, and the display starting level of the target point position in each map level is set to be the level number of the map level, so that the target point position is continuously displayed in the map levels with the level number equal to or more than the map level from the map level, and the requirement of continuously displaying the point position in a plurality of map levels can be met. And because the target point is determined from a plurality of point locations in the geographic coordinate range indicated by each grid, namely only the target point location is displayed in each grid of each level, the aim of rarefaction is achieved, and the point locations on the map can be uniformly distributed.
Optionally, the obtaining a plurality of point locations within the geographic coordinate range indicated by each grid included in the target geographic area in each map hierarchy includes:
acquiring geographic coordinate ranges of a plurality of grids contained in the target geographic area in each map level;
and acquiring a plurality of point positions of which the geographic coordinates are positioned in the geographic coordinate range of each grid in the grids from the database.
Optionally, the obtaining the geographic coordinate ranges of the multiple grids included in the target geographic area in each map level includes:
obtaining the geographical coordinate ranges of a plurality of grids contained in the target geographical area in each map hierarchy by applying the following formula, wherein the geographical coordinate range of each grid comprises a minimum longitude, a minimum latitude, a maximum longitude and a maximum latitude:
minx=x*gridnLonlat
miny=y*gridnLonlat
maxx=minx+gridnLonlat
maxy=miny+gridnLonlat
the minimum longitude, the minimum latitude, the maximum longitude and the maximum latitude are respectively referred to minx, miny, maxx and maxy, the horizontal subscript and the vertical subscript of the grids are respectively referred to x and y, the horizontal subscript and the vertical subscript are used for indicating the coordinate position of each grid in the map hierarchy, and gridnLonlat is the longitude length and the latitude length actually represented by the length and the width of each grid in the map hierarchy.
Optionally, the obtaining at least the target geographic area and the initial map level to be rarefied includes:
and acquiring the target geographic area and a plurality of map levels to be rarefied, wherein the plurality of map levels to be rarefied comprise the initial map level.
Optionally, the determining the target point location of each map level from the plurality of point locations of each map level includes:
in each map level, if one point with the minimum display starting level is smaller than the level number of the map level in a plurality of point points in the geographic coordinate range indicated by each grid in the map level, determining the point with the minimum display starting level as the target point;
and if a plurality of point locations with the minimum display starting level and less than the hierarchy number of the map hierarchy exist in the plurality of point locations in the geographic coordinate range indicated by each grid in the map hierarchy, determining the point location with the highest priority in the plurality of point locations with the minimum display starting level as the target point location.
Optionally, after the setting the starting display level of the target point to the level number of the map level to which the target point belongs, the method further includes:
setting the display start level of the other points except the target point among the points of each map hierarchy to be null.
Optionally, the method further comprises:
when point locations are newly added, determining a grid to which the geographic coordinates of the newly added point locations in the map hierarchy with the minimum number of hierarchies belong;
and taking the geographical coordinate range indicated by the grid to which the geographical coordinates of the newly added point belong as the target geographical area, and executing the map data rarefying method.
Optionally, the method further comprises:
when point locations are deleted, determining grids to which the geographic coordinates of the deleted point locations in the map hierarchy with the minimum number of hierarchies belong;
and taking the geographic coordinate range indicated by the grid to which the geographic coordinate of the point location is deleted as the target geographic area, and executing the map data rarefying method.
Optionally, the method further comprises:
when the point location is moved, determining a grid to which a geographic coordinate before the movement of the point location in a map hierarchy with the minimum number of hierarchies belongs;
taking the geographic coordinate range indicated by the grid to which the geographic coordinate before the movement of the mobile point location belongs as the target geographic area, and executing the map data rarefying method;
determining a grid to which the mobile point location belongs after moving in a map hierarchy with the minimum number of hierarchies;
and taking the geographic coordinate range indicated by the grid to which the geographic coordinate after the movement of the mobile point location belongs as the target geographic area, and executing the map data rarefying method.
Optionally, the individual meshes in different map levels are the same size, or the individual meshes in different map levels are different sizes.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
Fig. 2 is a flowchart of a method for rarefying map data according to an embodiment of the present invention. The method is performed by a server, see fig. 2, the method comprising:
201. at least a target geographic area and an initial map level to be rarefied are obtained.
The initial map level is used for indicating the map level starting rarefaction, and the initial map level and each map level above the initial map level are the map levels to be rarefied. The target geographic area refers to an actual geographic spatial area that needs to be rarefied, the target geographic area may be selected by a user on a map in a frame mode, may also be directly input by the user, and may also be selected by the user in a plurality of geographic areas provided by the map, where the user refers to a related person having a map data management authority, which is not limited in the embodiment of the present invention. Each map level corresponds to a map scale, for example, a map has 18 scales, such as 1:2 hundred million (i.e., 1 centimeter on the map represents 2000 kilometers of the real area), 1:1 million, 1:5000 million, … …, 1:2000, etc., so that the map has 18 map levels, i.e., level 1 map, level 2 map, … … map, and level 18 map, respectively. For example, a map on a 1:2 billion scale may be used as the 1 st level map, the level number of the 1 st level map is 1, a map on a 1:2000 scale may be used as the 18 th level map, the level number of the 18 th level map is 18, and information displayed in a map level higher in the level number is more detailed.
In this embodiment of the present invention, the server may execute the step 201 when receiving a rarefying instruction, where the rarefying instruction at least carries the target geographic area and an initial map level to be rarefied, and the server may obtain at least the target geographic area and the initial map level from the rarefying instruction. For example, the map may provide a rarefaction prompt, which is used to guide the user in step how to issue rarefaction instructions, so as to trigger the server to execute the corresponding rarefaction process. The user may select the target geographic area on the map and set the initial map level, such as inputting or selecting the initial map level, according to the rarefaction prompt.
In one possible implementation, the rarefaction instruction may carry the target geographic area and a plurality of map levels to be rarefied, where the plurality of map levels to be rarefied includes the initial map level, and accordingly, the server at least obtains the target geographic area and the initial map level to be rarefied may include: the server acquires the target geographic area and a plurality of map hierarchies to be rarefied from the rarefied instruction.
In another possible implementation manner, the rarefaction instruction may also only carry the target geographic area, and after the server acquires the target geographic area from the rarefaction instruction, a plurality of map hierarchies capable of completely displaying the target geographic area may be screened out from all map hierarchies of the map according to an actual coordinate range of the target geographic area and a specified algorithm, and the plurality of map hierarchies are used as the plurality of map hierarchies to be rarefaction, which is not limited in the embodiment of the present invention.
202. And acquiring a plurality of point positions in the geographic coordinate range indicated by each grid contained in the target geographic area in each map level of the initial map level and above.
In the embodiment of the present invention, each map hierarchy may include multiple grids with the same size, that is, the single grids in different map hierarchies have the same size, and a map hierarchy with a larger number of hierarchies includes more grids. Of course, the individual mesh sizes in different map levels may also be different.
This step 202 may include the following steps a to b:
a. and acquiring the geographic coordinate ranges of a plurality of grids contained in the target geographic area in each map level.
In step a, the server may apply the following formula to obtain geographic coordinate ranges of a plurality of grids included in the target geographic area in each map hierarchy, where the geographic coordinate range of each grid includes a minimum longitude, a minimum latitude, a maximum longitude, and a maximum latitude. Taking the map hierarchy as the nth level map as an example, the geographic coordinate range of each grid in the map hierarchy can be calculated by the following formula:
minx=x*gridnLonlat
miny=y*gridnLonlat
maxx=minx+gridnLonlat
maxy=miny+gridnLonlat
the minimum longitude, the minimum latitude, the maximum longitude and the maximum latitude are respectively referred to minx, miny, maxx and maxy, the horizontal subscript and the vertical subscript of the grids are respectively referred to x and y, the horizontal subscript and the vertical subscript are used for indicating the coordinate position of each grid in the map hierarchy, and gridnLonlat is the longitude length and the latitude length actually represented by the length and the width of each grid in the nth-level map.
b. And acquiring a plurality of point positions of which the geographic coordinates are positioned in the geographic coordinate range of each grid in the grids from the database.
In the embodiment of the invention, for each point location on the map, the server stores the geographic coordinate, the display starting level, the priority and the like of the point location in the database. The geographic coordinates can refer to longitude and latitude coordinates of the point location; the starting display grade can be expressed as a zoom value, the zoom value is set for the point location by the server before the current thinning, and the zoom value is reset for the point location in the current thinning; the priority may be calculated according to a specified priority algorithm.
In step b, in each map hierarchy, for each grid included in the target geographic area, the server may obtain, according to the geographic coordinates of all point locations in the database, a plurality of point locations whose geographic coordinates are within the geographic coordinate range of the grid from all the point locations.
The above steps a to b are actually processes in which, for each map level, for each grid included in the target geographic area in the map level, the server acquires a plurality of point locations within the geographic coordinate range indicated by the grid.
It should be noted that, in the step 202, for the case that the server acquires the target geographic area and the initial map level in the step 201, and for the case that the server acquires the target geographic area and the plurality of map levels to be rarefied in the step 201, the server may execute the step of acquiring the plurality of points and the subsequent steps in the step 202 in each of the plurality of map levels to be rarefied.
203. And determining a target point of each map level from the plurality of point locations of each map level, wherein the target point is firstly diluted and the point location displayed in the current map level is determined.
In this embodiment of the present invention, the process of the server determining the target point of each map level may include: in each map hierarchy, if one point having the smallest zoom value and smaller than the hierarchy number of the map hierarchy exists in a plurality of points in the geographic coordinate range indicated by each grid in the map hierarchy, determining the point having the smallest zoom value as the target point; and if a plurality of point locations with the smallest zoom-out values and smaller than the hierarchy number of the map hierarchy exist in the plurality of point locations in the geographic coordinate range indicated by each grid in the map hierarchy, determining the point location with the highest priority in the point locations with the smallest zoom-out values as the target point location.
In each map hierarchy, for each grid included in the target geographic area, after the server obtains, in step 202, a plurality of point locations within the geographic coordinate range indicated by the grid, in step 203, the plurality of point locations may be compared with each other by a zoom value to determine a target point location, and if the target point location cannot be determined according to the zoom value, priorities of the point locations may be further compared to determine the target point location.
Taking a point location a (zoom value is a), a point location B (zoom value is B), a point location C (zoom value is C) and a point location D (zoom value is D) in a geographic coordinate range indicated by a certain grid in the map hierarchy as an example, the server may compare the zoom values of the point location a, the point location B, the point location C and the point location D, that is, compare the sizes of a, B, C and D, and determine the point location a as a target point location if a < B < C < D and a < the number of levels of the map hierarchy; and if a is greater than the priority of B, determining the point A as a target point, and if A is greater than the priority of B, randomly selecting one point from A and B as the target point.
This step 203 is actually a process of, for each map level, for each grid included in the target geographic area in the map level, the server comparing the zoom value or the zoom value and the priority of the plurality of point locations within the geographic coordinate range indicated by the grid, thereby determining the target point location from the plurality of point locations. By determining the target point of each mesh contained in the target geographic area in each map level, the server may obtain the target point of all meshes contained in the target geographic area in each map level as the target point of each map level.
204. Setting the starting display level of the target point location as the level number of the map level to which the target point location belongs, and setting the starting display levels of other points except the target point location in the plurality of points of each map level to be null, wherein the starting display level of the target point location is used for indicating that the target point location is displayed in the map level with the level number equal to or greater than the starting display level.
In this embodiment of the present invention, after the server obtains the target point of each map hierarchy through step 203, the zoom values of the target point may be set as the number of the map hierarchy, so that the target point may be continuously displayed in the map hierarchy with the number of the map hierarchy equal to or greater than the zoom value. The server can set the zoom values of other point positions to be null while setting the zoom value of the target point position, so that the maximum display of one point position in each grid can be ensured, the aim of rarefaction is achieved, and the point positions on the map can be uniformly distributed. Of course, during the thinning process of the subsequent hierarchy, the zoom value of the point whose zoom value has been set to null may also be reassigned, so that the point can be displayed in the subsequent hierarchy.
This step 204 is actually performed for each map level, and for each grid included in the target geographic area in the map level, after the server determines a target point location from a plurality of point locations within the geographic coordinate range indicated by the grid, the zoom value of the target point location may be set to the level number of the map level. The server resets the zoom values of the target point positions of all grids contained in the target geographic area in each map hierarchy and sets the zoom values of other point positions except the target point position in each grid to be null, so that at most one point position is displayed in each grid, and the continuous display requirement of the point positions is met while the rarefaction purpose is achieved.
The steps 201 to 204 are the rarefying process of the target geographic area, and in fact, the server may complete the rarefying process of the target geographic area according to a certain rarefying flow in a step-by-step rarefying manner. Referring to fig. 3, fig. 3 is a schematic diagram of a rarefaction process of a target geographic area according to an embodiment of the present invention, where, for the server acquiring the target geographic area and an initial map level to be rarefied in step 202, the server may rarefied step by step for each map level above the initial map level according to the map level, the rarefaction process of the server for each map level is the same, and the rarefaction process of each map level includes steps 202 to 204. That is, the server performs steps 202 to 204 for the starting map level, and after performing step 204, performs steps 202 to 204 for the next map level, and so on until performing steps 202 to 204 for the ending map level. The starting map level (startZoom) and the ending map level (endZoom) may be set according to the initial map level, for example, the starting map level may be the initial map level, and the ending map level may be a map level having a maximum level in all map levels of the map.
For the server acquiring the target geographic area and the plurality of map levels to be rarefied in step 202, the server may perform the rarefiing process shown in fig. 3 on each map level of the plurality of map levels to be rarefied. In this case, the starting map level may be a map level having a smallest level number among the plurality of map levels to be diluted, and the ending map level may be a map level having a largest level number among the plurality of map levels to be diluted. For example, if the plurality of map levels to be diluted are the 5 th, 6 th, 7 th and 8 th level maps, the start map level may be the 5 th level map, and the end map level may be the 8 th level map. Starting to circulate from the beginning map level (as in fig. 3, zoom refers to the map level currently circulated to), and after the beginning map level is completely diluted, performing the dilution of the next map level (as in fig. 3, zoom + + ═ startZoom +1) until the end map level is circulated (as in fig. 3), that is, completing the dilution process of the target geographic area.
For a plurality of grids included in the target geographic area in the currently circulated map hierarchy, the server may thin the grids one by one, and the thinning process of the server for each grid is the same. Referring to fig. 4, fig. 4 is a schematic diagram of a thinning process of a single grid according to an embodiment of the present invention, where the thinning process of each grid may include: and acquiring point locations of which the geographic coordinates are located in the geographic coordinate range indicated by the grid according to the geographic coordinate range indicated by the grid, ending the rarefying process if the point locations are not acquired, and acquiring point locations of which the zoom values are minimum and are smaller than the layer number of the map level to which the grid belongs from all the point locations if the point locations are acquired. If a unique point location is obtained (namely, a point location with the smallest zoom value and smaller than the hierarchy level of the map hierarchy to which the grid belongs exists in all the point locations), determining the unique point location as a target point location, setting the zoom value of the target point location as the hierarchy level of the map hierarchy to which the grid belongs, and setting the zoom values of other point locations as null; if a plurality of point locations (that is, a plurality of point locations having the smallest zoom value and smaller than the hierarchy level of the map hierarchy to which the mesh belongs) are obtained, a unique point location (the point location having the highest priority among the plurality of point locations) is obtained according to the priority, the unique point location is determined as the target point location, and then the zoom value of the target point location is set. Referring to fig. 3, after the server performs the thinning process of the single grid shown in fig. 4 for the starting grid, the server performs the thinning process of the single grid shown in fig. 4 for the next grid, and so on until the end grid finishes performing the thinning process of the single grid shown in fig. 4. The starting grid (horizontal subscript is startX, vertical subscript is startY) and the ending grid (horizontal subscript is endX, vertical subscript is endY) may be set according to the subscript of each grid, and the subscript of the grid may be obtained according to the map level, the target geographic area, and the size of the grid currently circulated to. In one possible implementation, the starting grid may be a grid with the smallest horizontal subscript and the smallest vertical subscript among the multiple grids of the map hierarchy currently circulated to, and the ending grid may be a grid with the largest horizontal subscript and the largest vertical subscript among the multiple grids of the map hierarchy currently circulated to. Starting to circulate from the starting grid (for example, x is startX, y is startY, and x is the subscript of the currently circulated grid), after the starting grid is completely diluted, performing dilution of the next grid (for example, x is startX, y is + +, startY +1 in fig. 4) until the next grid is circulated to the ending grid (for example, x is endX, y is endY in fig. 4), that is, completing the dilution process of the map level currently circulated to.
According to the embodiment of the invention, the zoom value of each point location is set step by step according to the plurality of map levels in which the target geographic area is positioned, namely, the map level from which each point location is displayed is set, so that the continuity of rarefaction display is achieved. Referring to fig. 5, fig. 5 is a schematic diagram of a grid according to an embodiment of the present invention, and taking an 8 th-level map, a 9 th-level map, and a 10 th-level map as examples, a process of setting a zoom value of a point step by a server may be as follows:
fig. 5(a) shows one of the grids of the level 8 map, A, B, C, D, where the geographic coordinates of the four nodes are all within the geographic coordinate range of the grid, and assuming that the server determines that a is the target node, its zoom value may be set to 8, and the zoom values of B, C and D are set to null. (dotted line indicates the grid corresponding to the map at the next level)
Fig. 5(b) is one of the meshes of the 9 th-level map in which a inherits the zoom value set in the 8 th-level map hierarchy. As can be seen from fig. 5(a), in the level 9 map, a and B are still in one grid, and in order to ensure that only one point is displayed in each grid of each level, the zoom value of B may be set to null. Whereas in the level 9 map, C and D are unique in the respective cells, so the zoom values of C and D are set to 9.
Fig. 5(C) is one of the meshes of the map of level 10, in which a continues to inherit the zoom value set in the map hierarchy of level 8 to be unchanged, and points C and D inherit the zoom value set in the map hierarchy of level 9 to be unchanged. As can be seen from 5(B), B is unique in its lattice, so the zoom value of B is set to 10.
As a result of the above method, the zoom value of a is 8, the zoom values of C and D are 9, the zoom value of B is 10, that is, a is displayed in the 8 th-level map, A, C, D is displayed in the 9 th-level map, and A, B, C, D is displayed in the 10 th-level map. By the method, the continuity of rarefaction display is achieved, each grid of each grade displays at most one point location, the rarefaction purpose is achieved, and the point locations on the map can be uniformly distributed.
It should be noted that, in the rarefaction method for the target geographic area provided in the embodiments of the present invention, it is considered that there may be a need to add a point location, delete a point location, or move a point location in the map in the actual use process of the map, for example, a scenario in which a merchant needs to add a new shop in the map after newly opening the shop, a scenario in which the merchant needs to delete a shop in the map after closing the shop, or a scenario in which a merchant needs to move a shop in the map after moving the shop, and so on. Therefore, the embodiment of the invention also provides a point location adding and deleting rarefying method and a point location moving rarefying method.
Referring to fig. 6, fig. 6 is a schematic diagram of a rarefaction flow of a newly added point location provided in the embodiment of the present invention, and the rarefaction method when the newly added point location is added may include: when point locations are newly added, determining a grid to which the geographic coordinates of the newly added point locations in the map hierarchy with the minimum number of hierarchies belong; and taking the geographical coordinate range indicated by the grid to which the geographical coordinates of the newly added point belong as the target geographical area, and executing the map data rarefying method.
The map hierarchy with the minimum hierarchy number refers to the map hierarchy with the minimum hierarchy number in all map hierarchies of the map, and if the map has 18 map hierarchies, namely a level 1 map, a level 2 map, … … and an 18 th map, the map hierarchy with the minimum hierarchy number is the level 1 map.
The influence of the newly added point on the first level map is the grid to which the geographic coordinate of the newly added point belongs, and other map levels in which the geographic coordinate range indicated by the grid is located are influenced. Therefore, the server can take the geographic coordinate range of the grid to which the geographic coordinate of the newly added point belongs as the target geographic area, and execute the rarefying method of the target geographic area. When determining the target point location of each map level, the server needs to compare the zoom value and the priority of the newly added point location with other point locations in each map level, and reset the zoom value of each point location.
Referring to fig. 7, fig. 7 is a schematic diagram of a point location deletion rarefying flow provided in an embodiment of the present invention, and the point location deletion rarefying method may include: when point locations are deleted, determining grids to which the geographic coordinates of the deleted point locations in the map hierarchy with the minimum number of hierarchies belong; and taking the geographic coordinate range indicated by the grid to which the geographic coordinate of the point location is deleted as the target geographic area, and executing the map data rarefying method.
The influence of the deletion point on the first-level map is the grid to which the geographic coordinate of the deletion point belongs, and other map levels in which the geographic coordinate range indicated by the grid is located are influenced. Therefore, the server may use the geographic coordinate range of the grid to which the geographic coordinate of the point location is to belong as the target geographic area, and execute the rarefying method for the target geographic area. When determining the target point location of each map level, the server needs to compare the zoom value and the priority of each un-deleted point location in each map level, and reset the zoom values of the un-deleted point locations.
Referring to fig. 8, fig. 8 is a schematic diagram of a rarefaction flow of a moving point location according to an embodiment of the present invention, where the rarefaction flow when the point location is moved may include: when the point location is moved, determining a grid to which a geographic coordinate before the movement of the point location in a map hierarchy with the minimum number of hierarchies belongs; taking the geographic coordinate range indicated by the grid to which the geographic coordinate before the movement of the mobile point location belongs as the target geographic area, and executing the map data rarefying method; determining a grid to which the mobile point location belongs after moving in a map hierarchy with the minimum number of hierarchies; and taking the geographic coordinate range indicated by the grid to which the geographic coordinate after the movement of the mobile point location belongs as the target geographic area, and executing the map data rarefying method.
The thinning process when the point location is moved is actually the combination of the thinning process of deleting the point location and the thinning process of adding the point location, and therefore the description is omitted.
The embodiment of the invention provides a complete thinning process: the method comprises a thinning process of a target geographic area, a thinning process of a newly added point location, a thinning process of a deleted point location and a thinning process of a moved point location. Through the map data thinning process provided by the embodiment of the invention, the zoom value can be set for each point location, so that each point location is continuously displayed in a plurality of map levels according to the zoom value, the requirement on continuity of thinning display is met, and the map display can be carried out based on the zoom value set for each point location. For example, after the server performs thinning on the map data, each thinned point on the map has a zoom value. The server may publish a WMS (Web map service) map hierarchy, and set a style logic of the WMS map hierarchy. When a display request for a certain map level of the map is received, all point locations with the zoom value smaller than or equal to the level number of the current map level can be displayed on the map level, so that the dynamic request display of rarefied data is completed.
According to the method provided by the embodiment of the invention, the map levels needing to be thinned are thinned, and the zoom value of the target point position in each map level is set as the level number of the map level, so that the target point position is continuously displayed in the map levels with the level number equal to or greater than that of the map level from the map level, and the requirement of continuously displaying the point position in a plurality of map levels can be met. And because the target point is determined from a plurality of point locations in the geographic coordinate range indicated by each grid, namely only the target point location is displayed in each grid of each level, the aim of rarefaction is achieved, and the point locations on the map can be uniformly distributed.
Fig. 9 is a schematic structural diagram of a map data rarefying device according to an embodiment of the present invention. Referring to fig. 9, the apparatus includes:
an obtaining module 901, configured to obtain at least a target geographic area and an initial map level to be rarefied;
the obtaining module 901 is further configured to obtain, in the initial map level and each map level above the initial map level, a plurality of point locations within a geographic coordinate range indicated by each grid included in the target geographic area;
a determining module 902, configured to determine, from the multiple point locations of each map level, a target point location of each map level, where the target point location is first diluted and a point location displayed in a current map level is determined;
a setting module 903, configured to set a starting display level of the target point to a level number of a map level to which the target point belongs, where the starting display level of the target point is used to indicate that the target point is displayed in a map level whose level number is equal to or greater than the starting display level.
Optionally, the obtaining module 901 is configured to obtain geographic coordinate ranges of a plurality of grids included in the target geographic area in each map hierarchy; and acquiring a plurality of point positions of which the geographic coordinates are positioned in the geographic coordinate range of each grid in the grids from the database.
Optionally, the obtaining module 901 is configured to obtain geographic coordinate ranges of a plurality of grids included in the target geographic area in each map hierarchy by applying the following formula, where the geographic coordinate range of each grid includes a minimum longitude, a minimum latitude, a maximum longitude, and a maximum latitude:
minx=x*gridnLonlat
miny=y*gridnLonlat
maxx=minx+gridnLonlat
maxy=miny+gridnLonlat
the minimum longitude, the minimum latitude, the maximum longitude and the maximum latitude are respectively referred to minx, miny, maxx and maxy, the horizontal subscript and the vertical subscript of the grids are respectively referred to x and y, the horizontal subscript and the vertical subscript are used for indicating the coordinate position of each grid in the map hierarchy, and gridnLonlat is the longitude length and the latitude length actually represented by the length and the width of each grid in the map hierarchy.
Optionally, the obtaining module 901 is configured to obtain the target geographic area and a plurality of map levels to be rarefied, where the plurality of map levels to be rarefied includes the initial map level.
Optionally, the determining module 902 is configured to, in each map hierarchy, determine, as the target point, a point with a minimum display starting level if there is a point with a minimum display starting level and less than the number of hierarchies of the map hierarchy among the point points in the geographic coordinate range indicated by each grid in the map hierarchy; and if a plurality of point locations with the minimum display starting level and less than the hierarchy number of the map hierarchy exist in the plurality of point locations in the geographic coordinate range indicated by each grid in the map hierarchy, determining the point location with the highest priority in the plurality of point locations with the minimum display starting level as the target point location.
Optionally, the setting module 903 is further configured to set the display starting level of the other point locations, except the target point location, of the plurality of point locations in each map hierarchy to be null.
Optionally, referring to fig. 10, the apparatus further includes an executing module 904:
the determining module 902 is further configured to, when a point location is newly added, determine a grid to which a geographic coordinate of the newly added point location in a map hierarchy with the smallest number of hierarchies belongs;
and the executing module 904 is configured to take the geographic coordinate range indicated by the grid to which the geographic coordinate of the newly added point belongs as the target geographic area, and execute the map data rarefying method.
Optionally, the determining module 902 is further configured to, when a point location is deleted, determine a grid to which a geographic coordinate of the deleted point location in a map hierarchy with the smallest number of hierarchies belongs;
the executing module 904 is further configured to take the geographic coordinate range indicated by the grid to which the geographic coordinate of the point location is deleted belongs as the target geographic area, and execute the map data rarefying method.
Optionally, the determining module 902 is further configured to, when the point location is moved, determine a grid to which the geographic coordinate before the point location is moved belongs in a map hierarchy with the smallest number of hierarchies;
the executing module 904 is further configured to take a geographic coordinate range indicated by a grid to which the geographic coordinate before the movement of the mobile point location belongs as the target geographic area, and execute the map data rarefying method;
the determining module 902 is further configured to determine a grid to which the geographic coordinate of the moved point location belongs in the map hierarchy with the minimum number of hierarchies;
the executing module 904 is further configured to take a geographic coordinate range indicated by a grid to which the geographic coordinate after the movement of the mobile point location belongs as the target geographic area, and execute the map data rarefying method.
Optionally, the individual meshes in different map levels are the same size, or the individual meshes in different map levels are different sizes.
In the embodiment of the invention, the map levels needing to be thinned are thinned, and the display starting level of the target point position in each map level is set to be the level number of the map level, so that the target point position is continuously displayed in the map levels with the level number equal to or more than the map level from the map level, and the requirement of continuously displaying the point position in a plurality of map levels can be met. And because the target point is determined from a plurality of point locations in the geographic coordinate range indicated by each grid, namely only the target point location is displayed in each grid of each level, the aim of rarefaction is achieved, and the point locations on the map can be uniformly distributed.
It should be noted that: the map data rarefying device provided in the above embodiment is exemplified by only the division of the above functional modules when map data is rarefying, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the map data rarefying device provided by the above embodiment and the map data rarefying method embodiment belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment and is not described herein again.
Fig. 11 is a schematic structural diagram of a server 1100 according to an embodiment of the present invention. Referring to FIG. 11, the server 1100 includes a processing component 1122 that further includes one or more processors and memory resources, represented by memory 1132, for storing instructions, such as application programs, executable by the processing component 1122. The application programs stored in memory 1132 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1122 is configured to execute instructions to perform the map data thinning method described above.
The server 1100 may also include a power component 1126 configured to perform power management for the server 1100, a wired or wireless network interface 1150 configured to connect the server 1100 to a network, and an input/output (I/O) interface 1158. The Server 1100 may operate an operating system based on information stored in the storage 1132, such as Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTMOr the like.
Fig. 12 is a schematic structural diagram of a computer device 1200 according to an embodiment of the present disclosure. Referring to fig. 12, the computer device 1200 includes a processor, a communication interface, a memory, and a communication bus, and may further include an input/output interface and a display device, wherein the processor, the memory, the input/output interface, the display device, and the communication interface complete communication with each other through the communication bus. The memory stores a computer program, and the processor is configured to execute the computer program stored in the memory to implement the map data thinning method in the embodiment of fig. 2.
A communication bus is a circuit that connects the described elements and enables transmission between the elements. For example, the processor receives commands from other elements through the communication bus, decrypts the received commands, and performs calculations or data processing according to the decrypted commands. The memory may include program modules such as a kernel (kernel), middleware (middleware), an Application Programming Interface (API), and applications. The program modules may be comprised of software, firmware or hardware, or at least two of the same. The input-output interface forwards commands or data input by a user via an input-output device (e.g., sensor, keyboard, touch screen). The display device displays various information to a user. The communication interface connects the computer device 1200 with other network devices, user devices, networks. For example, the communication interface may be connected to a network by wire or wirelessly to connect to external other network devices or user devices. The wireless communication may include at least one of: wireless Fidelity (WiFi), Bluetooth (BT), Near Field Communication (NFC), Global Positioning System (GPS) and cellular Communication (cellular Communication) (e.g., Long Term Evolution (LTE)), Long Term Evolution (Long Term Evolution) followed by Long Term Evolution (LTE-Advanced), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (CDMA, WCDMA), Universal Mobile telecommunications System (Universal Mobile telecommunications System, UMTS), Wireless Broadband Access (Wireless Broadband bro) and Global System for Mobile communications (GSM) may include at least one of the following Wireless Communication systems (WiFi), Wireless Multimedia Communication (Bluetooth, BT), Wireless Broadband Communication (GSM), Wireless Serial Communication (GSM), Wireless Multimedia Communication (HDMI, GSM), RS-232), and Plain Old Telephone Service (POTS). The network may be a telecommunications network and a communications network. The communication network may be a computer network, the internet of things, a telephone network. The computer device 1200 may be connected to the network through a communication Interface, and a protocol by which the computer device 1200 communicates with other network devices may be supported by at least one of an Application, an Application Programming Interface (API), middleware, a kernel, and a communication Interface.
In an exemplary embodiment, there is also provided a computer readable storage medium, such as a memory, storing a computer program which, when executed by a processor, implements the map data thinning method in embodiment 2 above. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (22)

1. A method for rarefying map data, the method comprising:
at least acquiring a target geographic area and an initial map level to be rarefied;
in the initial map level and each map level above the initial map level, acquiring a plurality of point positions in a geographic coordinate range indicated by each grid included in the target geographic area;
determining a target point of each map level from the multiple point positions of each map level, wherein the target point is firstly diluted and the point position displayed in the current map level is determined;
and setting the starting display level of the target point location as the level number of the map level to which the target point location belongs, wherein the starting display level of the target point location is used for indicating that the target point location is displayed in the map level with the level number equal to or greater than the starting display level.
2. The method of claim 1, wherein obtaining, in each map level at or above the initial map level, a plurality of points within a geographic coordinate range indicated by each grid included in the target geographic area comprises:
acquiring geographic coordinate ranges of a plurality of grids contained in the target geographic area in each map level;
and acquiring a plurality of point positions with the geographic coordinates positioned in the geographic coordinate range of each grid in the grids from a database.
3. The method of claim 2, wherein said obtaining geographic coordinate ranges of a plurality of grids contained by the target geographic region in each map level comprises:
obtaining geographic coordinate ranges of a plurality of grids contained in the target geographic area in each map level by applying the following formula, wherein the geographic coordinate range of each grid comprises a minimum longitude, a minimum latitude, a maximum longitude and a maximum latitude:
minx=x*gridnLonlat
miny=y*gridnLonlat
maxx=minx+gridnLonlat
maxy=miny+gridnLonlat
the minimum longitude, the minimum latitude, the maximum longitude and the maximum latitude are respectively referred to minx, miny, maxx and maxy, the horizontal subscript and the vertical subscript of the grids are respectively referred to x and y, the horizontal subscript and the vertical subscript are used for indicating the coordinate position of each grid in the map hierarchy, and gridnLonlat is the longitude length and the latitude length actually represented by the length and the width of each grid in the map hierarchy.
4. The method of claim 1, wherein obtaining at least a target geographic area and an initial map level to be diluted comprises:
obtaining the target geographic area and a plurality of map levels to be rarefied, including the initial map level.
5. The method of claim 1, wherein said determining a target point location for each map level from the plurality of point locations for each map level comprises:
in each map level, if one point position with the minimum display starting level exists in a plurality of point positions within the geographic coordinate range indicated by each grid in the map level, and the point position with the minimum display starting level is determined as the target point position;
and if a plurality of point locations with the minimum display starting level and smaller than the hierarchy number of the map hierarchy exist in the plurality of point locations in the geographic coordinate range indicated by each grid in the map hierarchy, determining the point location with the highest priority in the plurality of point locations with the minimum display starting level as the target point location.
6. The method according to claim 1, wherein after the setting of the starting display level of the target point location to the number of levels of the map level to which the target point location belongs, the method further comprises:
setting the display starting level of the other points except the target point among the plurality of points of each map level to be null.
7. The method of claim 1, further comprising:
when point locations are newly added, determining a grid to which the geographic coordinates of the newly added point locations in the map hierarchy with the minimum number of hierarchies belong;
and taking the geographical coordinate range indicated by the grid to which the geographical coordinates of the newly added point belong as the target geographical area, and executing the map data rarefying method.
8. The method of claim 1, further comprising:
when point locations are deleted, determining grids to which the geographic coordinates of the deleted point locations in the map hierarchy with the minimum number of hierarchies belong;
and taking the geographic coordinate range indicated by the grid to which the geographic coordinate of the point location is deleted as the target geographic area, and executing the map data rarefying method.
9. The method of claim 1, further comprising:
when the point location is moved, determining a grid to which a geographic coordinate before the movement of the point location in a map hierarchy with the minimum number of hierarchies belongs;
a step of executing the map data rarefying method by taking a geographic coordinate range indicated by a grid to which the geographic coordinate before the movement of the mobile point location belongs as the target geographic area;
determining a grid to which the mobile point location belongs after moving in a map hierarchy with the minimum number of hierarchies;
and taking the geographical coordinate range indicated by the grid to which the geographical coordinates after the movement of the mobile point location belong as the target geographical area, and executing the map data rarefying method.
10. The method of claim 1, wherein the individual meshes in different map hierarchies are the same size, or wherein the individual meshes in different map hierarchies are different sizes.
11. A map data thinning apparatus, the apparatus comprising:
the acquisition module is used for at least acquiring a target geographic area and an initial map level to be rarefied;
the obtaining module is further configured to obtain, in each map level of the initial map level and above, a plurality of point locations within a geographic coordinate range indicated by each grid included in the target geographic area;
the determining module is used for determining a target point of each map level from the plurality of point locations of each map level, wherein the target point is firstly diluted out and is used for determining the point location displayed in the current map level;
and the setting module is used for setting the starting display level of the target point to be the level number of the map level to which the target point belongs, and the starting display level of the target point is used for indicating that the target point is displayed in the map level of which the level number is equal to or greater than the starting display level.
12. The apparatus according to claim 11, wherein said obtaining module is configured to obtain geographic coordinate ranges of a plurality of grids included in the target geographic area in each map level; and acquiring a plurality of point positions with the geographic coordinates positioned in the geographic coordinate range of each grid in the grids from a database.
13. The apparatus of claim 12, wherein the obtaining module is configured to obtain the geographic coordinate ranges of the grids included in the target geographic area in each map level by applying the following formula, and the geographic coordinate range of each grid includes a minimum longitude, a minimum latitude, a maximum longitude, and a maximum latitude:
minx=x*gridnLonlat
miny=y*gridnLonlat
maxx=minx+gridnLonlat
maxy=miny+gridnLonlat
the minimum longitude, the minimum latitude, the maximum longitude and the maximum latitude are respectively referred to minx, miny, maxx and maxy, the horizontal subscript and the vertical subscript of the grids are respectively referred to x and y, the horizontal subscript and the vertical subscript are used for indicating the coordinate position of each grid in the map hierarchy, and gridnLonlat is the longitude length and the latitude length actually represented by the length and the width of each grid in the map hierarchy.
14. The apparatus of claim 11, wherein the obtaining module is configured to obtain the target geographic area and a plurality of map levels to be rarefied, and wherein the plurality of map levels to be rarefied includes the initial map level.
15. The apparatus according to claim 11, wherein the determining module is configured to, in each map level, determine, as the target point location, a point location with a smallest display starting level if there is a point location with a smallest display starting level and a smaller number of levels than the map level among the point locations within the geographic coordinate range indicated by each grid in the map level; and if a plurality of point locations with the minimum display starting level and smaller than the hierarchy number of the map hierarchy exist in the plurality of point locations in the geographic coordinate range indicated by each grid in the map hierarchy, determining the point location with the highest priority in the plurality of point locations with the minimum display starting level as the target point location.
16. The apparatus according to claim 11, wherein the setting module is further configured to set the display starting level of the other points of the plurality of points of each map hierarchy except the target point to null.
17. The apparatus of claim 11, further comprising an execution module to:
the determining module is further configured to determine, when a point location is newly added, a grid to which a geographic coordinate of the newly added point location in a map hierarchy with the smallest number of hierarchies belongs;
and the execution module is used for taking the geographical coordinate range indicated by the grid to which the geographical coordinates of the newly added point belong as the target geographical area and executing the step of the map data rarefying method.
18. The apparatus of claim 11, further comprising an execution module to:
the determining module is further configured to determine, when a point location is deleted, a grid to which a geographic coordinate of the deleted point location in a map hierarchy with the smallest number of hierarchies belongs;
the execution module is further configured to take a geographic coordinate range indicated by the grid to which the geographic coordinate of the point location is deleted belongs as the target geographic area, and execute the step of the map data rarefying method.
19. The apparatus of claim 11, further comprising an execution module to:
the determining module is further configured to determine, when the point location is moved, a grid to which a geographic coordinate before the movement of the point location belongs in a map hierarchy with a minimum number of hierarchies;
the execution module is further configured to take a geographic coordinate range indicated by a grid to which the geographic coordinate before the movement of the mobile point location belongs as the target geographic area, and execute the step of the map data rarefying method;
the determining module is further configured to determine a grid to which the geographic coordinate of the moved point location belongs in a map hierarchy with the minimum number of hierarchies;
the execution module is further configured to take a geographic coordinate range indicated by the grid to which the geographic coordinate after the movement of the mobile point location belongs as the target geographic area, and execute the step of the map data rarefying method.
20. The apparatus of claim 11, wherein the individual meshes in different map hierarchies are the same size, or wherein the individual meshes in different map hierarchies are different sizes.
21. The computer equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing the communication between the processor and the memory through the communication bus; a memory for storing a computer program; a processor for executing a computer program stored on a memory for carrying out the steps of the method according to any one of claims 1 to 10.
22. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 10.
CN201710693584.9A 2017-06-07 2017-08-14 Map data thinning method and device Active CN109002451B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710425305 2017-06-07
CN2017104253050 2017-06-07

Publications (2)

Publication Number Publication Date
CN109002451A CN109002451A (en) 2018-12-14
CN109002451B true CN109002451B (en) 2021-01-12

Family

ID=64572851

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710693584.9A Active CN109002451B (en) 2017-06-07 2017-08-14 Map data thinning method and device

Country Status (1)

Country Link
CN (1) CN109002451B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111813875B (en) * 2019-04-11 2024-04-05 浙江宇视科技有限公司 Map point location information processing method, device and server
CN110427583B (en) * 2019-06-21 2022-04-22 浙江中控信息产业股份有限公司 Method for drawing map mass lines at mobile terminal in sparse mode
CN110610539A (en) * 2019-08-13 2019-12-24 北京中色地科测绘有限公司 Stratum curved surface construction method, device, equipment and storage medium
CN110610544A (en) * 2019-08-13 2019-12-24 北京中色地科测绘有限公司 Drilling data thinning method and device, equipment and storage medium
CN110619018B (en) * 2019-09-26 2024-07-02 深圳前海微众银行股份有限公司 Map overlay thinning method, device, equipment and computer storage medium
CN110990502B (en) * 2019-11-12 2023-01-03 哈尔滨工程大学 Method for simplifying data of electronic chart position points
CN111858827B (en) * 2020-07-31 2023-11-14 成都新潮传媒集团有限公司 Map point location thinning display method and device and computer equipment
CN111931072B (en) * 2020-10-09 2021-01-15 深圳市天维大数据技术有限公司 Point location recommendation method and device, terminal equipment and storage medium
CN113806413B (en) * 2021-11-22 2022-02-15 江苏货斯基网络科技有限公司 Trajectory screening and classifying method and device, computer equipment and storage medium
CN115794937B (en) * 2023-01-31 2023-04-18 中国电子科技集团公司第二十八研究所 Global grid-based massive moving target layered display method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105550344A (en) * 2015-12-24 2016-05-04 中科宇图科技股份有限公司 Grid and weight relation-based vector point element thinning method
CN106610976A (en) * 2015-10-22 2017-05-03 高德信息技术有限公司 POI labeling method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9080885B2 (en) * 2012-06-05 2015-07-14 Apple Inc. Determining to display designations of points of interest within a map view

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106610976A (en) * 2015-10-22 2017-05-03 高德信息技术有限公司 POI labeling method and device
CN105550344A (en) * 2015-12-24 2016-05-04 中科宇图科技股份有限公司 Grid and weight relation-based vector point element thinning method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
天地图福建电子地图注记逐级递增显示方法研究;周婷婷;《测绘与空间地理信息》;20160430;第39卷(第4期);第222-224页 *

Also Published As

Publication number Publication date
CN109002451A (en) 2018-12-14

Similar Documents

Publication Publication Date Title
CN109002451B (en) Map data thinning method and device
CN110765354B (en) Information pushing method and device, electronic equipment and storage medium
CN104599315A (en) Three-dimensional scene construction method and system
CN112055958A (en) Enabling wireless security measures based on wireless access point attributes
US20160080293A1 (en) Accounts Control
CN111803952A (en) Topographic map editing method and device, electronic equipment and computer readable medium
CN110413367B (en) Task creation method and device, storage medium and electronic equipment
US10116728B2 (en) System and method for transferring data using a directional touch gesture
CN110134905B (en) Page update display method, device, equipment and storage medium
CN111158881B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN112150491B (en) Image detection method, device, electronic equipment and computer readable medium
US20190274115A1 (en) Electronic device and method for determining entry of region of interest of electronic device
US11044766B2 (en) Method for Wi-Fi connection and related products
RU2610587C2 (en) Method of spatial object storage by means of flexible hierarchical structure and a permanent data medium
CN111324470A (en) Method and device for generating information
CN114820878B (en) Image editing method and device
CN111327472B (en) Method and device for acquiring target network
EP4170588A2 (en) Video photographing method and apparatus, and device and storage medium
CN106793016B (en) Wireless fidelity Wi-Fi connection method and mobile terminal
CN115170714A (en) Scanned image rendering method and device, electronic equipment and storage medium
CN115588064A (en) Video generation method and device, electronic equipment and storage medium
JP2015515651A (en) Information processing apparatus, control method, program, and recording medium
CN110619089B (en) Information retrieval method and device
CN111835917A (en) Method, device and equipment for showing activity range and computer readable medium
US9998587B2 (en) Rearranging display of mobile applications based on geolocation

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