CN112215864A - Contour processing method and device of electronic map and electronic equipment - Google Patents

Contour processing method and device of electronic map and electronic equipment Download PDF

Info

Publication number
CN112215864A
CN112215864A CN202011223550.1A CN202011223550A CN112215864A CN 112215864 A CN112215864 A CN 112215864A CN 202011223550 A CN202011223550 A CN 202011223550A CN 112215864 A CN112215864 A CN 112215864A
Authority
CN
China
Prior art keywords
contour
coordinate point
coordinate
contours
processing
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
CN202011223550.1A
Other languages
Chinese (zh)
Other versions
CN112215864B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011223550.1A priority Critical patent/CN112215864B/en
Publication of CN112215864A publication Critical patent/CN112215864A/en
Application granted granted Critical
Publication of CN112215864B publication Critical patent/CN112215864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides a contour processing method and device of an electronic map, electronic equipment and a computer readable storage medium; the method comprises the following steps: identifying a plurality of first contours with gaps among the contours in the electronic map; dividing the earth surface space comprising the plurality of first outlines and gaps among the plurality of first outlines to obtain a plurality of grids; determining first outlines to which the grids belong respectively; merging the meshes belonging to each first contour in the earth surface space, and replacing the corresponding first contour with a second contour obtained through merging; and performing smoothing processing on each second contour, and replacing the corresponding second contour with a third contour obtained through the smoothing processing. Through the application, gaps between the profiles can be effectively eliminated.

Description

