CN113946582A - Space aggregation display query method and system and readable storage medium - Google Patents

Space aggregation display query method and system and readable storage medium Download PDF

Info

Publication number
CN113946582A
CN113946582A CN202111223505.0A CN202111223505A CN113946582A CN 113946582 A CN113946582 A CN 113946582A CN 202111223505 A CN202111223505 A CN 202111223505A CN 113946582 A CN113946582 A CN 113946582A
Authority
CN
China
Prior art keywords
map
length
aggregation
data
animation
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.)
Granted
Application number
CN202111223505.0A
Other languages
Chinese (zh)
Other versions
CN113946582B (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.)
Guangdong Tianyima Information Industry Co ltd
Original Assignee
Guangdong Tianyima Information Industry 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 Guangdong Tianyima Information Industry Co ltd filed Critical Guangdong Tianyima Information Industry Co ltd
Priority to CN202111223505.0A priority Critical patent/CN113946582B/en
Publication of CN113946582A publication Critical patent/CN113946582A/en
Application granted granted Critical
Publication of CN113946582B publication Critical patent/CN113946582B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Remote Sensing (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a space aggregation display query method, a space aggregation display query system and a readable storage medium, and relates to the field of a space aggregation display query method, a space aggregation display query system and a readable storage medium of a WebGIS (Web geographic information System). The hash value is calculated in advance by adopting a geohash algorithm at the back end, and the space aggregation operation is converted into character operation, so that the operation amount is greatly reduced, and the operation efficiency and the loading capacity of the map are improved; meanwhile, the efficient operation and loading capacity shortens the data transmission time and the calculation aggregation time, and greatly improves the front-end space aggregation display experience of the map; under the mutual cooperation of the front end and the back end, the data loading capacity of the map is greatly improved in the aspects of performance and experience.

Description

Space aggregation display query method and system and readable storage medium
Technical Field
The present invention relates to the field of WebGIS (web geographic information system), and more particularly, to a method, system, and readable storage medium for spatial aggregation display query.
Background
With the continuous development of society, the modern information technology level of our country is gradually improved, and the existing GIS (geographic information system) technology is innovated and perfected by functions such as quick development function, auxiliary decision and the like, so that the technical efficiency, the precision and the like of the GIS are better improved, and the spatial region simulation is realized from various angles. The GIS technology can be applied to smart cities to effectively carry out full exhibition on operation, safe creation, stable petition maintenance, innovation and quality improvement, grid management, market supervision, network public opinion, public videos and the like of cities and community villages, obtains good results, and is widely applied to various fields. The GIS technology has an ultra-strong database management function, manages and predicts the existing spatial data analysis aspect, and obtains good social benefit and economic benefit.
The GIS database contains massive and complex data and information, and whether various data objects can be loaded reasonably and effectively becomes a key, for example, in patent CN201110121544.X, the traditional aggregation display generally refers to loading all data at the front end, and aggregation display is performed at the front end according to the geographical position information of the data after the loading is completed. Therefore, how to greatly improve the data loading capability of the map in terms of performance and experience is a key problem which needs to be solved urgently at present.
Disclosure of Invention
In view of the foregoing problems, an object of the present invention is to provide a method, a system and a readable storage medium for spatial aggregation display query, which greatly improve the data loading capability of a map in terms of performance and experience under the mutual cooperation of a front end and a back end.
The first aspect of the invention provides a space aggregation display query method, which comprises the following steps:
s1: loading a data layer object of a GIS database;
s2: abstracting geocoding fields in all GIS data layer objects, and generating a list;
s3: judging the geometric types of the fields in the list, calculating a hash value through a geohash algorithm according to a preset calculation rule corresponding to each geometric type, and recording the obtained hash value as geocode;
s4: map hierarchy division is carried out on a GIS data map layer, the length of a geocode corresponding to aggregation is obtained through a getGroupLeftLength function on the current map hierarchy, and the aggregation length is recorded as length G; when a map level is input, returning the length according to a preset mapping relation between the map level and the length;
s5: according to the geocode and the length hG, returning a point and the number of the point aggregation through group by left (geocode, length hG) query of sql;
s6: performing aggregation display or single-point display according to the aggregation quantity, wherein the aggregation display refers to displaying the returned points and the aggregation quantity of the points, and the single-point display refers to directly displaying the points;
s7: and monitoring a map hierarchy change event, and making corresponding change and display according to the hierarchy change type.
In the scheme, the geometric categories comprise points, lines and polygons; when the geometric category is a point, directly calculating a hash value by using a geohash algorithm; when the geometric category is a line or a polygon, the central point is calculated first, and then the hash value is calculated by using a geohash algorithm according to the central point.
In this scheme, the mapping relationship between the map hierarchy and the length is as follows:
level 1 is less than or equal to 5 and the return length is 4;
level 6 is less than or equal to 11 and the return length is 5;
level 12 ≦ 13 Return Length 6;
level 14 ≦ 15 returning length 7;
tier ≧ 16 returns length 0.
In the scheme, the mapping relation between the map hierarchy and the length is set according to the practical condition of the project applied by the method.
In the scheme, if the number of returned aggregations is 1, the position is represented as no aggregation, and single-point display is performed, otherwise, the position is represented as aggregation, and aggregation display is performed.
In the scheme, the hierarchy change events comprise map zooming hierarchy increasing, map zooming hierarchy reducing, map clicking event and map dragging event;
when the zoom level of the map is judged to be increased, acquiring a new length through getGroupLeftLength, transmitting a new length value if the length of the length is judged to be changed, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the new geocode starts from an old geocode, if so, storing the new geocode into an animation array, and starting frame animation, wherein the animation effect is the moving effect of diffusing the middle point to other points on the periphery; after the animation movement is finished, removing elements on the upper map;
when the map zooming level is judged to be reduced, acquiring a new length through getGroupLeftLength, if the length of the length G is judged to be changed, transmitting a new length G value, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the old geocode starts with the new geocode or not, if so, saving the new geocode to an animation array, starting frame animation, gathering the animation effect towards the middle points at the periphery, and removing elements on the lower map after the animation movement is finished;
when a click event exists in the map, acquiring a current clicked element, directly responding to the click event of the map if the total number is 1 and indicating that the current clicked element is not an aggregation element, otherwise, judging that the element is the aggregation element, amplifying the current map level if the element is the aggregation element, then re-judging the map level, acquiring data again through an interface, storing the data into an animation array after returning the data, and starting frame animation, wherein the animation effect is a moving effect of diffusing to other points around by taking a clicked point as a center; after the animation movement is finished, removing elements on the upper map;
and after the data is returned, all elements except the view are cleared, and all elements in the current view are reloaded.
In the scheme, the space aggregation is used for making a layer of cache by taking the layer name and the map layer as a key when the map is at a low level and the data is not changed greatly relatively, and the data is directly returned from the cache when the map layer is changed; under the condition of a lower map level, massive data are prevented from being loaded, the total number under the relative level is calculated, the loading speed is increased by one step, and the whole aggregated animation can be updated more smoothly.
The second aspect of the present invention further provides a space aggregation display query system, including a memory and a processor, where the memory includes a space aggregation display query method program, and when the space aggregation display query method program is executed by the processor, the following steps are implemented:
s1: loading a data layer object of a GIS database;
s2: abstracting geocoding fields in all GIS data layer objects, and generating a list;
s3: judging the geometric types of the fields in the list, calculating a hash value through a geohash algorithm according to a preset calculation rule corresponding to each geometric type, and recording the obtained hash value as geocode;
s4: map hierarchy division is carried out on a GIS data map layer, the length of a geocode corresponding to aggregation is obtained through a getGroupLeftLength function on the current map hierarchy, and the aggregation length is recorded as length G; when a map level is input, returning the length according to a preset mapping relation between the map level and the length;
s5: according to the geocode and the length hG, returning a point and the number of the point aggregation through group by left (geocode, length hG) query of sql;
s6: performing aggregation display or single-point display according to the aggregation quantity, wherein the aggregation display refers to displaying the returned points and the aggregation quantity of the points, and the single-point display refers to directly displaying the points;
s7: and monitoring a map hierarchy change event, and making corresponding change and display according to the hierarchy change type.
In the scheme, the geometric categories comprise points, lines and polygons; when the geometric category is a point, directly calculating a hash value by using a geohash algorithm; when the geometric category is a line or a polygon, the central point is calculated first, and then the hash value is calculated by using a geohash algorithm according to the central point.
In this scheme, the mapping relationship between the map hierarchy and the length is as follows:
level 1 is less than or equal to 5 and the return length is 4;
level 6 is less than or equal to 11 and the return length is 5;
level 12 ≦ 13 Return Length 6;
level 14 ≦ 15 returning length 7;
tier ≧ 16 returns length 0.
In the scheme, the mapping relation between the map hierarchy and the length is set according to the practical condition of the project applied by the method.
In the scheme, if the number of returned aggregations is 1, the position is represented as no aggregation, and single-point display is performed, otherwise, the position is represented as aggregation, and aggregation display is performed.
In the scheme, the hierarchy change events comprise map zooming hierarchy increasing, map zooming hierarchy reducing, map clicking event and map dragging event;
when the zoom level of the map is judged to be increased, acquiring a new length through getGroupLeftLength, transmitting a new length value if the length of the length is judged to be changed, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the new geocode starts from an old geocode, if so, storing the new geocode into an animation array, and starting frame animation, wherein the animation effect is the moving effect of diffusing the middle point to other points on the periphery; after the animation movement is finished, removing elements on the upper map;
when the map zooming level is judged to be reduced, acquiring a new length through getGroupLeftLength, if the length of the length G is judged to be changed, transmitting a new length G value, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the old geocode starts with the new geocode or not, if so, saving the new geocode to an animation array, starting frame animation, gathering the animation effect towards the middle points at the periphery, and removing elements on the lower map after the animation movement is finished;
when a click event exists in the map, acquiring a current clicked element, directly responding to the click event of the map if the total number is 1 and indicating that the current clicked element is not an aggregation element, otherwise, judging that the element is the aggregation element, amplifying the current map level if the element is the aggregation element, then re-judging the map level, acquiring data again through an interface, storing the data into an animation array after returning the data, and starting frame animation, wherein the animation effect is a moving effect of diffusing to other points around by taking a clicked point as a center; after the animation movement is finished, removing elements on the upper map;
and after the data is returned, all elements except the view are cleared, and all elements in the current view are reloaded.
In the scheme, the hierarchy change events comprise map zooming hierarchy increasing, map zooming hierarchy reducing, map clicking event and map dragging event;
when the zoom level of the map is judged to be increased, acquiring a new length through getGroupLeftLength, transmitting a new length value if the length of the length is judged to be changed, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the new geocode starts from an old geocode, if so, storing the new geocode into an animation array, and starting frame animation, wherein the animation effect is the moving effect of diffusing the middle point to other points on the periphery; after the animation movement is finished, removing elements on the upper map;
when the map zooming level is judged to be reduced, acquiring a new length through getGroupLeftLength, if the length of the length G is judged to be changed, transmitting a new length G value, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the old geocode starts with the new geocode or not, if so, saving the new geocode to an animation array, starting frame animation, gathering the animation effect towards the middle points at the periphery, and removing elements on the lower map after the animation movement is finished;
when a click event exists in the map, acquiring a current clicked element, directly responding to the click event of the map if the total number is 1 and indicating that the current clicked element is not an aggregation element, otherwise, judging that the element is the aggregation element, amplifying the current map level if the element is the aggregation element, then re-judging the map level, acquiring data again through an interface, storing the data into an animation array after returning the data, and starting frame animation, wherein the animation effect is a moving effect of diffusing to other points around by taking a clicked point as a center; after the animation movement is finished, removing elements on the upper map;
and after the data is returned, all elements except the view are cleared, and all elements in the current view are reloaded.
In the scheme, the space aggregation is used for making a layer of cache by taking the layer name and the map layer as a key when the map is at a low level and the data is not changed greatly relatively, and the data is directly returned from the cache when the map layer is changed; under the condition of a lower map level, massive data are prevented from being loaded, the total number under the relative level is calculated, the loading speed is increased by one step, and the whole aggregated animation can be updated more smoothly.
A third aspect of the present invention provides a readable storage medium, where the readable storage medium includes a space aggregation display query method program, and when the space aggregation display query method program is executed by a processor, the space aggregation display query method program implements the steps of the space aggregation display query method.
Compared with the prior art, the invention has the beneficial effects that: according to the space aggregation display query method, the space aggregation display query system and the readable storage medium, the hash value is calculated in advance by adopting the geohash algorithm at the rear end, and space aggregation operation is converted into character operation, so that the operation amount is greatly reduced, and the operation efficiency and the loading capacity of a map are improved; meanwhile, the high-efficiency operation and loading capacity shortens the data transmission time and the calculation aggregation time, and greatly improves the space aggregation display experience of the front end of the map; under the mutual cooperation of the front end and the back end, the data loading capacity of the map is greatly improved in the aspects of performance and experience.
Drawings
Fig. 1 shows a flowchart of a spatial aggregation presentation query method according to the present application.
Fig. 2 is a schematic diagram showing a direct display when the present application queries for a higher hierarchy of cameras.
Fig. 3 is a diagram illustrating the lower-level display aggregation number of the query camera according to the present application.
FIG. 4 is a schematic diagram illustrating a hierarchy of the present application before a change in click events.
FIG. 5 is a schematic diagram illustrating a change in a click event at the level of the present application.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited by the specific embodiments disclosed below.
Example 1
Fig. 1 shows a flowchart of a spatial aggregation presentation query method according to the present application.
As shown in fig. 1, the embodiment discloses a method for querying a spatial aggregation display, which includes the following steps:
s1: loading a data layer object of a GIS database;
s2: abstracting geocoding fields in all GIS data layer objects, and generating a list;
s3: judging the geometric types of the fields in the list, calculating a hash value through a geohash algorithm according to a preset calculation rule corresponding to each geometric type, and recording the obtained hash value as geocode;
s4: map hierarchy division is carried out on a GIS data map layer, the length of a geocode corresponding to aggregation is obtained through a getGroupLeftLength function on the current map hierarchy, and the aggregation length is recorded as length G; when a map level is input, returning the length according to a preset mapping relation between the map level and the length;
s5: according to the geocode and the length hG, returning a point and the number of the point aggregation through group by left (geocode, length hG) query of sql;
s6: performing aggregation display or single-point display according to the aggregation quantity, wherein the aggregation display refers to displaying the returned points and the aggregation quantity of the points, and the single-point display refers to directly displaying the points;
s7: and monitoring a map hierarchy change event, and making corresponding change and display according to the hierarchy change type.
It should be noted that the GIS is an abbreviation of Geographic Information System (Geographic Information System), and is a computer System for collecting, storing, managing, displaying and analyzing data on the earth surface related to spatial and Geographic distribution, and used for inputting, storing, querying, analyzing and displaying Geographic data, which combines geography and geography, and can integrate the unique visualization effect and Geographic analysis function of a map with general database operation;
it should be noted that the geohash algorithm is an address coding method, and can code two-dimensional space longitude and latitude data into a character string;
it should be noted that the hash is usually used to represent the length in the geohash algorithm; the geocode is typically referred to as geocode;
it should be noted that, the getgrouplftlength is generally a function for obtaining the aggregation length;
it should be noted that sql is a short for Structured Query Language (Structured Query Language), and is a database Query and programming Language, and is used for accessing data and querying, updating, and managing a relational database system; and is also an extension of the database script file.
It should be noted that, the group by left is a language used for data query in sql;
it should be noted that, the spatial aggregation display query method generally has a smaller aggregation number at a higher level and a larger aggregation number at a lower level; for example, when querying a camera, at a higher level, as shown in fig. 2, a query element is not aggregated, the camera is directly displayed, and at a lower level, as shown in fig. 3, a query element is aggregated and displayed, that is, a returned point and a quantity value of the aggregation of the point are displayed;
it should be noted that, the monitoring of the map level change refers to monitoring of the map level change, and specifically includes: and when the system zooms in, zooms out, clicks and drags to four events, the system can make corresponding feedback according to the monitored events.
According to an embodiment of the invention, the geometric categories include points, lines and polygons; when the geometric category is a point, directly calculating a hash value by using a geohash algorithm; when the geometric category is a line or a polygon, the central point is calculated first, and then the hash value is calculated by using a geohash algorithm according to the central point.
It should be noted that the geometric type is usually represented by geometry in an algorithm; the points are usually represented by points, the lines by lines and the polygons by polygons.
According to the embodiment of the invention, the mapping relation between the map level and the length is as follows:
level 1 is less than or equal to 5 and the return length is 4;
level 6 is less than or equal to 11 and the return length is 5;
level 12 ≦ 13 Return Length 6;
level 14 ≦ 15 returning length 7;
tier ≧ 16 returns length 0.
It should be noted that, when the length obtained through the mapping relationship is 0, it indicates that data is not queried through geocode, but a boundary range of a current map view is directly obtained, a st _ contacts function is used for querying, and a map dragging event is monitored; and after the map is judged to have a dragging event and the map view is changed, emptying the original data, reloading the interface request data, clearing all elements except the view after the data is returned, and reloading all elements in the current view.
According to the embodiment of the invention, the mapping relation between the map hierarchy and the length is set according to the practical condition of the application project of the method.
According to the embodiment of the invention, if the number of returned aggregations is 1, the position is represented as having no aggregation, and single-point display is carried out, otherwise, the position is represented as having aggregation, and aggregation display is carried out.
It should be noted that the single-point display generally occurs at a higher level, and the aggregate display generally occurs at a lower level; for example, in fig. 2, when a camera is queried, the layer in which the camera is located is a higher level, and the camera is not aggregated in the graph, the direct display is a single-point display; for example, in fig. 3, when querying the camera, the camera aggregates in the graph, and performs aggregate display, that is, displays the returned point and the quantity value of the aggregation of the point.
According to the embodiment of the invention, the hierarchy change event comprises a map zooming hierarchy enlarging, a map zooming hierarchy reducing, a map clicking event and a map dragging event;
when the zoom level of the map is judged to be increased, acquiring a new length through getGroupLeftLength, transmitting a new length value if the length of the length is judged to be changed, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the new geocode starts from an old geocode, if so, storing the new geocode into an animation array, and starting frame animation, wherein the animation effect is the moving effect of diffusing the middle point to other points on the periphery; after the animation movement is finished, removing elements on the upper map;
when the map zooming level is judged to be reduced, acquiring a new length through getGroupLeftLength, if the length of the length G is judged to be changed, transmitting a new length G value, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the old geocode starts with the new geocode or not, if so, saving the new geocode to an animation array, starting frame animation, gathering the animation effect towards the middle points at the periphery, and removing elements on the lower map after the animation movement is finished;
when a click event exists in the map, acquiring a current clicked element, directly responding to the click event of the map if the total number is 1 and indicating that the current clicked element is not an aggregation element, otherwise, judging that the element is the aggregation element, amplifying the current map level if the element is the aggregation element, then re-judging the map level, acquiring data again through an interface, storing the data into an animation array after returning the data, and starting frame animation, wherein the animation effect is a moving effect of diffusing to other points around by taking a clicked point as a center; after the animation movement is finished, removing elements on the upper map;
and after the data is returned, all elements except the view are cleared, and all elements in the current view are reloaded.
It should be noted that, when the map zoom level is increased, the map zoom level is decreased, and a map click event occurs, the system may perform the following feedback according to the monitored event;
for example, when a map is zoomed in, the map changes from a low level to a high level, that is, when the map changes from fig. 3 to fig. 2, a new length is obtained through getgrouplftlength, a new length value is introduced, data is requested to a background again, after the data is returned, all new returned geocodes are traversed, and by comparing that the new geocode starts from an old geocode, the new geocode is saved to an animation array, and a frame animation is started, wherein the animation effect is a middle point, and a moving effect spreading to the rest of points around, and after the animation movement is finished, elements on the map on the upper layer are removed, and a new layer display is performed;
for example, when a map is changed from a high level to a low level, that is, when the map is changed from fig. 2 to fig. 3, a new length is obtained through getgrouplftlength, a new legth value is introduced, data is requested to a background again, after the data is returned, all new returned geocodes are traversed, the old geocodes are compared with the moving effect of gathering from the new geocodes to the middle point around, a frame animation is started, the animation effect is moved to the middle point around, and after the animation movement is finished, elements on the map on the lower layer are removed and displayed;
for example, when a click event occurs in a map, as shown in fig. 4 and 5, when a point with the aggregate number of 3848 in fig. 4 is clicked, the map hierarchy is enlarged, then the map hierarchy is judged again, data is obtained again through the interface, after the data is returned, the data is saved in an animation array, and a frame animation is started, wherein the animation effect is a moving effect which spreads to the rest of the points around with the clicked point as the center; after the animation movement is finished, the elements on the upper map are removed and displayed as 4 aggregation elements as in fig. 5.
According to the embodiment of the invention, the space aggregation is used for making a layer of cache by taking the layer name and the map layer as a key when the map is at a low level and the data is not changed greatly, and the data is directly returned from the cache when the map layer is changed.
It should be noted that the key is an algorithm tool, and when the map level changes and the data changes little relatively, the pre-stored data can be directly returned from the cache by the key; for example, when the data changes from the level 1 to the level 2 relatively little, the data can be directly returned from the cache, massive data is prevented from being loaded under the condition of a lower map level, the total number under the relative level is calculated, the loading speed is increased by one step, and the whole aggregated animation can be updated more smoothly.
Example 2
The embodiment discloses a space aggregation display query system, which comprises a memory and a processor, wherein the memory comprises a space aggregation display query method program, and the space aggregation display query method program realizes the following steps when executed by the processor:
s1: loading a data layer object of a GIS database;
s2: abstracting geocoding fields in all GIS data layer objects, and generating a list;
s3: judging the geometric types of the fields in the list, calculating a hash value through a geohash algorithm according to a preset calculation rule corresponding to each geometric type, and recording the obtained hash value as geocode;
s4: map hierarchy division is carried out on a GIS data map layer, the length of a geocode corresponding to aggregation is obtained through a getGroupLeftLength function on the current map hierarchy, and the aggregation length is recorded as length G; when a map level is input, returning the length according to a preset mapping relation between the map level and the length;
s5: according to the geocode and the length hG, returning a point and the number of the point aggregation through group by left (geocode, length hG) query of sql;
s6: performing aggregation display or single-point display according to the aggregation quantity, wherein the aggregation display refers to displaying the returned points and the aggregation quantity of the points, and the single-point display refers to directly displaying the points;
s7: and monitoring a map hierarchy change event, and making corresponding change and display according to the hierarchy change type.
According to an embodiment of the invention, the geometric categories include points, lines and polygons; when the geometric category is a point, directly calculating a hash value by using a geohash algorithm; when the geometric category is a line or a polygon, the central point is calculated first, and then the hash value is calculated by using a geohash algorithm according to the central point.
According to the embodiment of the invention, the mapping relation between the map level and the length is as follows:
level 1 is less than or equal to 5 and the return length is 4;
level 6 is less than or equal to 11 and the return length is 5;
level 12 ≦ 13 Return Length 6;
level 14 ≦ 15 returning length 7;
tier ≧ 16 returns length 0.
According to the embodiment of the invention, the mapping relation between the map hierarchy and the length is set according to the practical condition of the application project of the method.
According to the embodiment of the invention, if the number of returned aggregations is 1, the position is represented as having no aggregation, and single-point display is carried out, otherwise, the position is represented as having aggregation, and aggregation display is carried out.
According to the embodiment of the invention, the hierarchy change event comprises a map zooming hierarchy enlarging, a map zooming hierarchy reducing, a map clicking event and a map dragging event;
when the zoom level of the map is judged to be increased, acquiring a new length through getGroupLeftLength, transmitting a new length value if the length of the length is judged to be changed, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the new geocode starts from an old geocode, if so, storing the new geocode into an animation array, and starting frame animation, wherein the animation effect is the moving effect of diffusing the middle point to other points on the periphery; after the animation movement is finished, removing elements on the upper map;
when the map zooming level is judged to be reduced, acquiring a new length through getGroupLeftLength, if the length of the length G is judged to be changed, transmitting a new length G value, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the old geocode starts with the new geocode or not, if so, saving the new geocode to an animation array, starting frame animation, gathering the animation effect towards the middle points at the periphery, and removing elements on the lower map after the animation movement is finished;
when a click event exists in the map, acquiring a current clicked element, directly responding to the click event of the map if the total number is 1 and indicating that the current clicked element is not an aggregation element, otherwise, judging that the element is the aggregation element, amplifying the current map level if the element is the aggregation element, then re-judging the map level, acquiring data again through an interface, storing the data into an animation array after returning the data, and starting frame animation, wherein the animation effect is a moving effect of diffusing to other points around by taking a clicked point as a center; after the animation movement is finished, removing elements on the upper map;
and after the data is returned, all elements except the view are cleared, and all elements in the current view are reloaded.
According to the embodiment of the invention, the space aggregation is used for making a layer of cache by taking the layer name and the map layer as a key when the map is at a low level and the data is not changed greatly, and the data is directly returned from the cache when the map layer is changed.
Example 3
The embodiment provides a readable storage medium, where the readable storage medium includes a space aggregation display query method program, and when the space aggregation display query method program is executed by a processor, the space aggregation display query method program implements the steps of the space aggregation display query method.
According to the space aggregation display query method and system, the hash value is calculated in advance by adopting the geohash algorithm at the back end, and the space aggregation operation is converted into the character operation, so that the operation amount is greatly reduced, and the operation efficiency and the loading capacity of a map are improved; meanwhile, the efficient operation and loading capacity shortens the data transmission time and the calculation aggregation time, and greatly improves the front-end space aggregation display experience of the map; under the mutual cooperation of the front end and the back end, the data loading capacity of the map is greatly improved in the aspects of performance and experience.
In the several embodiments provided in the present application, it should be understood that the disclosed method and system may be implemented in other ways and that the above-described embodiments are merely illustrative. For example, the description of the animation effect is only one kind of animation effect of diffusion movement or convergence movement, and there may be other animation effects in actual implementation, such as: fade in, fade out, or may be transparent, rotating, or telescoping, rotating, or moving, rotating, or not executing. In addition, the mapping relationship between the proposed map hierarchy and the mapping length can be many-to-one or one-to-one, the mapping relationship provides an external interface, and the mapping range can be set according to the actual situation of the application project.
The external interfaces may or may not be physically separate, and the components provided as the mapping relationship may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.

Claims (10)

1. A space aggregation display query method is characterized by comprising the following steps: the method comprises the following steps:
s1: loading a data layer object of a GIS database;
s2: abstracting geocoding fields in all GIS data layer objects, and generating a list;
s3: judging the geometric types of the fields in the list, calculating a hash value through a geohash algorithm according to a preset calculation rule corresponding to each geometric type, and recording the obtained hash value as geocode;
s4: map hierarchy division is carried out on a GIS data map layer, the length of a geocode corresponding to aggregation is obtained through a getGroupLeftLength function on the current map hierarchy, and the aggregation length is recorded as length G; when a map level is input, returning the length according to a preset mapping relation between the map level and the length;
s5: according to the geocode and the length hG, returning a point and the number of the point aggregation through group by left (geocode, length hG) query of sql;
s6: performing aggregation display or single-point display according to the aggregation quantity, wherein the aggregation display refers to displaying the returned points and the aggregation quantity of the points, and the single-point display refers to directly displaying the points;
s7: and monitoring a map hierarchy change event, and making corresponding change and display according to the hierarchy change type.
2. The method according to claim 1, wherein in step S3, the geometric categories include points, lines and polygons; when the geometric category is a point, directly calculating a hash value by using a geohash algorithm; when the geometric category is a line or a polygon, the central point is calculated first, and then the hash value is calculated by using a geohash algorithm according to the central point.
3. The method according to claim 1, wherein in step S4, the mapping relationship between the map levels and the lengths is as follows:
level 1 is less than or equal to 5 and the return length is 4;
level 6 is less than or equal to 11 and the return length is 5;
level 12 ≦ 13 Return Length 6;
level 14 ≦ 15 returning length 7;
tier ≧ 16 returns length 0.
4. The method according to claim 1, wherein in step S4, the mapping relationship between the map hierarchy and the length is set according to the actual conditions of the application items of the method.
5. The method for querying aggregate spatial presentation according to claim 1, wherein in step S6, if the number of returned aggregates is 1, it represents that there is no aggregate in the location, and performs single-point presentation, otherwise, it represents that there is an aggregate in the location, and performs aggregate presentation.
6. The method according to claim 1, wherein in step S7, the hierarchy change event includes an increase of a map zoom hierarchy, a decrease of the map zoom hierarchy, a map click event, and a map drag event;
when the zoom level of the map is judged to be increased, acquiring a new length through getGroupLeftLength, transmitting a new length value if the length of the length is judged to be changed, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the new geocode starts from an old geocode, if so, storing the new geocode into an animation array, and starting frame animation, wherein the animation effect is the moving effect of diffusing the middle point to other points on the periphery; after the animation movement is finished, removing elements on the upper map;
when the map zooming level is judged to be reduced, acquiring a new length through getGroupLeftLength, if the length of the length G is judged to be changed, transmitting a new length G value, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the old geocode starts with the new geocode or not, if so, saving the new geocode to an animation array, starting frame animation, gathering the animation effect towards the middle points at the periphery, and removing elements on the lower map after the animation movement is finished;
when a click event exists in the map, acquiring a current clicked element, directly responding to the click event of the map if the total number is 1 and indicating that the current clicked element is not an aggregation element, otherwise, judging that the element is the aggregation element, amplifying the current map level if the element is the aggregation element, then re-judging the map level, acquiring data again through an interface, storing the data into an animation array after returning the data, and starting frame animation, wherein the animation effect is a moving effect of diffusing to other points around by taking a clicked point as a center; after the animation movement is finished, removing elements on the upper map;
and after the data is returned, all elements except the view are cleared, and all elements in the current view are reloaded.
7. The method according to claim 1, wherein in the spatial aggregation, when the map is at a low level and the data is not changed greatly, a layer cache is made by using a layer name plus a map level as a key, and when the map level is changed, the data is directly returned from the cache.
8. A space aggregation display query system is characterized by comprising a memory and a processor, wherein the memory comprises a space aggregation display query method program, and the space aggregation display query method program realizes the following steps when being executed by the processor:
s1: loading a data layer object of a GIS database;
s2: abstracting geocoding fields in all GIS data layer objects, and generating a list;
s3: judging the geometric types of the fields in the list, calculating a hash value through a geohash algorithm according to a preset calculation rule corresponding to each geometric type, and recording the obtained hash value as geocode;
s4: map hierarchy division is carried out on a GIS data map layer, the length of a geocode corresponding to aggregation is obtained through a getGroupLeftLength function on the current map hierarchy, and the aggregation length is recorded as length G; when a map level is input, returning the length according to a preset mapping relation between the map level and the length;
s5: according to the geocode and the length hG, returning a point and the number of the point aggregation through group by left (geocode, length hG) query of sql;
s6: performing aggregation display or single-point display according to the aggregation quantity, wherein the aggregation display refers to displaying the returned points and the aggregation quantity of the points, and the single-point display refers to directly displaying the points;
s7: and monitoring a map hierarchy change event, and making corresponding change and display according to the hierarchy change type.
9. The system according to claim 8, wherein in step S7, the hierarchy change event includes a map zoom level increase, a map zoom level decrease, a map click event, and a map drag event;
when the zoom level of the map is judged to be increased, acquiring a new length through getGroupLeftLength, transmitting a new length value if the length of the length is judged to be changed, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the new geocode starts from an old geocode, if so, storing the new geocode into an animation array, and starting frame animation, wherein the animation effect is the moving effect of diffusing the middle point to other points on the periphery; after the animation movement is finished, removing elements on the upper map;
when the map zooming level is judged to be reduced, acquiring a new length through getGroupLeftLength, if the length of the length G is judged to be changed, transmitting a new length G value, requesting data to a background again, traversing all new returned geocodes after returning the data, comparing whether the old geocode starts with the new geocode or not, if so, saving the new geocode to an animation array, starting frame animation, gathering the animation effect towards the middle points at the periphery, and removing elements on the lower map after the animation movement is finished;
when a click event exists in the map, acquiring a current clicked element, directly responding to the click event of the map if the total number is 1 and indicating that the current clicked element is not an aggregation element, otherwise, judging that the element is the aggregation element, amplifying the current map level if the element is the aggregation element, then re-judging the map level, acquiring data again through an interface, storing the data into an animation array after returning the data, and starting frame animation, wherein the animation effect is a moving effect of diffusing to other points around by taking a clicked point as a center; after the animation movement is finished, removing elements on the upper map;
and after the data is returned, all elements except the view are cleared, and all elements in the current view are reloaded.
10. A readable storage medium, characterized in that the readable storage medium includes a space aggregation presentation query method program, and when the space aggregation presentation query method program is executed by a processor, the steps of a space aggregation presentation query method according to any one of claims 1 to 7 are implemented.
CN202111223505.0A 2021-10-20 2021-10-20 Space aggregation display query method, system and readable storage medium Active CN113946582B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111223505.0A CN113946582B (en) 2021-10-20 2021-10-20 Space aggregation display query method, system and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111223505.0A CN113946582B (en) 2021-10-20 2021-10-20 Space aggregation display query method, system and readable storage medium

Publications (2)

Publication Number Publication Date
CN113946582A true CN113946582A (en) 2022-01-18
CN113946582B CN113946582B (en) 2024-08-13

Family

ID=79331758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111223505.0A Active CN113946582B (en) 2021-10-20 2021-10-20 Space aggregation display query method, system and readable storage medium

Country Status (1)

Country Link
CN (1) CN113946582B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100017733A1 (en) * 1999-07-22 2010-01-21 Barros Barbara L Graphic-Information Flow for Visually Analyzing Patterns and Relationships
US20130346851A1 (en) * 2012-06-25 2013-12-26 Microsoft Corporation Declarative show and hide animations in html5
CN109977179A (en) * 2019-02-19 2019-07-05 中电海康集团有限公司 A kind of poly- scattered method for visualizing of grid dividing realization magnanimity atural object mark point of layering
CN112860831A (en) * 2021-01-29 2021-05-28 城云科技(中国)有限公司 Method and system for processing and displaying GIS point locations of urban management events

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100017733A1 (en) * 1999-07-22 2010-01-21 Barros Barbara L Graphic-Information Flow for Visually Analyzing Patterns and Relationships
US20130346851A1 (en) * 2012-06-25 2013-12-26 Microsoft Corporation Declarative show and hide animations in html5
CN109977179A (en) * 2019-02-19 2019-07-05 中电海康集团有限公司 A kind of poly- scattered method for visualizing of grid dividing realization magnanimity atural object mark point of layering
CN112860831A (en) * 2021-01-29 2021-05-28 城云科技(中国)有限公司 Method and system for processing and displaying GIS point locations of urban management events

Also Published As

Publication number Publication date
CN113946582B (en) 2024-08-13

Similar Documents

Publication Publication Date Title
CN103782295B (en) Query explain plan in a distributed data management system
US10268745B2 (en) Inherited dimensions
CN110399441A (en) A kind of massive point data aggregate rendering method, device, equipment and storage medium
EP1203320A1 (en) Relation path viability prediction
JP2022137281A (en) Data query method, device, electronic device, storage medium, and program
CN112860831A (en) Method and system for processing and displaying GIS point locations of urban management events
CN105431815A (en) Input-output prioritization for database workload
US20140192082A1 (en) Methods and systems for generating an aggregated data visualization
CN112214562B (en) Data processing method, device, electronic equipment and machine-readable storage medium
JP2002074379A (en) Data display method, computer system for displaying data and recording medium
CN113946582B (en) Space aggregation display query method, system and readable storage medium
CN112464040A (en) Graph structure recognition method, electronic device, and computer-readable storage medium
CN114791915B (en) Data aggregation method and device, computer equipment and storage medium
CN111898276A (en) Overhead line model processing method and device, computer equipment and medium
CN116009983A (en) Preloading method and device based on request path and electronic equipment
Zhou et al. Multiresolution spatial databases: Making web-based spatial applications faster
CN112966041B (en) Data processing method, device, equipment and storage medium
CN116860541A (en) Service data acquisition method, device, computer equipment and storage medium
Cheng et al. A quantitative scale-setting approach for building multi-scale spatial databases
CN114491307B (en) Equipment aggregation method and device
CN113590732B (en) Display method and device for remote sensing interpretation sample points, electronic equipment and storage medium
Tian et al. Tinba: Incremental partitioning for efficient trajectory analytics
CN116010677B (en) Spatial index method and device and electronic equipment thereof
US11983204B1 (en) Mobile terminal-oriented complex condition geographic information query method, device and medium
CN118487961A (en) Cloud monitoring data visualization method and device

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