CN114489401A - Map boundary line generation and device - Google Patents

Map boundary line generation and device Download PDF

Info

Publication number
CN114489401A
CN114489401A CN202210056025.8A CN202210056025A CN114489401A CN 114489401 A CN114489401 A CN 114489401A CN 202210056025 A CN202210056025 A CN 202210056025A CN 114489401 A CN114489401 A CN 114489401A
Authority
CN
China
Prior art keywords
boundary
determining
reference point
vertex
vertices
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.)
Pending
Application number
CN202210056025.8A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information 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 Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202210056025.8A priority Critical patent/CN114489401A/en
Publication of CN114489401A publication Critical patent/CN114489401A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09BEDUCATIONAL OR DEMONSTRATION APPLIANCES; APPLIANCES FOR TEACHING, OR COMMUNICATING WITH, THE BLIND, DEAF OR MUTE; MODELS; PLANETARIA; GLOBES; MAPS; DIAGRAMS
    • G09B29/00Maps; Plans; Charts; Diagrams, e.g. route diagram
    • G09B29/003Maps
    • G09B29/005Map projections or methods associated specifically therewith

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Mathematical Physics (AREA)
  • Business, Economics & Management (AREA)
  • Educational Administration (AREA)
  • Educational Technology (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a generation method and a device of a map boundary line, and relates to the technical field of computers. The method is applied to the client, and a specific implementation mode of the method comprises the following steps: receiving a user instruction, and determining a map area corresponding to the user instruction; determining a plurality of boundary vertices at boundary locations of the map region; determining a reference point from the boundary vertexes, and respectively calculating a metric value between each other vertex and the reference point, wherein the other vertices are the rest boundary vertexes except the reference point from the boundary vertexes; determining the ordering information of each boundary vertex according to the metric value; and sequentially connecting the boundary vertexes according to the sequencing information of the boundary vertexes to generate a boundary line of the map area. In the process of generating the boundary line of the area in the electronic map, the embodiment can reduce resource consumption of the server side.

Description

Map boundary line generation and device
Technical Field
The invention relates to the technical field of computers, in particular to a generation method and a device of a map boundary line.
Background
Related applications of electronic maps are widely installed on terminals. The related processing of the boundary lines of each area in the electronic map is usually completed by a server side, and the related data of the boundary lines are transmitted back to the terminal from the server side and finally displayed to a user by the terminal. This processing method needs to consume more resources of the server, thereby causing a shortage of resources of the server.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating a boundary line of a map, which can reduce resource consumption at a server end in a process of generating a boundary line of an area in an electronic map.
In a first aspect, an embodiment of the present invention provides generation of a map boundary line, which is applied to a client, and includes:
receiving a user instruction, and determining a map area corresponding to the user instruction;
determining a plurality of boundary vertices at boundary locations of the map region;
determining a reference point from the boundary vertexes, and respectively calculating a metric value between each other vertex and the reference point, wherein the other vertices are the rest boundary vertexes except the reference point from the boundary vertexes;
determining the ordering information of each boundary vertex according to the metric value;
and sequentially connecting the boundary vertexes according to the sequencing information of the boundary vertexes to generate a boundary line of the map area.
Optionally, the metric value is a distance value between the other vertex and the reference point;
the calculating the metric between each other vertex and the reference point respectively comprises:
respectively calculating the distance value between each other vertex and the reference point;
determining ordering information of each boundary vertex according to the metric value, including:
and determining the sequencing information of each boundary vertex according to the distance value between the other vertices and the reference point.
Optionally, the metric is a tangent value of an included angle between a connecting line of the other vertex and the reference point and a horizontal line;
the calculating the metric between each other vertex and the reference point respectively comprises:
respectively calculating tangent values of included angles between connecting lines of the other vertexes and the reference points and a horizontal line;
determining ordering information of each boundary vertex according to the metric value, including:
and determining the sequencing information of each boundary vertex according to the tangent value of an included angle between the connecting line of the other vertices and the reference point and the horizontal line.
Optionally, the determining a reference point from the plurality of boundary vertices includes:
acquiring point location information of each boundary vertex, wherein the point location information comprises: the X-axis coordinate and the Y-axis coordinate of the boundary vertex in a coordinate system;
determining the reference point according to the X-axis coordinate and the Y-axis coordinate, so that the other vertexes are all located on the left side of the reference point in the coordinate system.
Optionally, the receiving a user instruction and determining a map area corresponding to the user instruction includes:
receiving a drawing operation of a user on an electronic map;
and determining the target area defined by the drawing operation as the map area.
Optionally, the delineation operation defines a plurality of target regions;
the determining a plurality of boundary vertices at boundary locations of the map region; determining a reference point from the boundary vertices, and calculating metric values between each of the other vertices and the reference point, respectively, including:
for each of the target regions: determining a plurality of boundary vertices at boundary locations of the target region; determining a reference point of the target area from a plurality of boundary vertexes of the target area; respectively calculating the metric values between other vertexes of each target area and the reference point of the target area;
determining the ordering information of each boundary vertex according to the metric value; sequentially connecting the boundary vertexes according to the sorting information of the boundary vertexes to generate a boundary line of the map area, including:
for each of the target regions: determining the sequencing information of the boundary vertexes of each target area according to the metric value between other vertexes of each target area and the reference point of the target area; and sequentially connecting the boundary vertexes of the target areas according to the sequencing information of the boundary vertexes of the target areas to generate the boundary line of the target areas.
Optionally, after the boundary vertices of the target regions are sequentially connected according to the sorting information of the boundary vertices of the target regions, the method further includes:
receiving selected instructions of a user for the plurality of target areas;
according to the selected instruction, determining a selected area from the target areas;
and displaying the area information of the selected area.
In a second aspect, an embodiment of the present invention provides an apparatus for generating a map boundary line, where the apparatus is applied to a client, and includes:
the area determining module is used for receiving a user instruction and determining a map area corresponding to the user instruction;
a vertex determining module for determining a plurality of boundary vertices at boundary locations of the map area;
a calculation module, configured to determine a reference point from the multiple boundary vertices, and calculate metric values between other vertices and the reference point, where the other vertices are remaining boundary vertices excluding the reference point from the multiple boundary vertices;
the ordering module is used for determining ordering information of each boundary vertex according to the metric value;
and the generating module is used for sequentially connecting the boundary vertexes according to the sequencing information of the boundary vertexes so as to generate the boundary line of the map area.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of the embodiments described above.
In a fourth aspect, an embodiment of the present invention provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method of any one of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: the client receives the user instruction, determines a map area corresponding to the user instruction, and sequentially connects boundary vertexes according to the sequencing information of the boundary vertexes of the map area to generate a boundary line of the map area. According to the method provided by the embodiment of the invention, the client side completes the relevant processing of the boundary line, so that the resource consumption of the server side is reduced.
In addition, the data size of the data related to the boundary line is huge, and if the server end completes the processing related to the boundary line and then transmits the data related to the boundary line back to the server, a large amount of network resources are consumed. Therefore, the method of the embodiment of the invention can also relieve the pressure of network transmission between the server and the terminal.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a process for generation of a map boundary line according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of another exemplary vertex-to-datum connection according to the present invention;
FIG. 3 is a schematic diagram of another process for generating map boundary lines provided by an embodiment of the present invention;
FIG. 4 is a diagram illustrating an architecture of a processing system for map boundary lines, according to an embodiment of the present invention;
FIG. 5 is a schematic illustration of a flow of generation of yet another map boundary provided by an embodiment of the present invention;
FIG. 6 is a diagram of a map boundary line generation process provided by one embodiment of the present invention;
FIG. 7 is a schematic structural diagram of an apparatus for generating a map boundary line according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a flow of generation of a map boundary line according to an embodiment of the present invention. As shown in fig. 1, the method includes:
step 101: receiving a user instruction, and determining a map area corresponding to the user instruction.
The user can input user instructions on terminal equipment such as a desktop computer, a tablet, a mobile phone or a notebook computer. The user instruction can be a drawing operation directly displayed on the electronic map by the user at the terminal, and the area defined by the drawing operation is the map area corresponding to the user instruction. The user instruction may also be an instruction of region information input by the user, and the region information may include: address information, building names, shop names and the like, wherein one or more areas corresponding to the area information are map areas corresponding to the user instructions.
Step 102: a plurality of boundary vertices at boundary locations of the map region are determined.
The map area may present a regular or irregular polygon. A plurality of boundary vertexes can be obtained at the boundary position of the map area, and the boundary line of the map area can be obtained by sequentially connecting the boundary vertexes.
Step 103: a reference point is determined from the plurality of boundary vertices, and a metric between each of the other vertices and the reference point is calculated.
The reference points may be determined in a variety of ways. The reference point may be randomly determined from a plurality of boundary vertices. It is also possible to describe each boundary vertex in a coordinate system and determine a boundary vertex having a maximum X-axis coordinate, a minimum X-axis coordinate, a maximum Y-axis coordinate, or a minimum Y coordinate as a reference point. The other vertices are the remaining boundary vertices excluding the reference point from the plurality of boundary vertices.
Step 104: and determining the ordering information of each boundary vertex according to the metric value.
The reference point may be set as the first boundary vertex of the boundary vertices, or may be set as the last boundary vertex.
The ordering information for each boundary vertex may be determined in a number of ways. For example, the ordering information of each boundary vertex is determined according to the magnitude of the metric value. The ordering information of the boundary vertex with small measurement value is in the front, and the ordering information of the boundary vertex with large measurement value is in the back. The reference point can also be set as the first boundary vertex of each boundary vertex, and the sequencing information of the boundary vertices is determined according to the magnitude of the metric value in the clockwise direction or the clockwise direction.
Step 105: and sequentially connecting the boundary vertexes according to the sequencing information of the boundary vertexes to generate a boundary line of the map area.
Specifically, the reference point is set as a first boundary vertex, a next boundary vertex is determined according to the sorting information, and the reference point and the next boundary vertex are connected. And taking the next boundary vertex as the current vertex, determining the next boundary vertex of the current vertex according to the sequencing information, and connecting the current vertex and the next boundary vertex. And repeating the steps until the last boundary vertex is connected, and then connecting the last boundary vertex with the reference point to form a closed boundary so as to finish the generation process of the boundary line of the map area.
In the embodiment of the invention, the client receives the user instruction, determines the map area corresponding to the user instruction, and sequentially connects the boundary vertexes according to the sequencing information of the boundary vertexes of the map area so as to generate the boundary line of the map area. According to the method provided by the embodiment of the invention, the client side completes the relevant processing of the boundary line, so that the resource consumption of the server side is reduced.
In addition, the data size of the data related to the boundary line is huge, and if the server end completes the processing related to the boundary line and then transmits the data related to the boundary line back to the server, a large amount of network resources are consumed. Therefore, the method of the embodiment of the invention can also relieve the pressure of network transmission between the server and the terminal.
In one embodiment of the invention, the metric is a distance value between the other vertices and the reference point; calculating the metric value between each other vertex and the reference point respectively, including: respectively calculating the distance value between each other vertex and the reference point; determining the ordering information of each boundary vertex according to the metric value, comprising: and determining the sequencing information of each boundary vertex according to the distance values between other vertices and the reference point. And determining the sequencing information of each boundary vertex according to the distance value between each other vertex and the reference point. The information on the boundary vertices having small distance values is at the front, and the information on the boundary vertices having large distance values is at the back. The reference point can also be set as the first boundary vertex of each boundary vertex, the boundary vertex with the minimum distance value is sequentially selected in a clockwise direction or a counterclockwise direction, and the sequencing information of the boundary vertex is determined.
The reference point may be set as the current boundary vertex, the ranking information of the reference point is minimum, the boundary vertex having the minimum distance value from the current boundary vertex is selected as the next vertex of the current boundary vertex, and the ranking information of the next vertex is determined. And taking the next boundary vertex as the current vertex, selecting the boundary vertex with the minimum distance value from the current boundary vertex from the boundary vertices with undetermined sequencing information as the next vertex of the current boundary vertex, and determining the sequencing information of the next vertex. And the like until the sequencing information of all the boundary vertexes is determined.
In one embodiment of the invention, the measurement value is a tangent value of an included angle between a connecting line of the other vertex and the reference point and a horizontal line; calculating the metric value between each other vertex and the reference point respectively, including: respectively calculating tangent values of included angles between connecting lines of other vertexes and the reference points and the horizontal line; determining the ordering information of each boundary vertex according to the metric value, comprising: and determining the sequencing information of each boundary vertex according to the tangent value of the included angle between the horizontal line and the connecting line of the other vertex and the reference point. And determining the sequencing information of each boundary vertex according to the tangent value of an included angle between a connecting line of each other vertex and the reference point and the horizontal line. Specifically, the ranking information of the boundary vertices having a small tangent value may be set at the front, and the ranking information of the boundary vertices having a large tangent value may be set at the back. The order information of the boundary vertices having a large tangent value may be set at the front, and the order information of the boundary vertices having a small tangent value may be set at the back.
In one embodiment of the present invention, determining the reference point from the plurality of boundary vertices includes: acquiring point location information of each boundary vertex, wherein the point location information comprises: the X-axis coordinate and the Y-axis coordinate of the boundary vertex in the coordinate system; the reference point is determined based on the X-axis coordinate and the Y-axis coordinate such that other vertices are located to the left of the reference point in the coordinate system.
FIG. 2 is a schematic diagram of a connection line between another vertex and a reference point according to an embodiment of the present invention. As shown in fig. 2, the X-axis of the coordinate system is the horizontal direction, and the Y-axis of the coordinate system is the vertical direction. Reference point a has the largest X-axis coordinate such that the other vertices in the coordinate system are all to the left of reference point a. If a plurality of boundary vertices having the same maximum X-axis coordinate exist at the same time, a boundary vertex having the maximum or minimum Y-axis coordinate may be selected from the plurality of boundary vertices as a reference point.
Fig. 3 is a schematic diagram of another process of generating a map boundary line according to an embodiment of the present invention. As shown in fig. 3, the method includes:
step 301: and receiving a drawing operation of a user on the electronic map.
An electronic map may be presented on the terminal device. And the user directly carries out the drawing operation on the electronic map displayed by the terminal, wherein the area limited by the drawing operation is the map area corresponding to the user instruction.
Step 302: and determining the target area defined by the drawing operation as a map area.
Step 303: a plurality of boundary vertices at boundary locations of the map region are determined.
Step 304: and determining the reference point from the boundary vertexes, and respectively calculating the metric value between each other vertex and the reference point.
The other vertices are the remaining boundary vertices excluding the reference point from the plurality of boundary vertices.
Step 305: and determining the ordering information of each boundary vertex according to the metric value.
Step 306: and sequentially connecting the boundary vertexes according to the sequencing information of the boundary vertexes to generate a boundary line of the map area.
In the embodiment of the invention, a user directly performs the drawing operation on the electronic map displayed by the terminal, and the boundary line of the map area is limited and displayed through the drawing operation. The user can conveniently perform visual operation on the electronic map, and the information of the area in which the user is interested can be quickly acquired.
In one embodiment of the invention, the delineation operation defines a plurality of target regions; the determining a plurality of boundary vertices at boundary locations of the map region; determining a reference point from the boundary vertices, and calculating metric values between each of the other vertices and the reference point, respectively, including: for each of the target regions: determining a plurality of boundary vertices at boundary locations of the target region; determining a reference point of the target area from a plurality of boundary vertexes of the target area; respectively calculating the metric values between other vertexes of each target area and the reference point of the target area; determining the ordering information of each boundary vertex according to the metric value; sequentially connecting the boundary vertexes according to the sorting information of the boundary vertexes to generate a boundary line of the map area, including: for each of the target regions: determining the sequencing information of the boundary vertex of each target area according to the metric value between other vertexes of each target area and the reference point of the target area; and sequentially connecting the boundary vertexes of the target areas according to the sequencing information of the boundary vertexes of the target areas to generate the boundary line of the target areas.
In the embodiment of the invention, a user can simultaneously limit a plurality of target areas through the drawing operation. The system automatically displays the boundary lines of a plurality of target areas, and a user can conveniently check the boundary and area information of a plurality of adjacent areas at the same time.
In an embodiment of the present invention, after the sequentially connecting the boundary vertices of the target regions according to the sorting information of the boundary vertices of the target regions, the method further includes: receiving selected instructions of a user for the plurality of target areas; according to the selected instruction, determining a selected area from the target areas; and displaying the area information of the selected area.
The area information is related information of the selected area. The region information may include: regional address information, regional names, business hours, contact phone numbers, etc. The user determines the selected area from the plurality of target areas through the selection instruction, and can learn the area information of the selected area, so that the user can conveniently learn the relevant information of each area.
FIG. 4 is a diagram illustrating an architecture of a processing system for map boundary lines according to an embodiment of the present invention. As shown in fig. 4, the system includes: data servers, application servers, Web application servers, and the like.
A data server: the system comprises spatial data, a spatial database and an attribute database (a geographic information database and a business database) which exist in a file form, wherein the geographic information database is used for storing geographic information data (including vectors, place names, addresses, special subjects and tile data), and the business database is used for storing relational data applied by a front-end network station or industry;
an application server: since the geographic information system is implemented on the basis of the map service, and most of the requirements related to the map need to be able to ensure that at least the map service can be normally called by building a high-performance and high-availability server, a clustering technology needs to be used. The redundancy of the service can be increased by building a GIS server cluster, the service performance is improved, after all, the service provided by a geographic information system is not a simple webpage address service, the consumed resources are very large, and even if the service is a space query statement, the performance consumption of the database is considerable. Of course, the cluster technology also has various combination modes such as software and hardware level distribution, load balancing, networks, links and the like, and can be set up according to actual needs. The final purpose of the GIS application server is set up, the GIS application server is used for applying various OGC services such as WMS, WTMS, WFS, WCS and the like, and various GIS services such as map service, data service, spatial data operational analysis and the like to map loading display, data addition, deletion, check and modification, topology operation, even spatial data intersection, merging and erasing and the like, and the services are provided by the GIS application server;
the Web application server: the Web application server is mainly used for calling GIS service and background service data aiming at industrial application and displaying the GIS service and the background service data at the front end; the Web application server provides Web information browsing services, which are usually presented in the form of a website.
The solution of the embodiments of the present invention can be directly applied to the actual project using the geo-fence, when the front-end and back-end interaction is performed using the geo-fence, generally, the back end first acquires all child fences under the requested fence, then dynamically calculates the parent fence through the child fences, and then returns the parent and child geofences together, but actually, because the map presents huge amount of spatial data, the influence on spatial data transmission is great when the network is poor, the data volume can be properly reduced, the spatial data processing and analyzing capabilities provided by the server side are not excessively depended, the spatial data processing and analyzing capabilities of part of the server side can be realized on the basis of the front end, the computing resources are utilized more reasonably and efficiently between the front end and the server end, meanwhile, data updating and function iteration are more flexible and convenient, and a user can operate the map tool more smoothly.
FIG. 5 is a schematic diagram of a flow of generation of yet another map boundary provided by an embodiment of the present invention. As shown in fig. 5, an aggregate of element sets is obtained, then all the nodes constituting the aggregate are extracted from the aggregate, and finally all the extracted nodes are connected to form an element set boundary. FIG. 6 is a diagram of a map boundary line generation process according to an embodiment of the present invention. As shown in fig. 6, the boundary vertices are connected in sequence to generate the boundary of the map area.
As shown in fig. 5, when point location information of each boundary vertex is known, a map element set is loaded using RBush (RBush is based on an optimized R-tree data structure, is used for two-dimensional spatial indexing of points and rectangles, supports large-capacity insertion, is a special data structure for points and rectangles, is most commonly used for map and data visualization, and circulates hundreds times faster than on all projects). And analyzing data information, point location information and map elements in the map element set data.
After a point set is obtained by traversing a map element set, any reference point is extracted to be connected with other boundary vertexes and a distance value is calculated, the distance values are sorted from short to long, the extracted first boundary vertex triggers to be sequentially connected with the next boundary vertex in a transfer mode according to a sorting sequence, and finally a boundary line of a map area is obtained.
As shown in fig. 5, when the point location information of each boundary vertex is unknown, it is necessary to scan a point element set of all boundary vertices. Specifically, the maximum number of scanning lines occupied by the polygon is determined, the minimum and maximum y-axis coordinates of the polygon vertex are obtained, intersection, sorting, intersection pairing and area color filling are performed by using one scanning line each time from Ymin to Ymax, when the scanning line intersects with the polygon vertex, if two sides sharing the vertex fall on two sides of the scanning line respectively, the intersection is calculated as one, if the two sides sharing the vertex are on the same side of the scanning line, the intersection is zero or two (the y value of the other two end points of the two sides sharing the vertex is checked, if the y value is below the other two end points of the two sides sharing the vertex, the y value is calculated as 0, and if the y value is above the other two end points, the y value is calculated as 2), and finally all point element sets are obtained.
All element sets are connected to form a closed boundary. And taking the point A with the maximum x-axis coordinate as a reference point, and if more than one point with the maximum x-axis coordinate is used, taking the point with the minimum Y-axis coordinate. All other vertexes are positioned on the left side of the point A of the reference point, all included angles range from minus pi/2 to pi/2, and the included angles are monotonously increasing functions.
And sequentially calculating tangent values of included angles between the connecting lines of the point A and other vertexes and the horizontal line, sequencing according to the tangent values, and sequentially connecting the sequenced boundary vertexes to form a closed boundary, wherein the closed boundary is the boundary of the map area.
For example, for a certain map area, the angular slope of each other vertex from reference point a is as follows (already ordered):
x:426.192518536091,y:30.5668629242884,slope:-2.21036105157629
x:132.904271903869,y:111.805767306036,slope:0.0233827696146631
x:209.153583263584,y:158.396180071121,slope:0.216615047225945
x:51.2625493860163,y:271.425922467106,slope:0.409713066051227
x:172.80558813494,y:320.363658168522,slope:0.754116336162768
x:174.841647802313,y:361.474091434606,slope:0.903935084923323
x:262.993097888768,y:306.679940091763,slope:1.03059799172764
x:405.520514378101,y:212.478244240618,slope:2.00680658499766
x:410.405247491042,y:324.597360433357,slope:4.49064367657446
x:459.491329337233,y:104.169257382941,slope:1.79769313486232E+308
the relevant data of the point A are as follows:
x:459.491329337233,y:104.169257382941,slope:1.79769313486232E+308
it can be seen that point a has the largest X-axis coordinate and is selected as the reference point. And sequentially calculating tangent values of included angles between the connecting lines of the point A and other vertexes and the horizontal line. The boundary vertices are then sorted by tangent value. And sequentially connecting the sorted boundary vertexes to form a closed boundary, wherein the closed boundary is the boundary of the map area.
In the embodiment of the invention, the working process of the server side for carrying out data processing on the spatial data and the map element set is realized on the basis of the front end, and the calculation resources are more reasonably and efficiently utilized between the front end and the server side while the data size is reduced. The method is realized based on a front-end technology, and the boundary extraction of the map area is realized by integrating the map element set, extracting each boundary vertex and connecting lines.
Fig. 7 is a schematic structural diagram of a map boundary line generating apparatus according to an embodiment of the present invention. The apparatus is applied to a client, and as shown in fig. 7, the apparatus includes:
the area determining module 701 is configured to receive a user instruction and determine a map area corresponding to the user instruction;
a vertex determining module 702 for determining a plurality of boundary vertices at boundary locations of the map region;
a calculating module 703, configured to determine a reference point from the multiple boundary vertices, and calculate a metric between each other vertex and the reference point, where the other vertex is a remaining boundary vertex excluding the reference point from the multiple boundary vertices;
a sorting module 704, configured to determine sorting information of each boundary vertex according to the metric;
the generating module 705 is configured to sequentially connect the boundary vertices according to the sorting information of the boundary vertices, so as to generate a boundary line of the map area.
Optionally, the metric is a distance value between the other vertex and the reference point;
the calculation module 703 is specifically configured to:
respectively calculating the distance value between each other vertex and the reference point;
determining ordering information of each boundary vertex according to the metric value, including:
and determining the sequencing information of each boundary vertex according to the distance value between the other vertices and the reference point.
Optionally, the metric is a tangent value of an included angle between a connecting line of the other vertex and the reference point and a horizontal line;
the calculation module 703 is specifically configured to:
respectively calculating tangent values of included angles between connecting lines of the other vertexes and the reference points and a horizontal line;
determining ordering information of each boundary vertex according to the metric value, including:
and determining the sequencing information of each boundary vertex according to the tangent value of an included angle between the connecting line of the other vertices and the reference point and the horizontal line.
Optionally, the calculation module 703 is specifically configured to:
acquiring point location information of each boundary vertex, wherein the point location information comprises: the X-axis coordinate and the Y-axis coordinate of the boundary vertex in a coordinate system;
determining the reference point according to the X-axis coordinate and the Y-axis coordinate, so that the other vertexes are all located on the left side of the reference point in the coordinate system.
Optionally, the region determining module 701 is specifically configured to:
receiving a drawing operation of a user on an electronic map;
and determining the target area defined by the drawing operation as the map area.
Optionally, the delineation operation defines a plurality of target regions;
the calculation module 703 is specifically configured to:
for each of the target regions: determining a plurality of boundary vertices at boundary locations of the target region; determining a reference point of the target area from a plurality of boundary vertexes of the target area; respectively calculating the metric values between other vertexes of each target area and the reference point of the target area;
the generating module 705 is specifically configured to:
for each of the target regions: determining the sequencing information of the boundary vertex of each target area according to the metric value between other vertexes of each target area and the reference point of the target area; and sequentially connecting the boundary vertexes of the target areas according to the sequencing information of the boundary vertexes of the target areas to generate the boundary line of the target areas.
Optionally, the apparatus further comprises:
an information display module 706, configured to receive a user selection instruction for the multiple target areas;
according to the selected instruction, determining a selected area from the target areas;
and displaying the area information of the selected area.
An embodiment of the present invention provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method of any of the embodiments described above.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: the device comprises a region determining module, a vertex determining module, a calculating module and a sequencing module. The names of these modules do not form a limitation on the modules themselves in some cases, for example, the area determination module may also be described as a "module that receives a user instruction and determines a map area corresponding to the user instruction".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise:
receiving a user instruction, and determining a map area corresponding to the user instruction;
determining a plurality of boundary vertices at boundary locations of the map region;
determining a reference point from the boundary vertexes, and respectively calculating a metric value between each other vertex and the reference point, wherein the other vertices are the rest boundary vertexes except the reference point from the boundary vertexes;
determining the ordering information of each boundary vertex according to the metric value;
and sequentially connecting the boundary vertexes according to the sequencing information of the boundary vertexes to generate a boundary line of the map area.
According to the technical scheme of the embodiment of the invention, the client receives the user instruction, determines the map area corresponding to the user instruction, and sequentially connects the boundary vertexes according to the sequencing information of the boundary vertexes of the map area so as to generate the boundary line of the map area. According to the method provided by the embodiment of the invention, the client side completes the relevant processing of the boundary line, so that the resource consumption of the server side is reduced.
In addition, the data size of the data related to the boundary line is huge, and if the server end completes the processing related to the boundary line and then transmits the data related to the boundary line back to the server, a large amount of network resources are consumed. Therefore, the method of the embodiment of the invention can also relieve the pressure of network transmission between the server and the terminal.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A map boundary line generation method applied to a client side comprises the following steps:
receiving a user instruction, and determining a map area corresponding to the user instruction;
determining a plurality of boundary vertices at boundary locations of the map region;
determining a reference point from the boundary vertexes, and respectively calculating a metric value between each other vertex and the reference point, wherein the other vertices are the rest boundary vertexes except the reference point from the boundary vertexes;
determining the ordering information of each boundary vertex according to the metric value;
and sequentially connecting the boundary vertexes according to the sequencing information of the boundary vertexes to generate a boundary line of the map area.
2. The method of claim 1, wherein the metric value is a distance value between the other vertices and the reference point;
the calculating the metric between each other vertex and the reference point respectively comprises:
respectively calculating the distance value between each other vertex and the reference point;
determining ordering information of each boundary vertex according to the metric value, including:
and determining the sequencing information of each boundary vertex according to the distance value between the other vertices and the reference point.
3. The method of claim 1, wherein the metric is a tangent of an angle between a line connecting the other vertex and the reference point and a horizontal line;
the calculating the metric between each other vertex and the reference point respectively comprises:
respectively calculating tangent values of included angles between connecting lines of the other vertexes and the reference points and a horizontal line;
determining the ordering information of each boundary vertex according to the metric value comprises the following steps:
and determining the sequencing information of each boundary vertex according to the tangent value of an included angle between the connecting line of the other vertices and the reference point and the horizontal line.
4. The method of claim 1, wherein said determining a fiducial point from said plurality of boundary vertices comprises:
acquiring point location information of each boundary vertex, wherein the point location information comprises: the X-axis coordinate and the Y-axis coordinate of the boundary vertex in a coordinate system;
determining the reference point according to the X-axis coordinate and the Y-axis coordinate, so that the other vertexes are all located on the left side of the reference point in the coordinate system.
5. The method of claim 1, wherein the receiving a user instruction and determining a map area corresponding to the user instruction comprises:
receiving a drawing operation of a user on an electronic map;
and determining the target area defined by the drawing operation as the map area.
6. The method of claim 5, wherein the delineation operation defines a plurality of target regions;
the determining a plurality of boundary vertices at boundary locations of the map region; determining a reference point from the boundary vertices, and calculating metric values between each of the other vertices and the reference point, respectively, including:
for each of the target regions: determining a plurality of boundary vertices at boundary locations of the target region; determining a reference point of the target area from a plurality of boundary vertexes of the target area; respectively calculating the metric values between other vertexes of each target area and the reference point of the target area;
determining the ordering information of each boundary vertex according to the metric value; sequentially connecting the boundary vertexes according to the sorting information of the boundary vertexes to generate a boundary line of the map area, including:
for each of the target regions: determining the sequencing information of the boundary vertex of each target area according to the metric value between other vertexes of each target area and the reference point of the target area; and sequentially connecting the boundary vertexes of the target areas according to the sequencing information of the boundary vertexes of the target areas to generate the boundary line of the target areas.
7. The method according to claim 6, wherein after sequentially connecting the boundary vertices of the target regions according to the sorting information of the boundary vertices of the target regions, the method further comprises:
receiving selected instructions of a user for the plurality of target areas;
according to the selected instruction, determining a selected area from the target areas;
and displaying the area information of the selected area.
8. An apparatus for generating a map boundary line, applied to a client, the apparatus comprising:
the area determining module is used for receiving a user instruction and determining a map area corresponding to the user instruction;
a vertex determining module for determining a plurality of boundary vertices at boundary locations of the map area;
a calculation module, configured to determine a reference point from the boundary vertices, and calculate metric values between other vertices and the reference point, where the other vertices are remaining boundary vertices excluding the reference point from the boundary vertices;
the ordering module is used for determining ordering information of each boundary vertex according to the metric value;
and the generating module is used for sequentially connecting the boundary vertexes according to the sequencing information of the boundary vertexes so as to generate the boundary line of the map area.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202210056025.8A 2022-01-18 2022-01-18 Map boundary line generation and device Pending CN114489401A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210056025.8A CN114489401A (en) 2022-01-18 2022-01-18 Map boundary line generation and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210056025.8A CN114489401A (en) 2022-01-18 2022-01-18 Map boundary line generation and device

Publications (1)

Publication Number Publication Date
CN114489401A true CN114489401A (en) 2022-05-13

Family

ID=81473450

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210056025.8A Pending CN114489401A (en) 2022-01-18 2022-01-18 Map boundary line generation and device

Country Status (1)

Country Link
CN (1) CN114489401A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650595A (en) * 2016-10-09 2017-05-10 巴州极飞农业航空科技有限公司 Land block boundary identification method and boundary identification device
CN108829951A (en) * 2018-05-31 2018-11-16 北京中油瑞飞信息技术有限责任公司 Reservoir model boundary determining method and device
CN109949325A (en) * 2019-02-27 2019-06-28 上海晶赞融宣科技有限公司 Map boundary line determines method, apparatus and computer storage medium
CN110033497A (en) * 2018-01-11 2019-07-19 灵动科技(北京)有限公司 Region labeling method, apparatus, electronic equipment and computer readable storage medium
CN110427506A (en) * 2019-07-10 2019-11-08 中国人民解放军战略支援部队信息工程大学 Spatial data boundary processing method, device, computer equipment and storage medium
CN110706305A (en) * 2019-09-24 2020-01-17 上海钧正网络科技有限公司 Method and device for drawing area in map application and computer equipment
CN111736748A (en) * 2019-11-20 2020-10-02 腾讯科技(深圳)有限公司 Data processing method and device based on map information and electronic equipment
CN112948379A (en) * 2021-02-05 2021-06-11 福建迈斯特空间信息科技有限公司 Method and device for generating distributed electronic map and readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106650595A (en) * 2016-10-09 2017-05-10 巴州极飞农业航空科技有限公司 Land block boundary identification method and boundary identification device
CN110033497A (en) * 2018-01-11 2019-07-19 灵动科技(北京)有限公司 Region labeling method, apparatus, electronic equipment and computer readable storage medium
CN108829951A (en) * 2018-05-31 2018-11-16 北京中油瑞飞信息技术有限责任公司 Reservoir model boundary determining method and device
CN109949325A (en) * 2019-02-27 2019-06-28 上海晶赞融宣科技有限公司 Map boundary line determines method, apparatus and computer storage medium
CN110427506A (en) * 2019-07-10 2019-11-08 中国人民解放军战略支援部队信息工程大学 Spatial data boundary processing method, device, computer equipment and storage medium
CN110706305A (en) * 2019-09-24 2020-01-17 上海钧正网络科技有限公司 Method and device for drawing area in map application and computer equipment
CN111736748A (en) * 2019-11-20 2020-10-02 腾讯科技(深圳)有限公司 Data processing method and device based on map information and electronic equipment
CN112948379A (en) * 2021-02-05 2021-06-11 福建迈斯特空间信息科技有限公司 Method and device for generating distributed electronic map and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘相滨;邹北骥;孙家广;: "基于边界跟踪的快速欧氏距离变换算法", 计算机学报, no. 02 *

Similar Documents

Publication Publication Date Title
US11421994B2 (en) Method and apparatus for partitioning electronic fence
US20200193372A1 (en) Information processing method and apparatus
CN110647596B (en) Map data processing method and device
CN111274341A (en) Site selection method and device for network points
CN112652036A (en) Road data processing method, device, equipment and storage medium
CN110209748B (en) Method and apparatus for indexing geofences
CN113077548A (en) Collision detection method, device, equipment and storage medium for object
CN112860993A (en) Method, device, equipment, storage medium and program product for classifying points of interest
CN114627239B (en) Bounding box generation method, device, equipment and storage medium
CN110895591B (en) Method and device for positioning self-lifting point
CN111274455A (en) Graph data processing method and device, electronic equipment and computer readable medium
CN112988933A (en) Method and device for managing address information
WO2023231459A1 (en) Method for generating intersection surface and related apparatus
CN110309244B (en) Target point positioning method and device
CN110750602A (en) Method and device for determining site to which order address belongs
CN114489401A (en) Map boundary line generation and device
CN112948517B (en) Regional position calibration method and device and electronic equipment
CN114814802A (en) Positioning method and device
CN107038176B (en) Method, device and equipment for rendering web graph page
CN115100231A (en) Method and device for determining region boundary
CN110647599B (en) Method and apparatus for displaying information
CN113723405A (en) Method and device for determining area outline and electronic equipment
CN114330807A (en) Route determination method and device and electronic equipment
CN111274272B (en) Object searching method and device and computer system
CN115115944B (en) Map data checking method and device, electronic equipment and medium

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