Contour processing method and device of electronic map and electronic equipment
Technical Field
The present disclosure relates to computer graphic image technologies, and in particular, to a method and an apparatus for processing an outline of an electronic map, an electronic device, and a computer-readable storage medium.
Background
Electronic maps are maps that are stored and looked up digitally using computer technology, usually using vector image storage, map scales can be enlarged, reduced or rotated without affecting the display effect, earlier using bitmap storage, map scales cannot be enlarged or reduced, modern electronic map software typically uses geographic information systems to store and transmit map data.
The contour data is a common data pattern of the electronic map, such as interest planes, administrative divisions, blocks, business circles and the like, which are common contour data, and gaps may exist between the contour data, however, in some application scenarios of the electronic map (for example, smart cities, city planning, traffic planning), a spatial analysis unit which takes spatially densely-paved contour data as a basis is required, and therefore gap filling processing needs to be performed on non-densely-paved contours with gaps, and there is no effective processing method for effective filling of vector contour gaps in the related art.
Disclosure of Invention
The embodiment of the application provides a contour processing method and device for an electronic map, electronic equipment and a computer-readable storage medium, which can effectively eliminate gaps between contours.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a contour processing method of an electronic map, which comprises the following steps:
identifying a plurality of first contours with gaps among the contours in the electronic map;
dividing the earth surface space comprising the plurality of first outlines and gaps among the plurality of first outlines to obtain a plurality of grids;
determining first outlines to which the grids belong respectively;
merging the meshes belonging to each first contour in the earth surface space, and replacing the corresponding first contour with a second contour obtained through merging;
and performing smoothing processing on each second contour, and replacing the corresponding second contour with a third contour obtained through the smoothing processing.
The embodiment of the application provides an outline processing device of an electronic map, comprising:
the electronic map processing device comprises an identification module, a processing module and a processing module, wherein the identification module is used for identifying a plurality of first outlines of an electronic map with gaps;
the grid attribution module is used for dividing the earth surface space comprising the plurality of first outlines and gaps among the plurality of first outlines to obtain a plurality of grids;
a grid attribution module, configured to determine first profiles to which the multiple grids are respectively attributed;
the grid merging module is used for merging the grids belonging to each first contour in the earth surface space and replacing the corresponding first contour with the second contour obtained through merging;
and the contour smoothing module is used for smoothing each second contour and replacing the corresponding second contour with a third contour obtained by the smoothing.
In the foregoing solution, the mesh attribution module is further configured to:
for each of the grids, performing the following:
determining that the mesh belongs to any one first contour when the mesh is completely inside the any one first contour or the mesh intersects only the any one first contour;
when the grid intersects with the plurality of first outlines, taking a first outline with the largest overlapping area with the grid as a belonging first outline;
when the grid and the plurality of first contours are not intersected, determining that the grid belongs to the first contour closest to the grid.
In the foregoing solution, the mesh merging module is further configured to:
traversing each of said first contours and performing the following for each mesh attributed to said first contour:
carrying out outward buffering treatment on the grids to obtain a plurality of expanded grids;
carrying out spatial combination processing on the multiple expansion grids to obtain combined outlines corresponding to the multiple expansion grids;
and carrying out inward buffering treatment on the merged contour to obtain a second contour corresponding to the first contour.
In the foregoing aspect, the contour smoothing module is further configured to:
extracting a plurality of cross nodes from the second contour to mark a state of each coordinate point on the second contour according to the plurality of cross nodes;
and reserving the coordinate points marked as the reserved state in each second contour as smooth coordinate points, and forming a third contour corresponding to the second contour according to the smooth coordinate points.
In the foregoing solution, when the number of the second contours is multiple, before the extracting multiple intersection nodes from the second contours, the contour smoothing module is further configured to:
when a second contour with the area smaller than an area threshold exists in the surface space, determining the second contour with the area smaller than the area threshold as a contour to be rejected, and executing the following processing aiming at the contour to be rejected:
determining a contour to be merged corresponding to the contour to be eliminated from the adjacent contours of the contour to be eliminated;
wherein the adjacent contour is a second contour which has a common edge with the contour to be eliminated in the surface space;
and carrying out space merging processing on the contour to be eliminated and the contour to be merged to obtain a merged second contour.
In the foregoing aspect, the contour smoothing module is further configured to:
determining an area of each adjacent profile of the second profile;
and determining the adjacent contour with the largest area as the contour to be merged corresponding to the contour to be eliminated.
In the foregoing aspect, the contour smoothing module is further configured to:
when the updating condition of the contour to be merged is met, merging the contour to be eliminated to the contour to be merged, and taking the obtained new contour to be merged as a merged second contour;
wherein the update condition comprises at least one of:
the area of the contour to be eliminated is smaller than that of the contour to be merged;
the population density of the grids attributed to the contours to be eliminated is less than that of the grids attributed to the contours to be merged;
the grade of the grid belonging to the contour to be eliminated is less than the grade of the grid belonging to the contour to be merged.
In the foregoing aspect, the contour smoothing module is further configured to:
when the updating condition of the contour to be merged is met, merging the contour space to be merged to the contour to be eliminated, and taking the obtained new contour to be eliminated as a merged second contour;
wherein the update condition includes at least one of
The area of the contour to be eliminated is not smaller than that of the contour to be merged;
the population density of the grids attributed to the contours to be eliminated is not less than that of the grids attributed to the contours to be merged;
the administrative level of the grid which belongs to the contour to be eliminated is not less than that of the grid which belongs to the contour to be merged.
In the foregoing aspect, the contour smoothing module is further configured to:
sampling a plurality of coordinate points from the second contour according to a fixed step length, and determining an adjacent contour of each coordinate point;
wherein the neighboring contour of the coordinate point is a second contour in the surface space except the sampled second contour, and a distance from the coordinate point is less than a distance threshold;
when the number of adjacent contours of the coordinate point is plural, the coordinate point is determined as a cross node, and the spatial position of the cross node is moved to a set of cross nodes.
In the foregoing aspect, the contour smoothing module is further configured to:
carrying out approximate processing adaptive to spatial precision on longitude data and latitude data of the cross nodes;
splicing the approximate processing result of the longitude data of the cross node and the approximate processing result of the latitude data of the cross node to obtain a character string of the cross node;
and moving the character string of the cross node to the cross node set.
In the foregoing aspect, the contour smoothing module is further configured to:
traversing each coordinate point of the second contour, and performing the following processing for the traversed coordinate point:
when the coordinate point is the cross node, marking the states of a former coordinate point of the coordinate point, the coordinate point and a latter coordinate point of the coordinate point as a reserved state;
when the coordinate point is not the cross node, marking the coordinate point and the state of the next coordinate point of the coordinate point as a reserved state according to the next coordinate point of the coordinate point;
and when the coordinate point and the next coordinate point of the coordinate point are not in the reserved state, marking the coordinate point and the midpoint of the next coordinate point of the coordinate point in the reserved state.
In the foregoing aspect, the contour smoothing module is further configured to:
when the next coordinate point of the coordinate points is the cross node, marking the coordinate points and the state of the next coordinate point of the coordinate points as a reserved state;
when the next coordinate point of the coordinate points is not the cross node and the cross node exists on a connecting line of the coordinate points and the next coordinate point of the coordinate points, marking the coordinate points and the state of the next coordinate point of the coordinate points as a reserved state;
in the foregoing solution, before the state of the coordinate point before the coordinate point, the coordinate point and the coordinate point after the coordinate point is marked as the retention state, the contour smoothing module is further configured to:
performing approximate processing adapted to the spatial precision on the longitude data and the latitude data of the coordinate point;
splicing the approximate processing result of the longitude data of the coordinate point and the approximate processing result of the latitude data of the coordinate point to obtain a character string of the coordinate point;
when a character string identical to the character string of the coordinate point exists in the cross node set, the coordinate point is determined as the cross node.
In the foregoing aspect, the contour smoothing module is further configured to:
traversing coordinate points marked as a retention state in the second contour, and executing the following processing aiming at the traversed coordinate points marked as the retention state:
when the same coordinate point as the coordinate point marked as the retention state exists in the smooth coordinate points in the second contour, updating the coordinate point marked as the retention state into a non-retention state;
when the same coordinate point as the coordinate point marked as the retention state does not exist in the smooth coordinate points in the second contour, retaining the coordinate point marked as the retention state.
An embodiment of the present application provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the contour processing method of the electronic map provided by the embodiment of the application when the executable instructions stored in the memory are executed.
The embodiment of the application provides a computer-readable storage medium, which stores executable instructions and is used for realizing the contour processing method of the electronic map provided by the embodiment of the application when being executed by a processor.
The embodiment of the application has the following beneficial effects:
the method comprises the steps of converting a proper amount of contours into grids belonging to different contours, merging the grids belonging to the same contour to obtain a merged seamless contour, accordingly, reasonably and densely paving and filling gaps among the contours based on the grids, smoothing the contours obtained based on the merging of the grids, effectively eliminating the sawtooth effect existing in the merging of the contours, and finally obtaining the smoothed seamless contour.
Drawings
FIGS. 1A-1B are schematic diagrams illustrating the effect of a contour processing method for an electronic map in the related art;
FIG. 2 is a schematic structural diagram of a contour processing system of an electronic map provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
4A-4D are schematic flow charts of a contour processing method for an electronic map provided by an embodiment of the present application;
fig. 5 is a schematic flowchart of a contour processing method of an electronic map according to an embodiment of the present application;
6A-6C are schematic diagrams illustrating the effect of the method for processing the contour of the electronic map according to the embodiment of the present application;
fig. 7A-7B are schematic diagrams illustrating a contour processing method for an electronic map according to an embodiment of the present disclosure.
Detailed Description
In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the attached drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, so as to enable the embodiments of the application described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) And (4) block: a Block (Block) refers to an area enclosed by roads of a certain grade, and may correspond to a traffic cell in traffic planning and management, and is often used as a basic space unit for analysis in research in the fields of city planning, traffic planning, and the like.
2) Union: the joint processing belongs to a space superposition analysis means, input polygons are superposed, and an output layer is all polygons of all original input layers.
3) The outward buffering process is equivalent to performing the expansion process on the contour by moving a point on the contour away from the center of the contour, with the center of the contour as the starting point of the direction line segment and a point on the contour as the ending point of the square line segment.
4) And performing inward buffering processing, wherein the center of the contour is taken as the end point of the direction line segment, the point on the contour is taken as the starting point of the direction line segment, and the point on the contour is moved to a distance close to the center of the contour.
The related technology provides an electronic map gap filling method based on iterative step expansion, and the specific method comprises the following steps: taking any distance as an initial expansion distance, carrying out iteration according to a certain step length, wherein the expansion distance of each iteration is the sum of the initial expansion distance plus the step length multiplied by the number of iteration rounds, and the iteration content is as follows: and sequentially carrying out expansion processing (outward buffering) on each surface contour in the surface contour set according to the expansion distance of the iteration, if the expanded surface contour is intersected with other adjacent surface contours, removing the intersected part of the expanded surface contour and the adjacent surface contour until the area of the gap surface of the whole map is less than a set threshold value, and finishing the iteration.
The electronic map gap filling method based on iterative step expansion in the related art has the following two problems:
1) in each iteration, the contours are expanded in sequence, so that the contours expanded first occupy a contour space more preferentially, that is, the slit regions are not the contours distributed equally to both sides of the slit, but are distributed more preferentially to the contours expanded first, as shown in fig. 1A, fig. 1A is an effect schematic diagram of a contour processing method of an electronic map in the related art, showing the position relationship between each contour and the slit before expansion processing, three surface contours A, B and C exist in fig. 1A, white regions E and D between the contours are the slits between the surface contours, natural water D, E exists between county administrative districts A, B, C as a partition, the contour slits between county administrative districts A, B, C (i.e., natural water of rivers) need to be filled, and when iteration, a is expanded first, fig. 1B obtained by performing dilation on a is a schematic diagram of an effect of a contour processing method of an electronic map in the related art, which shows a positional relationship between each contour and a gap after performing dilation, and it is seen that a country occupies a river water body part originally between a country and C country after dilation, and also occupies a part of a contour of C country (i.e., a shaded part in fig. 1B) outward, the shaded part which occupies the contour of C country is removed by a country, but a spatial range of E river is completely allocated to a country, and a spatial range of E river is supposed to be equally divided to a country and C country along a midline, and dilation is a destructive operation, and after a plurality of iterations of dilation, a contour shape is seriously deformed.
2) In the related art, the iteration stop condition of the electronic map gap filling method based on iteration step expansion is a gap surface area condition of an iteration stop threshold, gap surfaces still exist inevitably between contours after process processing, sufficient gap filling is not really realized, and in some spatial analysis scenes requiring contour dense paving, the gap surfaces still bring problems for analysis, for example, partial data fall in the gap surfaces, so that inaccurate results may appear in partial spatial analysis.
The embodiments of the present application provide a method and an apparatus for processing outlines of an electronic map, an electronic device and a computer-readable storage medium, which can effectively eliminate gaps between outlines. Next, an exemplary application when the electronic device is implemented as a terminal will be explained.
Referring to fig. 2, fig. 2 is a schematic structural diagram of an outline processing system of an electronic map provided in an embodiment of the present application, a terminal 400 is connected to a server 200 through a network 300, and the network 300 may be a wide area network or a local area network, or a combination of the two. The terminal 400 is configured to receive an original image with a gap and multiple contours (e.g., multiple neighborhoods) taken by a user, display the original image taken by the user on the graphical interface 410, the server 200 is configured to receive the original image with the gap and multiple contours (e.g., multiple neighborhoods) sent by the terminal 400, perform processing of removing the gap on the received image by using the contour processing method of the electronic map provided by the embodiment of the present application, obtain an image without the gap and including the multiple contours, return the image without the gap and including the multiple contours to the terminal 400, and perform subsequent spatial analysis by using the received image without the gap and including the multiple contours, so as to obtain an accurate spatial analysis result.
In some embodiments, the terminal 400 may implement the contour processing method of the electronic map provided by the embodiments of the present application by running a computer program, for example, the computer program may be a native program or a software module in an operating system; may be a local (Native) Application program (APP), i.e. a program that needs to be installed in an operating system to run, such as a game APP (i.e. the aforementioned graphical interface 410 of the game client); or may be an applet, i.e. a program that can be run only by downloading it to the browser environment; but also an applet that can be embedded into any APP. In general, the computer programs described above may be any form of application, module or plug-in.
The embodiments of the present application may be implemented by means of Cloud Technology (Cloud Technology), which refers to a hosting Technology for unifying series resources such as hardware, software, and network in a wide area network or a local area network to implement data calculation, storage, processing, and sharing. The cloud technology is a general term of network technology, information technology, integration technology, management platform technology, application technology and the like applied based on a cloud computing business model, can form a resource pool, is used as required, and is flexible and convenient. Cloud computing technology will become an important support. Background services of the technical network system require a large amount of computing and storage resources.
As an example, the server 200 may be an independent physical server, may be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform. The terminal 400 may be, but is not limited to, a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal 400 and the server 200 may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited thereto.
In some embodiments, the server 200 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform. The terminal 400 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiment of the present invention.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and a terminal 400 shown in fig. 3 includes: at least one processor 410, memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal 400 are coupled together by a bus system 440. It is understood that the bus system 440 is used to enable communications among the components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 440 in FIG. 3.
The Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 430 includes one or more output devices 431, including one or more speakers and/or one or more visual displays, that enable the presentation of media content. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. Memory 450 optionally includes one or more storage devices physically located remote from processor 410.
The memory 450 includes either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The memory 450 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, to support various operations, as exemplified below.
An operating system 451, including system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and handling hardware-based tasks;
a network communication module 452 for communicating to other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), etc.;
a presentation module 453 for enabling presentation of information (e.g., user interfaces for operating peripherals and displaying content and information) via one or more output devices 431 (e.g., display screens, speakers, etc.) associated with user interface 430;
an input processing module 454 for detecting one or more user inputs or interactions from one of the one or more input devices 432 and translating the detected inputs or interactions.
In some embodiments, the contour processing device of the electronic map provided by the embodiments of the present application may be implemented in software, and fig. 3 illustrates a contour processing device 455 of the electronic map stored in the memory 450, which may be software in the form of programs and plug-ins, and includes the following software modules: a recognition module 4551, a mesh attribution module 4552, a mesh merging module 4553 and a contour smoothing module 4554, which are logical and thus may be arbitrarily combined or further divided according to the functions implemented, and the functions of the respective modules will be described hereinafter.
Next, a method for processing the contour of the electronic map provided in the embodiment of the present application, which is executed by the terminal 400 in fig. 2, is described as an example. Referring to fig. 4A, fig. 4A is a schematic flowchart of an outline processing method of an electronic map provided in an embodiment of the present application, and will be described with reference to the steps shown in fig. 4A.
In step 101, a plurality of first contours having gaps between each other in an electronic map are identified.
As an example, a plurality of first contours with gaps between each other are identified from an electronic map as subsequent processing objects by using an image identification technology, the first contours may be contours of any objects, the objects may be sets, the size of the sets is determined according to the granularity of geographic information analysis in the actual application scene, the objects may also be a building, for example, a building, the first contours with different dimensions in the electronic map with different scales, for example, the first contours may be cities separated by different water areas (the cities may be regarded as a set), the first contours may be streets divided by different streets, and so on.
In step 102, a plurality of meshes are obtained by dividing a ground surface space including a plurality of first contours and gaps between the plurality of first contours.
For example, the applicant found that when the contour is taken as a processing object, the general method cannot adapt to the position relation of the contour gap with various types, resulting in failure to achieve complete de-gapping and resulting in failure of the gaps to be evenly adaptively assigned to adjacent contours, and therefore, with an undifferentiated mesh as a processing unit, can adapt to the position relation of the gaps of various profiles and can enable the gaps to be averagely and adaptively distributed to adjacent profiles, the surface space is divided in step 102, namely, the earth surface space is divided into grids, the grid side length d _ cell is a predefined parameter, and according to the grid side length d _ cell (the unit can be meters of a plane coordinate system or the degree of a geographic coordinate system), the whole earth surface space is divided into regular grids with specified side lengths, such as 10m grids, 0.0001 degree grids, and the like.
In step 103, first contours to which the meshes belong respectively are determined.
In some embodiments, referring to fig. 4B, fig. 4B is a schematic flowchart of an outline processing method of an electronic map provided in the embodiment of the present application, and the determining of the first outlines to which the multiple grids belong in step 103 may be implemented by steps 1031 and 1033 shown in fig. 4B.
For each mesh, the following processing is performed:
in step 1031, when the mesh is completely inside any one of the first contours or the mesh intersects only any one of the first contours, determining that the mesh belongs to any one of the first contours;
in step 1032, when the grid intersects with the plurality of first outlines, the first outline with the largest overlapping area with the grid is taken as the attributive first outline;
in step 1033, when the mesh does not intersect with any of the plurality of first contours, it is determined that the mesh belongs to the first contour that is closest in distance to the mesh.
As an example, referring to fig. 7A, fig. 7A is a schematic diagram of a contour processing method of an electronic map provided in an embodiment of the present application, and a plurality of first contours (contour a, contour B, contour C, and contour D) respectively corresponding to the first contours are determined for each mesh, as shown in fig. 7, gaps exist between the plurality of first contours shown in fig. 7A, and the plurality of first contours and the gaps shown in fig. 7A are divided into a plurality of meshes, and since mesh 1 is completely located in contour a, it is determined that mesh 1 belongs to contour a, since mesh 2 intersects only with contour a, mesh 2 belongs to contour a, since mesh 3 intersects with contour B and contour C, and the area where mesh 3 intersects with contour B is greater than the area where mesh 3 intersects with contour C, mesh 3 belongs to contour B, since mesh 4 does not intersect with any contour, at the gap, where the grid 4 has a distance to each of the contour a, the contour B, and the contour D, and the distance between the grid 4 and the contour a is the closest, the grid 4 belongs to the contour a.
In step 104, the meshes belonging to each first contour in the surface space are merged, and the second contour obtained by the merging replaces the corresponding first contour.
In some embodiments, referring to fig. 4C, fig. 4C is a flowchart of the method for processing the outlines of the electronic map provided in the embodiment of the present application, and the merging process of the grids attributed to each first outline in the surface space in step 104 can be implemented by step 1041 and step 1043 shown in fig. 4C.
Traversing each first contour and performing the following for each mesh attributed to the first contour:
in step 1041, the mesh is buffered outward to obtain a plurality of expanded meshes.
In step 1042, the multiple expanded meshes are spatially merged to obtain a merged contour corresponding to the multiple expanded meshes.
In step 1043, the merged contour is buffered inward to obtain a second contour corresponding to the first contour.
As an example, referring to fig. 7B, fig. 7B is a schematic diagram of a contour processing method of an electronic map provided in an embodiment of the present application, a basis for merging the first contour a in fig. 7A is all meshes belonging to the first contour, that is, the meshes shown in fig. 7B, each mesh in fig. 7B is subjected to outward buffering, and the outward buffering is typically performed by expanding outward by an enveloping circle for a certain distance to obtain a dilated mesh shown by a solid line in fig. 7B, an outward buffering distance d _ buffer is a predefined parameter, and typically the outward buffering distance d _ buffer is smaller than a mesh d _ cell, for example, when d _ cell is 10m, d _ buffer is set to 0.5m, and contours of all meshes are buffered outward for a distance d _ buffer (that is, a dilation distance d _ buffer); assuming that the number of the meshes belonging to the first contour is 10, performing Union spatial stacking analysis on the expanded meshes of the 10 meshes, that is, performing spatial merging processing, where the spatial merging processing is to retain and stack the expanded meshes to obtain merged contours, performing inward buffering processing on the contours after stacking analysis and merging, where an inward buffering distance d _ buffer (i.e., a contraction distance d _ buffer) may be the same as or different from an outward buffering distance d _ buffer, and performing appropriate expansion processing on each mesh to ensure that the meshes can be successfully merged.
In step 105, a smoothing process is performed on each second contour, and a third contour obtained by the smoothing process is substituted for the corresponding second contour.
In some embodiments, referring to fig. 4D, fig. 4D is a flowchart illustrating a method for processing an outline of an electronic map provided in the embodiment of the present application, and the step 105 of performing a smoothing process on each second outline may be implemented by the steps 1051 and 1052 illustrated in fig. 4D.
In step 1051, a plurality of intersection nodes are extracted from the second contour to mark a state of each coordinate point on the second contour according to the plurality of intersection nodes.
In some embodiments, when the number of the second contours is multiple, before the extracting of the plurality of intersection nodes from the second contours, the following technical solution may be further performed: when a second contour with the area smaller than the area threshold exists in the local table space, determining the second contour with the area smaller than the area threshold as a contour to be rejected, and executing the following processing aiming at the contour to be rejected: determining a contour to be merged corresponding to the contour to be eliminated from the adjacent contours of the contour to be eliminated; the adjacent contour is a second contour with a common edge between the surface space and the contour to be eliminated; and carrying out space merging processing on the contour to be eliminated and the contour to be merged to obtain a merged second contour.
As an example, the second contour obtained in step 104 is a contour obtained based on mesh merging, and therefore has a significant sawtooth characteristic, so that denoising processing is required.
In some embodiments, only one second contour can be obtained through step 104, and if only one second contour is obtained, the second contour is directly input to the contour smoothing module, and smoothing processing is performed on the second contour, so as to obtain a third contour for replacing the second contour.
In some embodiments, the determining of the to-be-merged contour corresponding to the contour to be removed from the neighboring contours of the second contour may be implemented by the following technical solutions: determining an area of each adjacent profile of the second profile; and determining the adjacent contour with the largest area as the contour to be merged corresponding to the contour to be eliminated.
As an example, if a plurality of second contours can be obtained through step 104, it is required to calculate a ratio of an area of each second contour to a total area (i.e., a sum of areas of each second contour), where an area ratio threshold t is a predefined parameter, e.g., t is 10%, all second contours with an area ratio lower than the threshold t are removed, for a certain contour to be removed, all contours adjacent to the contour to be removed are determined as adjacent contours of the contour to be removed, the adjacent contours are defined as "there is a common edge with the contour to be removed", an area of each adjacent contour is calculated, the adjacent contour with the largest area is used as a contour to be merged of the contour to be removed, and the contour to be removed and the contour to be merged are subjected to a spatial merging process similar to step 104 and merged into one contour.
In some embodiments, the spatial merging processing is performed on the contour to be removed and the contour to be merged to obtain the merged second contour, which may be implemented by the following technical solutions: when the updating condition of the contour to be merged is met, merging the contour to be eliminated to the contour to be merged, and taking the obtained new contour to be merged as a merged second contour; wherein the update condition includes at least one of: the area of the contour to be eliminated is smaller than that of the contour to be merged; the population density of the grids attributed to the contours to be rejected is less than the population density of the grids attributed to the contours to be merged; the level of the mesh attributed to the contour to be rejected is smaller than the level of the mesh attributed to the contour to be merged.
In some embodiments, the spatial merging processing is performed on the contour to be removed and the contour to be merged to obtain the merged second contour, which may be implemented by the following technical solutions: when the updating condition of the contour to be merged is met, merging the space of the contour to be merged into the contour to be eliminated, and taking the obtained new contour to be eliminated as a merged second contour; wherein the update condition includes at least one of: the area of the contour to be eliminated is not less than that of the contour to be merged; the population density of the grids attributed to the contours to be rejected is not less than the population density of the grids attributed to the contours to be merged; the administrative level of the grid attributed to the contour to be eliminated is not less than the administrative level of the grid attributed to the contour to be merged.
As an example, in order to perform denoising processing on the second contour output by step 104, the contour to be rejected and the contour to be rejected both belong to the second contour output by step 104, but there are two different merging manners, that is, merging the contour to be rejected and the contour to be merged into the contour to be rejected, or merging the contour to be rejected into the contour to be merged, assuming that the contour to be merged is an a contour and the contour to be rejected is a B contour, merging the contour to be merged B into the contour to be rejected a, which is equivalent to that the finally obtained merged second contour is a new contour to be rejected a, merging the contour to be rejected a into the contour to be merged B, which is equivalent to that the finally obtained merged second contour is a new contour to be merged B, and the face contours of both the new contour to be rejected a and the new contour to be merged B are the same, but the names of the two types of merging methods are different, the former is equivalent to that the contour B to be merged belongs to the new contour A to be eliminated, the latter is equivalent to that the contour A to be eliminated belongs to the new contour B to be merged, the standard of the merging method is selected whether to meet the updating condition, and the updating condition comprises at least one of the following conditions for the merging method of the contour to be merged into the contour to be eliminated: the area of the contour to be eliminated is not less than that of the contour to be merged; the population density of the grids attributed to the contours to be rejected is not less than the population density of the grids attributed to the contours to be merged; the administrative level of the grid belonging to the contour to be eliminated is not less than that of the grid belonging to the contour to be merged, and the method aims at a merging mode of merging the contour to be eliminated to the contour to be merged; the update condition includes at least one of: the area of the contour to be eliminated is smaller than that of the contour to be merged; the population density of the grids attributed to the contours to be rejected is less than the population density of the grids attributed to the contours to be merged; the level of the mesh attributed to the contour to be rejected is smaller than the level of the mesh attributed to the contour to be merged.
In some embodiments, the step 1051 of extracting a plurality of intersection nodes from the second contour may be implemented by the following technical solutions: sampling a plurality of coordinate points from the second contour according to a fixed step length, and determining an adjacent contour of each coordinate point; the adjacent contour of the coordinate point is a second contour in the earth surface space except the sampled second contour, and the distance between the second contour and the coordinate point is smaller than a distance threshold value; when the number of neighboring contours of the coordinate point is plural, the coordinate point is determined as a cross node, and the spatial position of the cross node is moved to the set of cross nodes.
As an example, the plurality of second contours in step 1051 are seamlessly adjacent to each other, so that for a certain second contour, its coordinate point is necessarily adjacent to at least one other contour (i.e. the adjacent contour, which does not include its own contour), some nodes may be adjacent to more than one other contour, this part of nodes is called cross nodes, in order to ensure the topology rationality, the cross nodes cannot be randomly discarded in the smoothing process, discarding cross nodes may cause a gap between the contours, the fixed step size may take different values according to the experimental scenario, and in some embodiments, the distance threshold may take zero, that is, it is characterized that the cross nodes are on at least three contours at the same time.
As an example, the above-mentioned embodiment of determining the neighboring contour of each coordinate point may adopt establishing a spatial index for the second contour output in step 104, the spatial index including, but not limited to, a quadtree, etc., for a certain second contour, traversing its coordinate points, for each coordinate point, searching in the spatial index according to its coordinate, finding the neighboring contour of the coordinate point.
In some embodiments, the moving the spatial position of the cross node to the cross node set may be implemented by the following technical solutions: carrying out approximate processing adaptive to spatial precision on longitude data and latitude data of the cross nodes; splicing the approximate processing result of the longitude data of the cross node and the approximate processing result of the latitude data of the cross node to obtain a character string of the cross node; and moving the character strings of the cross nodes to the cross node set.
For example, the longitude data and the latitude data of the cross node are x and y, respectively, and a set number of bits after taking a decimal point of the longitude data and the latitude data (for example, five bits after taking the decimal point, corresponding to a spatial precision of meter), and then the concatenation processing is performed to obtain a character string representing the spatial position of the cross node, and the obtained character string is added to a set, which may be a hash set, for example, for longitude 114.12960127 and latitude 40.38172864, five bits after taking the decimal point are concatenated to obtain a character string "114.12960 _ 40.38172".
In some embodiments, the above-mentioned marking the state of each coordinate point on the second contour according to a plurality of intersecting nodes may be implemented by the following technical solutions: traversing each coordinate point of the second contour, and executing the following processing for the traversed coordinate point: when the coordinate point is a cross node, marking the previous coordinate point of the coordinate point, the coordinate point and the next coordinate point of the coordinate point as a reserved state; when the coordinate point is not the cross node, marking the coordinate point and the state of the next coordinate point of the coordinate point as a reserved state according to the next coordinate point of the coordinate point; and when the coordinate point and the next coordinate point of the coordinate point are not in the reserved state, marking the coordinate point and the midpoint of the next coordinate point of the coordinate point as the reserved state.
In some embodiments, before marking the state of the coordinate point before the coordinate point, the coordinate point and the coordinate point after the coordinate point as the retention state, the following technical scheme may be further performed: carrying out approximate processing suitable for space precision on longitude data and latitude data of the coordinate points; splicing the approximate processing result of the longitude data of the coordinate point and the approximate processing result of the latitude data of the coordinate point to obtain a character string of the coordinate point; when a character string identical to the character string of the coordinate point exists in the cross node set, the coordinate point is determined as a cross node.
For example, the embodiment of the approximation processing adapted to the spatial precision is similar to the above-described embodiment, and the spatial precision may be the same as or different from the above-described spatial precision, and the longitude data and the latitude data of the cross node are x and y, respectively, and several bits after the decimal point of the longitude data and the latitude data are taken (for example, five bits after the decimal point, corresponding to the spatial precision of the meter level, where the number of the taken bits may be different from the above-described number of bits, but the number of the taken decimal points needs to be ensured to be equal to or greater than the number of the taken decimal points in the above-described approximation processing), and then the character string representing the spatial position of the cross node is obtained by.
As an example, for a certain second contour, traversing each coordinate point of the second contour, the traversed coordinate point being sampled according to the fixed step, traversing the coordinate points of the second contour in a determined order (which may be clockwise or counterclockwise), for each coordinate point, there are the following operations: marking the current coordinate point as PiExtracting its previous coordinate point Pi-1The latter coordinate point Pi+1Initializing three state values Si-1、Si、Si+1And i is an integer greater than or equal to 1, and represents the retention state of the current coordinate point, the retention state of the previous coordinate point and the retention state of the next coordinate point respectively, and the initial values are marked as non-retention states.
As an example, if the current point P isiReserving a previous coordinate point, a current coordinate point and a next coordinate point for a cross node, namely Si-1、Si、Si+1Are all marked as reserved. If the current coordinate point P isiIf the node is a non-crossed node, the current coordinate point P is further combined with the next coordinate pointiAnd the next coordinate point P of the coordinate pointsi+1Is marked as a retention state when the coordinate point P is locatediAnd the next coordinate point P of the coordinate pointsi+1When none of the coordinate points is marked as the reserved state, the coordinate point P is markediNext coordinate point P to coordinate pointi+1Is marked as the reserved state.
In some embodiments, the marking of the coordinate point and the state of the next coordinate point of the coordinate point as the retention state according to the next coordinate point of the coordinate point may be implemented by the following technical solutions: when the next coordinate point of the coordinate points is a cross node, marking the coordinate points and the state of the next coordinate point of the coordinate points as a reserved state; and when the next coordinate point of the coordinate point is not the cross node and the cross node exists on the connecting line of the coordinate point and the next coordinate point of the coordinate point, marking the coordinate point and the state of the next coordinate point of the coordinate point as a reserved state.
As an example, when a coordinate point is not a cross node, it is necessary to judge the next coordinate point Pi+1If the next coordinate point P is a cross node or noti+1If the current coordinate point P is a cross node, marking the current coordinate point and the next coordinate point as a reserved stateiAnd the next coordinate point Pi+1None is retained (neither the next coordinate point representing a coordinate point is a cross node), but from the current coordinate point PiAnd the next coordinate point Pi+1If the crossed point exists on the connected line segment, the current coordinate point P is reservediAnd the next coordinate point Pi+1Namely, the current coordinate point and the next coordinate point are marked as a reserved state.
In step 1052, the coordinate points marked as the retention state in each second contour are retained as smooth coordinate points, and a third contour corresponding to the second contour is formed from the smooth coordinate points.
In some embodiments, the step 1052 of reserving the coordinate points marked as the reserved state in each second contour as smooth coordinate points may be implemented by the following technical solutions: traversing coordinate points marked as a retention state in the second contour, and executing the following processing aiming at the traversed coordinate points marked as the retention state: comparing the coordinate points marked as the reserved state with the smooth coordinate points in the second contour; when the same coordinate point as the coordinate point marked as the retention state exists in the smooth coordinate points in the second contour, updating the coordinate point marked as the retention state into a non-retention state; when the same coordinate point as the coordinate point marked as the retention state does not exist in the smooth coordinate points in the second contour, the coordinate point marked as the retention state is retained.
As an example, in order to avoid adding a certain coordinate point repeatedly, the process of reserving as a smooth coordinate point is performed sequentially, each coordinate point is traversed in a clockwise or counterclockwise order, after the point is obtained as the reserved state according to the above embodiment, whether to reserve as a smooth point is determined, that is, whether the coordinate point marked as the reserved state is repeated with the existing smooth coordinate point is determined, a comprehensive determination can be made in the process of determining whether to repeat, that is, the coordinate point marked as the reserved state is compared with all existing smooth coordinate points, whether there is a repeated coordinate point, or only the coordinate point marked as the reserved state is compared with the last smooth coordinate point, since the last smooth coordinate point is the coordinate point closest to the geographical position of the coordinate point marked as the reserved state to be the smooth coordinate point, if there is no overlap between these two points, there is no overlap with the approximate rate of other smooth coordinate points, and therefore the above determination is necessary because there is an approximation between the determination targets, and if the accuracy is 4 bits after the decimal point, even if the subsequent data is different, in the adaptive scene of the spatial accuracy, the two points are represented as if the first four bits are the same, and the accuracy of the approximation processing taken in the process of determining the overlapping point may be the same as or different from the accuracy of the approximation processing in the above embodiment.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
The method comprises the steps that a display mode adjustment request of a user is received through an electronic map client, the electronic map client adjusts a map display mode into a seamless display mode in response to the display mode request, original map data are sent to a server, and the server conducts gap removing processing on a plurality of contours in the original map data through the contour processing method of the electronic map, so that densely paved contours are obtained and returned to the electronic map client to be displayed.
Referring to fig. 5, fig. 5 is an original schematic diagram of an outline processing apparatus of an electronic map provided in an embodiment of the present application, and the following modules in the outline processing apparatus are involved in the whole flow of an outline processing method of an electronic map provided in an embodiment of the present application: the grid attribution module, the grid merging module and the contour smoothing module are used for dividing the space of the electronic map into grids and attributing the grids to different blocks (first contours), so that gap-removing filling of the blocks with the grids as basic space units is achieved.
In some embodiments, the grid side length d _ cell is a predefined parameter, and according to the grid side length d _ cell (the unit of the variable length may be meters in a planar coordinate system or degrees in a geographic coordinate system), the whole earth surface space of the electronic map is divided into regular grids with specified side lengths, such as 10m grids, 0.0001 degree grids, and the like, and for each grid, a street region outline (a first outline) to which each grid belongs is calculated, and the specific attribution determination manner is as follows: if the grid is completely positioned inside the outline of a certain block, directly attributing the grid to the block; if the grid is intersected with one or more block profiles but is not completely positioned in one block, calculating the area of the overlapping part of the grid and each intersected block profile, and attributing the grid to the block with the largest overlapping area with the grid; if the grid is not intersected with any block, searching a block closest to the grid, and attributing the grid to the block; a mapping table of grids to blocks (first profile) can be obtained, where one grid can only belong to one block, but one block (first profile) can have one or more grids.
In some embodiments, the grid merging module is configured to merge several grids belonging to the same block (first profile) according to a grid-to-block mapping table, so as to generate a vector profile, which can represent the block profile (second profile) after the gap is removed.
In some embodiments, for a certain block (first contour), the contours of all grids belonging to the block are obtained according to the mapping table of the grids and the block, and are merged (Union) to obtain a merged contour, where the Union processing specifically includes: a) the outward buffering distance d _ buffer is a predefined parameter, and is usually smaller than the grid side length d _ cell, for example, when d _ cell is 10m, d _ buffer is set to 0.5m, and the outlines of all grids are buffered outward by the distance d _ buffer (i.e. the expansion distance d _ buffer); b) carrying out Union spatial superposition analysis on the mesh contour subjected to outward buffering; c) the combined contour is subjected to superposition analysis, and the distance d _ buffer is buffered inwards (namely the contraction distance d _ buffer); the purpose of steps a) and c) is to perform appropriate dilation on the meshes to ensure that the meshes can be successfully merged.
The contour obtained based on mesh merging has an obvious sawtooth characteristic, see fig. 6B, where fig. 6B is an effect schematic diagram of the contour processing method of the electronic map provided in the embodiment of the present application, and shows that the displayed contour data of the street block subjected to the seam removal processing has an obvious sawtooth effect, so that the mesh merging module needs to perform denoising processing.
In some embodiments, after the Union processing, one or more contours (second contours) may be obtained, if only one contour (second contour) is merged, the merged contour (second contour) is directly output without denoising processing, and if multiple contours exist after merging, a ratio of an area of each second contour to a total area (i.e., a sum of areas of each second contour) is calculated, an area ratio threshold t is a predefined parameter, for example, t is 10%, all second contours with an area ratio lower than the threshold t are rejected in a manner that: for a certain contour to be eliminated, all the contours adjacent to the contour to be eliminated are searched, which are called as adjacent contours, the adjacent definitions are that a common edge exists, the area of each adjacent contour is calculated, the contour with the largest area is selected as the contour to be merged, the contour to be eliminated and the contour to be merged are subjected to the Union processing as described above and are merged into a contour, the administrative division corresponding to the merged contour is the same as the contour to be merged, for example, the contour to be merged is a five-star block, and the merged contour is also the five-star block.
In some embodiments, after passing through the mesh merging module, the output second contours are seamlessly adjacent to each other, so that for a certain second contour, the coordinate point of the certain second contour is necessarily adjacent to at least one other contour (i.e., the adjacent contour, which does not include its own contour), some nodes may be adjacent to more than one other contour, these nodes are called cross nodes, which are important nodes, and cannot be optionally discarded in the smoothing process in order to ensure the topology rationality, otherwise, discarding the cross nodes may cause gaps between the contours, and the remaining nodes may determine whether to discard the nodes according to the relationship with the cross nodes.
In some embodiments, the step of specifically extracting the cross node includes: a) establishing a spatial index aiming at the plurality of second outlines output by the grid merging module, wherein the spatial index comprises but is not limited to an R tree, a quadtree and the like; b) initializing a hash set, wherein data stored in the set is a character string; c) for a certain contour, traversing the coordinate point of the contour, searching a spatial index by using the coordinate of each coordinate point, searching other contours (excluding the current contour) adjacent to the coordinate point, if the number of other contours adjacent to the coordinate point is greater than 1, that is, the coordinate point is an intersection of three or more contours, the coordinate point is a cross node, and if the longitude and the latitude of the point are respectively x and y, the coordinate point is spliced after taking a plurality of bits after a decimal point (for example, taking five bits after the decimal point, corresponding to the spatial precision of a meter), so as to obtain a character string representing the spatial position of the cross node, and adding the character string into a hash set, for example, regarding longitude 114.12960127 and latitude 40.38172864, taking five bits after the decimal point and splicing to obtain a character string "114.12960 _ 40.38172".
In some embodiments, for a second contour, a smoothed contour coordinate list is initialized, its coordinate points are traversed in a determined order (which may be clockwise or counterclockwise), and for each coordinate point the following operations are performed: a) marking the current coordinate point as PiExtracting its previous point Pi-1The latter point Pi+1Initialize three statesState value Si-1、Si、Si+1Respectively representing the retention state of the current coordinate point, the retention state of the previous coordinate point and the retention state of the next coordinate point, wherein the initial values are Boolean values false (indicating that retention is not performed); b) judging the current point PiWhether the coordinate point is a cross node or not is specifically determined by taking a plurality of bits after the decimal point in the same manner as the manner described above for the longitude and latitude of the point to obtain a character string representing the spatial position of the cross node, judging whether the character string is in a hash set or not, and if so, indicating that the current coordinate point is the cross node; c) if the current coordinate point P isiReserving a previous coordinate point, a current coordinate point and a next coordinate point for a cross node, namely Si-1、Si、Si+1Are all set to a boolean value true (indicating retention); d) if the current coordinate point P isiJudging the next coordinate point P for the non-crossed nodei+1If the next coordinate point P is a cross node or noti+1Is a cross node, and retains the current coordinate point and the next coordinate point, namely Si、Si+1Are all set to a Boolean value true; e) after the aforementioned determination and processing procedures, if the current coordinate point P is locatediAnd the next coordinate point Pi+1Are not reserved, i.e. Si、Si+1All of which are Boolean false, the current coordinate point P is checkediAnd the next coordinate point Pi+1If the cross point exists on the connected line segment, the current coordinate point and the next coordinate point are reserved, namely Si、Si+1Are all set to a Boolean value true; f) adding coordinate points needing to be reserved into a contour coordinate list, specifically comprising the following steps: 1. if the previous coordinate point is retained, Si-1Is a Boolean value true, and P is a valuei-1Adding the contour coordinates into the smoothed contour coordinate list; 2. if the current coordinate point is reserved, SiIs a Boolean value true, and P is a valueiAdding the contour coordinates into the smoothed contour coordinate list; 3. if the next coordinate point is retained, Si+1Is a Boolean value true, and P is a valuei+1Adding the contour coordinate into the smoothed contour coordinate list y; 4. if the current coordinate point is not reserved and the next coordinate point is not reserved, the step S is executediValue of (S)i+1All values of (are Boolean values fand (alse) keeping the middle point of a line segment formed by connecting the current coordinate point and the next coordinate point.
In some embodiments, to avoid adding a coordinate point repeatedly, before adding the coordinate point to the smoothed contour coordinate list, it is determined whether the coordinate point to be added is equal to the last coordinate in the smoothed contour coordinate list, or whether the coordinate point to be added is equal to all coordinates in the smoothed contour coordinate list, and if so, the coordinate point to be added is not added.
And (d) obtaining the contour coordinates after the contour is smoothed through the steps from a) to f), and traversing all the second contours by the same way to finish the smoothing of all the second contours.
The filling of the contour gap is realized by taking the grid as a basic unit, so that the accuracy, effectiveness and integrity of the contour gap filling are ensured, and the gap between contours is avoided; in order to eliminate the sawtooth problem caused by grid data vectorization brought by taking a grid as a basic unit, a smoothing algorithm is provided for densely paved contours, and compared with a common vector data smoothing algorithm (such as a Douglas Peucker algorithm), the algorithm has stronger pertinence, the invariance of important cross nodes is ensured, and the phenomenon that gaps occur again among contours due to smoothing operation is avoided.
In some embodiments, taking the gap filling of the block as an example, the block is an area obtained by cutting roads and naturally has gaps, however, in the analysis scenarios such as city planning and traffic planning, etc., the required block data may be spatially dense and seamless, assuming that the gap filling processing is performed on the block of jiangning district of south beijing, as shown in fig. 6A, fig. 6A is an originally input block profile, fig. 6B is a profile processed and output by a grid merging module, it can be seen that although the gap part between block profiles has been removed, because the profile is obtained based on grid merging, there is an obvious saw-tooth effect, fig. 6C is a basically available profile gap filling result obtained after the processing by a profile smoothing module, and by the method for processing the profile of the electronic map provided by the embodiments of the present application, the effective gap removing processing of the profile can be realized, and (5) producing a densely paved seamless outline data result.
Continuing with the exemplary structure of the electronic map contour processing device 455 implemented as software modules provided in the embodiments of the present application, in some embodiments, as shown in fig. 3, the software modules stored in the electronic map contour processing device 455 of the memory 450 may include: an identifying module 4551, configured to identify a plurality of first contours in the electronic map, where a gap exists between the first contours and the second contours; a grid attribution module 4552, configured to divide a ground surface space including a plurality of first contours and gaps between the plurality of first contours to obtain a plurality of grids; a grid attribution module 4552 configured to determine first outlines to which a plurality of grids are respectively attributed; a mesh merging module 4553, configured to merge meshes belonging to each first contour in the surface space, and replace a corresponding first contour with a second contour obtained through the merging; and a contour smoothing module 4554, configured to perform smoothing processing on each second contour, and replace the corresponding second contour with a third contour obtained through the smoothing processing.
In some embodiments, the mesh attribution module 4552 is further configured to: for each mesh, the following processing is performed: when the grid is completely positioned in any one first contour or the grid only intersects any one first contour, determining that the grid belongs to any one first contour; when the grid is intersected with the plurality of first outlines, the first outline with the largest overlapping area with the grid is taken as a belonging first outline; and when the grid and the plurality of first contours are not intersected, determining that the grid belongs to the first contour closest to the grid.
In some embodiments, the grid merging module 4553 is further configured to: traversing each first contour and performing the following for each mesh attributed to the first contour: carrying out outward buffering treatment on the grids to obtain a plurality of expanded grids; carrying out spatial combination processing on the multiple expansion grids to obtain combined outlines corresponding to the multiple expansion grids; and carrying out inward buffering treatment on the combined contour to obtain a second contour corresponding to the first contour.
In some embodiments, the contour smoothing module 4554 is further configured to: extracting a plurality of cross nodes from the second contour to mark a state of each coordinate point on the second contour according to the plurality of cross nodes; and reserving the coordinate points marked as the reserved state in each second contour as smooth coordinate points, and forming a third contour corresponding to the second contour according to the smooth coordinate points.
In some embodiments, when the number of the second contours is multiple, before extracting the multiple intersection nodes from the second contours, the contour smoothing module 4554 is further configured to: when a second contour with the area smaller than the area threshold exists in the local table space, determining the second contour with the area smaller than the area threshold as a contour to be rejected, and executing the following processing aiming at the contour to be rejected: determining a contour to be merged corresponding to the contour to be eliminated from the adjacent contours of the contour to be eliminated; the adjacent contour is a second contour with a common edge between the surface space and the contour to be eliminated; and carrying out space merging processing on the contour to be eliminated and the contour to be merged to obtain a merged second contour.
In some embodiments, the contour smoothing module 4554 is further configured to: determining an area of each adjacent profile of the second profile; and determining the adjacent contour with the largest area as the contour to be merged corresponding to the contour to be eliminated.
In some embodiments, the contour smoothing module 4554 is further configured to: when the updating condition of the contour to be merged is met, merging the contour to be eliminated to the contour to be merged, and taking the obtained new contour to be merged as a merged second contour; wherein the update condition includes at least one of: the area of the contour to be eliminated is smaller than that of the contour to be merged; the population density of the grids attributed to the contours to be rejected is less than the population density of the grids attributed to the contours to be merged; the level of the mesh attributed to the contour to be rejected is smaller than the level of the mesh attributed to the contour to be merged.
In some embodiments, the contour smoothing module 4554 is further configured to: when the updating condition of the contour to be merged is met, merging the space of the contour to be merged into the contour to be eliminated, and taking the obtained new contour to be eliminated as a merged second contour; wherein, the updating condition comprises that the area of at least one contour to be removed is not less than the area of the contour to be merged; the population density of the grids attributed to the contours to be rejected is not less than the population density of the grids attributed to the contours to be merged; the administrative level of the grid attributed to the contour to be eliminated is not less than the administrative level of the grid attributed to the contour to be merged.
In some embodiments, the contour smoothing module 4554 is further configured to: sampling a plurality of coordinate points from the second contour according to a fixed step length, and determining an adjacent contour of each coordinate point; the adjacent contour of the coordinate point is a second contour in the earth surface space except the sampled second contour, and the distance between the second contour and the coordinate point is smaller than a distance threshold value; when the number of neighboring contours of the coordinate point is plural, the coordinate point is determined as a cross node, and the spatial position of the cross node is moved to the set of cross nodes.
In some embodiments, the contour smoothing module 4554 is further configured to: carrying out approximate processing adaptive to spatial precision on longitude data and latitude data of the cross nodes; splicing the approximate processing result of the longitude data of the cross node and the approximate processing result of the latitude data of the cross node to obtain a character string of the cross node; and moving the character strings of the cross nodes to the cross node set.
In some embodiments, the contour smoothing module 4554 is further configured to: traversing each coordinate point of the second contour, and executing the following processing for the traversed coordinate point: when the coordinate point is a cross node, marking the previous coordinate point of the coordinate point, the coordinate point and the next coordinate point of the coordinate point as a reserved state; when the coordinate point is not the cross node, marking the coordinate point and the state of the next coordinate point of the coordinate point as a reserved state according to the next coordinate point of the coordinate point; and when the coordinate point and the next coordinate point of the coordinate point are not in the reserved state, marking the coordinate point and the midpoint of the next coordinate point of the coordinate point as the reserved state.
In some embodiments, the contour smoothing module 4554 is further configured to: when the next coordinate point of the coordinate points is a cross node, marking the coordinate points and the state of the next coordinate point of the coordinate points as a reserved state; when the next coordinate point of the coordinate point is not a cross node and the cross node exists on a connecting line of the coordinate point and the next coordinate point of the coordinate point, marking the coordinate point and the state of the next coordinate point of the coordinate point as a reserved state;
in some embodiments, before marking the state of the coordinate point before the coordinate point, the coordinate point and the coordinate point after the coordinate point as the retention state, the contour smoothing module 4554 is further configured to: carrying out approximate processing suitable for space precision on longitude data and latitude data of the coordinate points; splicing the approximate processing result of the longitude data of the coordinate point and the approximate processing result of the latitude data of the coordinate point to obtain a character string of the coordinate point; when a character string identical to the character string of the coordinate point exists in the cross node set, the coordinate point is determined as a cross node.
In some embodiments, the contour smoothing module 4554 is further configured to: traversing coordinate points marked as a retention state in the second contour, and executing the following processing aiming at the traversed coordinate points marked as the retention state: when the same coordinate point as the coordinate point marked as the retention state exists in the smooth coordinate points in the second contour, updating the coordinate point marked as the retention state into a non-retention state; when the same coordinate point as the coordinate point marked as the retention state does not exist in the smooth coordinate points in the second contour, the coordinate point marked as the retention state is retained.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the contour processing method of the electronic map described in the embodiment of the present application.
The embodiment of the application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored, and when being executed by a processor, the executable instructions cause the processor to execute the contour processing method of the electronic map provided by the embodiment of the application, for example, the contour processing method of the electronic map shown in fig. 4A-4D.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In summary, according to the embodiments of the present application, a proper amount of contours are converted into meshes belonging to different contours, and then the meshes belonging to the same contour are merged to obtain a merged seamless contour, so that reasonable dense-paving filling of gaps between contours is realized based on the meshes, and then the contours obtained based on the merging of the meshes are subjected to smoothing processing, thereby effectively eliminating a saw-tooth effect existing in the merging of the contours, and finally obtaining the smoothed seamless contour.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (15)

1. An outline processing method of an electronic map is characterized by comprising the following steps:
identifying a plurality of first contours with gaps among the contours in the electronic map;
dividing the earth surface space comprising the plurality of first outlines and gaps among the plurality of first outlines to obtain a plurality of grids;
determining first outlines to which the grids belong respectively;
merging the meshes belonging to each first contour in the earth surface space, and replacing the corresponding first contour with a second contour obtained through merging;
and performing smoothing processing on each second contour, and replacing the corresponding second contour with a third contour obtained through the smoothing processing.
2. The method of claim 1, wherein determining the first profile to which the plurality of meshes respectively belong comprises:
for each of the grids, performing the following:
determining that the mesh belongs to any one first contour when the mesh is completely inside the any one first contour or the mesh intersects only the any one first contour;
when the grid intersects with the plurality of first outlines, taking a first outline with the largest overlapping area with the grid as a belonging first outline;
when the grid and the plurality of first contours are not intersected, determining that the grid belongs to the first contour closest to the grid.
3. The method according to claim 1 or 2, wherein the merging the meshes belonging to each first contour in the surface space comprises:
traversing each of said first contours and performing the following for each mesh attributed to said first contour:
carrying out outward buffering treatment on the grids to obtain a plurality of expanded grids;
merging the multiple expansion grids to obtain merged contours corresponding to the multiple expansion grids;
and carrying out inward buffering treatment on the merged contour to obtain a second contour corresponding to the first contour.
4. The method of claim 3, wherein said smoothing for each of said second contours comprises:
extracting a plurality of cross nodes from the second contour to mark a state of each coordinate point on the second contour according to the plurality of cross nodes;
and reserving the coordinate points marked as the reserved state in each second contour as smooth coordinate points, and forming a third contour corresponding to the second contour according to the smooth coordinate points.
5. The method of claim 4, wherein when the number of the second contours is plural, before the extracting the plurality of intersection nodes from the second contours, the method further comprises:
when a second contour with the area smaller than an area threshold exists in the surface space, determining the second contour with the area smaller than the area threshold as a contour to be rejected, and executing the following processing aiming at the contour to be rejected:
determining a contour to be merged corresponding to the contour to be eliminated from the adjacent contours of the contour to be eliminated;
wherein the adjacent contour is a second contour which has a common edge with the contour to be eliminated in the surface space;
and combining the contour to be eliminated and the contour to be merged to obtain a combined second contour.
6. The method according to claim 5, wherein said determining a contour to be merged corresponding to said contour to be culled from among neighboring contours of said second contour comprises:
determining an area of each adjacent profile of the second profile;
and determining the adjacent contour with the largest area as the contour to be merged corresponding to the contour to be eliminated.
7. The method of claim 4, wherein said extracting a plurality of intersection nodes from said second contour comprises:
sampling a plurality of coordinate points from the second contour according to a fixed step length, and determining an adjacent contour of each coordinate point;
wherein the neighboring contour of the coordinate point is a second contour in the surface space except the sampled second contour, and a distance from the coordinate point is less than a distance threshold;
when the number of adjacent contours of the coordinate point is plural, the coordinate point is determined as a cross node, and the spatial position of the cross node is moved to a set of cross nodes.
8. The method of claim 7, wherein the moving the spatial location of the cross node to a set of cross nodes comprises:
carrying out approximate processing adaptive to spatial precision on longitude data and latitude data of the cross nodes;
splicing the approximate processing result of the longitude data of the cross node and the approximate processing result of the latitude data of the cross node to obtain a character string of the cross node;
and moving the character string of the cross node to the cross node set.
9. The method of claim 7, wherein said marking a state of each coordinate point on said second contour according to said plurality of intersection nodes comprises:
traversing each coordinate point of the second contour, and performing the following processing for the traversed coordinate point:
when the coordinate point is the cross node, marking the states of a former coordinate point of the coordinate point, the coordinate point and a latter coordinate point of the coordinate point as a reserved state;
when the coordinate point is not the cross node, marking the coordinate point and the state of the next coordinate point of the coordinate point as a reserved state according to the next coordinate point of the coordinate point;
and when the coordinate point and the next coordinate point of the coordinate point are not in the reserved state, marking the coordinate point and the midpoint of the next coordinate point of the coordinate point in the reserved state.
10. The method of claim 9, wherein said marking the coordinate point and the state of the coordinate point next to the coordinate point as a retained state based on the coordinate point next to the coordinate point comprises:
when the next coordinate point of the coordinate points is the cross node, marking the coordinate points and the state of the next coordinate point of the coordinate points as a reserved state;
and when the next coordinate point of the coordinate points is not the cross node and the cross node exists on a connecting line of the coordinate points and the next coordinate point of the coordinate points, marking the coordinate points and the state of the next coordinate point of the coordinate points as a reserved state.
11. The method of claim 9, wherein before the marking the state of the coordinate point immediately preceding the coordinate point, the coordinate point and the coordinate point immediately succeeding the coordinate point as the retention state, the method further comprises:
performing approximate processing adapted to the spatial precision on the longitude data and the latitude data of the coordinate point;
splicing the approximate processing result of the longitude data of the coordinate point and the approximate processing result of the latitude data of the coordinate point to obtain a character string of the coordinate point;
when a character string identical to the character string of the coordinate point exists in the cross node set, the coordinate point is determined as the cross node.
12. The method of claim 9, wherein the retaining the coordinate points marked as the retained state in each second contour as smooth coordinate points comprises:
traversing coordinate points marked as a retention state in the second contour, and executing the following processing aiming at the traversed coordinate points marked as the retention state:
when the same coordinate point as the coordinate point marked as the retention state exists in the smooth coordinate points in the second contour, updating the coordinate point marked as the retention state into a non-retention state;
when the same coordinate point as the coordinate point marked as the retention state does not exist in the smooth coordinate points in the second contour, retaining the coordinate point marked as the retention state.
13. An outline processing device of an electronic map, comprising:
the electronic map processing device comprises an identification module, a processing module and a processing module, wherein the identification module is used for identifying a plurality of first outlines of an electronic map with gaps;
the grid attribution module is used for dividing the earth surface space comprising the plurality of first outlines and gaps among the plurality of first outlines to obtain a plurality of grids;
the grid attribution module is further configured to determine first profiles to which the multiple grids are respectively attributed;
the grid merging module is used for merging the grids belonging to each first contour in the earth surface space and replacing the corresponding first contour with the second contour obtained through merging;
and the contour smoothing module is used for smoothing each second contour and replacing the corresponding second contour with a third contour obtained by the smoothing.
14. An electronic device, comprising:
a memory for storing executable instructions;
a processor for implementing the method of processing the contour of the electronic map according to any one of claims 1 to 12 when executing the executable instructions stored in the memory.
15. A computer-readable storage medium storing executable instructions for implementing the contour processing method of the electronic map according to any one of claims 1 to 12 when executed by a processor.
CN202011223550.1A 2020-11-05 2020-11-05 Contour processing method and device of electronic map and electronic equipment Active CN112215864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011223550.1A CN112215864B (en) 2020-11-05 2020-11-05 Contour processing method and device of electronic map and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011223550.1A CN112215864B (en) 2020-11-05 2020-11-05 Contour processing method and device of electronic map and electronic equipment

Publications (2)

Publication Number Publication Date
CN112215864A true CN112215864A (en) 2021-01-12
CN112215864B CN112215864B (en) 2022-08-30

Family

ID=74058351

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011223550.1A Active CN112215864B (en) 2020-11-05 2020-11-05 Contour processing method and device of electronic map and electronic equipment

Country Status (1)

Country Link
CN (1) CN112215864B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113487523A (en) * 2021-09-08 2021-10-08 腾讯科技(深圳)有限公司 Method and device for optimizing graph contour, computer equipment and storage medium
CN114357062A (en) * 2021-04-22 2022-04-15 星杓(成都)信息科技有限公司 Vector data overlapping or gap checking method based on space position segmentation

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8422782B1 (en) * 2010-09-30 2013-04-16 A9.Com, Inc. Contour detection and image classification
CN109359170A (en) * 2018-11-02 2019-02-19 百度在线网络技术(北京)有限公司 Method and apparatus for generating information
CN109933638A (en) * 2019-03-19 2019-06-25 腾讯科技(深圳)有限公司 Method, apparatus and storage medium are determined based on the target area profile of electronic map
CN110428386A (en) * 2019-06-25 2019-11-08 口口相传(北京)网络技术有限公司 Map grid merging method, device, storage medium, electronic device
CN111104933A (en) * 2020-03-20 2020-05-05 深圳飞科机器人有限公司 Map processing method, mobile robot, and computer-readable storage medium
CN111768468A (en) * 2020-06-30 2020-10-13 北京百度网讯科技有限公司 Image filling method, device, equipment and storage medium
CN111862125A (en) * 2019-04-28 2020-10-30 株式会社理光 Contour segmentation method and device and computer readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8422782B1 (en) * 2010-09-30 2013-04-16 A9.Com, Inc. Contour detection and image classification
CN109359170A (en) * 2018-11-02 2019-02-19 百度在线网络技术(北京)有限公司 Method and apparatus for generating information
CN109933638A (en) * 2019-03-19 2019-06-25 腾讯科技(深圳)有限公司 Method, apparatus and storage medium are determined based on the target area profile of electronic map
CN111862125A (en) * 2019-04-28 2020-10-30 株式会社理光 Contour segmentation method and device and computer readable storage medium
CN110428386A (en) * 2019-06-25 2019-11-08 口口相传(北京)网络技术有限公司 Map grid merging method, device, storage medium, electronic device
CN111104933A (en) * 2020-03-20 2020-05-05 深圳飞科机器人有限公司 Map processing method, mobile robot, and computer-readable storage medium
CN111768468A (en) * 2020-06-30 2020-10-13 北京百度网讯科技有限公司 Image filling method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114357062A (en) * 2021-04-22 2022-04-15 星杓(成都)信息科技有限公司 Vector data overlapping or gap checking method based on space position segmentation
CN113487523A (en) * 2021-09-08 2021-10-08 腾讯科技(深圳)有限公司 Method and device for optimizing graph contour, computer equipment and storage medium
CN113487523B (en) * 2021-09-08 2021-12-07 腾讯科技(深圳)有限公司 Method and device for optimizing graph contour, computer equipment and storage medium

Also Published As

Publication number Publication date
CN112215864B (en) 2022-08-30

Similar Documents

Publication Publication Date Title
Dadaxodjayev et al. Creating a road database using gis software
CN112233240B (en) Three-dimensional vector data slicing method and device of three-dimensional vector map and electronic equipment
CN112784002B (en) Virtual scene generation method, device, equipment and storage medium
CN112215864B (en) Contour processing method and device of electronic map and electronic equipment
TW201107719A (en) Realigning road networks in a digital map based on reliable road existence probability data
CN107564077B (en) method and device for drawing road network
Tucci et al. Using spatial analysis and geovisualization to reveal urban changes: Milan, Italy, 1737–2005
CN112395383B (en) Population data spatialization method, device and equipment based on multi-source information fusion
CN104102637A (en) Method and device for generating hot spot region
CN109992640A (en) Determination method and device, equipment and the storage medium of position grid
CN113988677A (en) Integrated city planning decision support system based on smart city planning
CN113761093A (en) Method and device for determining space binary group, computer equipment and storage medium
US10067950B1 (en) Systems and methods for efficiently organizing map styling information
CN111985014A (en) Modeling method and system based on standard atlas
CN115757674A (en) Map processing method, map processing device, map processing equipment and storage medium
CN114238528A (en) Map loading method and device, electronic equipment and storage medium
CN114254060A (en) Space matching method and system for urban road and public transport line
CN114528305A (en) Vector data updating range determining method and device, electronic equipment and storage medium
CN114329058A (en) Image gathering method and device and electronic equipment
CN110489510B (en) Road data processing method and device, readable storage medium and computer equipment
CN111914039B (en) Road network updating method and device
Šuba Design and development of a system for vario-scale maps
CN103186709B (en) A kind of method and system determining risk value of security incident
CN113468198B (en) Map updating method and device, electronic equipment and medium
Zhang et al. A polygonal buildings aggregation method considering obstacle elements and visual clarity

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40037822

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant