Data processing method and device, equipment, storage medium and program product
By constructing a map-level snapper and a minimum bounding sphere for tile grids, the problem of snapping operation latency in large-scale data processing on GIS platforms was solved, achieving efficient data snapping operations and meeting real-time business needs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NAVINFO
- Filing Date
- 2025-11-27
- Publication Date
- 2026-04-21
AI Technical Summary
Existing GIS platforms suffer from high spatial index reconstruction costs and unreasonable allocation of computing resources when processing large-scale data, resulting in significant delays in snapping operations and making it difficult to meet real-time business needs.
By constructing snappers corresponding to each map level and configuring snapping rules, and combining this with the construction of the minimum bounding sphere of the tile grid, the effective spatial snapping range is defined, enabling precise filtering and snapping of features in map data and improving the efficiency of data snapping operations.
It enables precise filtering and snapping of elements in map data, improves the efficiency of data snapping operations, and meets the needs of real-time business scenarios.
Smart Images

Figure CN121900672A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic map technology, and in particular to a data processing method, apparatus, device, storage medium, and program product. Background Technology
[0002] Geographic Information System (GIS) data production in map data is widely used in fields such as map making, road design, urban planning, and traffic management. Its core requirement is to achieve precise alignment of spatial relationships between geographic elements through interactive GIS data processing. For example, in road design, it is necessary to precisely align the center line of the lane with the road boundary line; when marking traffic facilities, it is necessary to ensure the accurate matching of traffic lights with intersection locations.
[0003] Based on the existing GIS platform's snap-in function, the screen coordinates are transformed by listening to user interactions, and the snap-in target is quickly retrieved and visual feedback is provided by combining spatial indexes.
[0004] However, in the above methods, when processing large-scale data, the high cost of spatial index reconstruction and unreasonable allocation of computing resources lead to significant delays in the adsorption operation, making it difficult to meet real-time business needs. Summary of the Invention
[0005] This application provides data processing methods, apparatus, devices, storage media, and program products to improve the efficiency of data adsorption operations and meet the needs of real-time business scenarios.
[0006] In a first aspect, embodiments of this application provide a data processing method, including:
[0007] In response to a selection operation on map data in the display interface, a target tile grid corresponding to the target location indicated by the selection operation is determined; wherein the map data includes at least one feature in at least one tile grid;
[0008] Based on the coordinate information of the target tile mesh, construct the minimum bounding sphere corresponding to the target tile mesh;
[0009] Based on the minimum bounding sphere and the snapping rules of the snappers corresponding to each map level in the target tile grid, the target features in the target tile grid are determined;
[0010] The target element is highlighted.
[0011] In one possible implementation, determining the target features in the target tile grid based on the snapping rules of the snapper corresponding to each map level in the target tile grid includes:
[0012] Based on the real-time position of the target viewpoint and the minimum bounding sphere, determine the coordinate information of the hexahedron corresponding to the target tile mesh; wherein, the hexahedron is the hexahedron intercepted by the intersection between the view frustum formed by the target viewpoint facing the target position and the minimum bounding sphere of the target tile mesh;
[0013] Based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron, the target features are selected from the hexahedron.
[0014] In one possible implementation, determining the coordinate information of the hexahedron corresponding to the target tile mesh based on the real-time position of the target viewpoint and the minimum bounding sphere includes:
[0015] Construct a projection ray from the real-time position of the target viewpoint to the target position;
[0016] The first cross section and the second cross section are generated based on the parametric equation of the projected ray and the spherical equation of the minimum enclosing sphere.
[0017] Based on the distance between the real-time position of the target viewpoint and the first cross-section, and the distance between the real-time position of the target viewpoint and the second cross-section, the width and height of the second cross-section, as well as its planar dimensions in the spatial coordinate system, are determined.
[0018] The coordinate information of the hexahedron is determined based on the width and height of the second cross-section and its planar dimensions in the spatial coordinate system.
[0019] In one possible implementation, the step of filtering the target features from the hexahedron based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron includes:
[0020] Based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron, at least one element to be snapped is selected from the hexahedron;
[0021] Based on the coordinate information of the hexahedron, determine the distances between the element to be adsorbed and each boundary of the hexahedron;
[0022] Based on the distances corresponding to the at least one element to be adsorbed, at least one candidate element is determined from the at least one element to be adsorbed;
[0023] The target element is determined based on the distance between the at least one candidate element and the target viewpoint.
[0024] In one possible implementation, determining at least one candidate element from the at least one element to be adsorbed based on the distances corresponding to the at least one element to be adsorbed includes:
[0025] Determine the minimum distance among all distances corresponding to the element to be adsorbed;
[0026] If it is determined that the minimum distance corresponding to the element to be adsorbed is less than or equal to a preset tolerance, and / or, if it is determined that the spatial angle between the element to be adsorbed and the projection ray is less than or equal to a preset angle, then the element to be adsorbed is determined to be the candidate element; wherein, the projection ray is the projection ray from the real-time position of the target viewpoint to the target position; the preset tolerance is determined based on the corresponding adsorption rule.
[0027] In one possible implementation, constructing the minimum bounding sphere corresponding to the target tile mesh based on the coordinate information of the target tile mesh includes:
[0028] Based on the coordinate information of the target tile mesh, the bounding box information of the target tile mesh is determined; wherein, the bounding box information includes the geometric center and maximum spatial span of the tile mesh bounding box;
[0029] Based on the bounding box information of the target tile mesh, construct the minimum enclosing sphere corresponding to the target tile mesh.
[0030] In one possible implementation, determining the target tile grid corresponding to the target location indicated by the selection operation in response to a selection operation on map data in the display interface includes:
[0031] In response to a selection operation on map data in the display interface, the pixel coordinates of the target location indicated by the selection operation are determined;
[0032] The pixel coordinates are mapped to geographic information coordinates; and the target tile grid corresponding to the geographic information coordinates is obtained.
[0033] In one possible implementation, the snapping rules include, but are not limited to, one or more of the following: feature snapper name, map level, snapper category, map grade, non-snap map data, and priority.
[0034] Secondly, embodiments of this application provide a data processing apparatus, including:
[0035] The first determining module is configured to, in response to a selection operation on map data in the display interface, determine the target tile grid corresponding to the target location indicated by the selection operation; wherein the map data includes at least one feature in at least one tile grid;
[0036] A construction module is used to construct the minimum bounding sphere corresponding to the target tile mesh based on the coordinate information of the target tile mesh;
[0037] The second determining module is used to determine the target features in the target tile grid based on the minimum outer sphere and the snapping rules of the snapper corresponding to each map level in the target tile grid;
[0038] The feedback module is used to highlight the target elements.
[0039] In one possible implementation, the second determining module is specifically used to: determine the coordinate information of the hexahedron corresponding to the target tile grid based on the real-time position of the target viewpoint and the minimum bounding sphere; wherein, the hexahedron is the hexahedron intercepted by the intersection of the view frustum formed by the target viewpoint facing the target position and the minimum bounding sphere of the target tile grid; and filter out the target element from the hexahedron based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron.
[0040] In one possible implementation, the second determining module is specifically configured to: construct a projection ray pointing from the real-time position of the target viewpoint to the target position; generate a first cross-section and a second cross-section based on the parametric equation of the projection ray and the spherical equation of the minimum enclosing sphere; determine the width and height of the second cross-section, and its planar dimensions in a spatial coordinate system, based on the distance between the real-time position of the target viewpoint and the first cross-section, and the distance between the real-time position of the target viewpoint and the second cross-section; and determine the coordinate information of the hexahedron based on the width and height of the second cross-section and its planar dimensions in a spatial coordinate system.
[0041] In one possible implementation, the second determining module is specifically configured to: filter at least one element to be snapped from the hexahedron according to the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron; determine the distance between the element to be snapped and each boundary of the hexahedron according to the coordinate information of the hexahedron; determine at least one candidate element from the at least one element to be snapped according to the distances corresponding to the at least one element to be snapped; and determine the target element according to the distance between the at least one candidate element and the target viewpoint.
[0042] In one possible implementation, the second determining module is specifically used to: determine the minimum distance among all distances corresponding to the element to be adsorbed; if the minimum distance corresponding to the element to be adsorbed is determined to be less than or equal to a preset tolerance, and / or, if the spatial angle between the element to be adsorbed and the projection ray is determined to be less than or equal to a preset angle, then the element to be adsorbed is determined to be the candidate element; wherein, the projection ray is the projection ray from the real-time position of the target viewpoint to the target position; the preset tolerance is determined based on the corresponding adsorption rule.
[0043] In one possible implementation, the construction module is specifically used to: determine the bounding box information of the target tile mesh based on the coordinate information of the target tile mesh; wherein the bounding box information includes the geometric center and maximum spatial span of the tile mesh bounding box; and construct the minimum enclosing sphere corresponding to the target tile mesh based on the bounding box information of the target tile mesh.
[0044] In one possible implementation, the first determining module is specifically configured to: in response to a selection operation on map data in the display interface, determine the pixel coordinates of the target location indicated by the selection operation; map the pixel coordinates to geographic information coordinates; and obtain the target tile grid corresponding to the geographic information coordinates.
[0045] In one possible implementation, the snapping rules include, but are not limited to, one or more of the following: feature snapper name, map level, snapper category, map grade, non-snap map data, and priority.
[0046] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0047] The memory stores computer-executed instructions;
[0048] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0049] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0050] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0051] The data processing method, apparatus, device, storage medium, and program product provided in this application, by selecting map data in the display interface, determines the target tile grid in the map data corresponding to the indicated target location. By analyzing the coordinate information of the target tile grid, a minimum bounding sphere is constructed for the target tile grid. Using the minimum bounding sphere and the snapping rules matched with the snappers configured for each map level in the target tile grid, target elements are filtered from multiple elements in the target tile grid, and the target elements are highlighted visually to complete the data snapping operation. Furthermore, by constructing snappers corresponding to each map level, configuring snapping rules, and combining this with the minimum bounding sphere of the tile grid, an effective spatial snapping range is defined, achieving accurate filtering and snapping of elements in the map data, improving the efficiency of the data snapping operation, and meeting the needs of real-time business scenarios. Attached Figure Description
[0052] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0053] Figure 1 This application provides an illustration of an application scenario.
[0054] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application;
[0055] Figure 3 A schematic diagram illustrating the visualization effect of an enclosed sphere provided in an embodiment of this application;
[0056] Figure 4 A flowchart illustrating another data processing method provided in an embodiment of this application;
[0057] Figure 5 A schematic diagram of a hexahedron with two views provided for an embodiment of this application;
[0058] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0059] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0060] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0061] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0062] Figure 1 This application provides an illustration of an application scenario, such as... Figure 1 As shown, the specific application scenario of this application is: through interactive operation between user 101 and device 102, GIS data is processed to achieve precise alignment of spatial relationships of geographic elements.
[0063] Based on the above scenarios, it is evident that by listening to user interactions, transforming screen coordinates, and combining spatial indexes to quickly retrieve the target for adsorption and provide visual feedback, there is a significant technical problem of adsorption operation delay.
[0064] The data processing method provided in this application defines the effective spatial capture range by constructing a capture device corresponding to each map level, configuring snapping rules, and combining the construction of the minimum bounding sphere of the tile grid. This enables precise filtering and snapping of elements in map data, improves the efficiency of data snapping operations, and meets the needs of real-time business scenarios.
[0065] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0066] Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application, as shown below. Figure 2 As shown, the method includes:
[0067] 201. In response to a selection operation on map data in the display interface, determine the target tile grid corresponding to the target location indicated by the selection operation; wherein the map data includes at least one feature in at least one tile grid.
[0068] For example, the execution subject of this embodiment may be an electronic device, hereinafter referred to as the device. The device may be a device including a display interface to realize the display function. The device processes map data, including GIS data, through the display interface. The map data is pre-divided into tile grids to obtain multiple tile grids, and each tile grid includes one or more features, including map features or geographic features. The user can perform a selection operation through the display interface to select map data. Based on a monitoring mechanism, the device can respond to the selection operation and determine the target tile grid of the map data corresponding to the target location indicated by the selection operation.
[0069] In one implementation, the user can move the mouse cursor on the device to select the target tile grid corresponding to the target location.
[0070] In one implementation, each tile mesh may include elements of a 3D scene such as vertices, edges, and 3D geometric tangents / normals with curvature.
[0071] Specifically, tile partitioning requests for massive amounts of map data (indicating tile partitioning) are merged according to the data source, and the data is temporarily stored and compressed in units of tiles. As the number of tile layers increases while the corresponding data source remains unchanged, the number of data requests will not increase, which can reduce server-side time consumption, alleviate performance pressure, and increase computational efficiency during tile snapping.
[0072] 202. Based on the coordinate information of the target tile mesh, construct the minimum bounding sphere corresponding to the target tile mesh.
[0073] For example, after determining the target tile grid, the device can determine the coordinate information of the target tile grid based on the coordinate system in the display interface, such as a three-dimensional Cartesian coordinate system, including the three-dimensional Cartesian coordinates of the area where the target tile grid is located. Based on a preset algorithm, such as a stochastic incremental algorithm or a fast approximate solution algorithm, the coordinate information of the target tile grid is calculated to obtain the minimum enclosing sphere of the three-dimensional space in which the target tile grid is located.
[0074] In one implementation, Figure 3 This is a schematic diagram illustrating the visualization effect of an enclosed sphere provided in an embodiment of this application, such as... Figure 3 As shown, the target tile mesh is constructed with the center of the target tile mesh as the center and the distance from the center to the farthest vertex of the bounding box of the target tile mesh as the radius. Figure 3 The smallest enclosing sphere in the three-dimensional space where the area marked by the green line is located. Figure 3 (The area indicated by the red line).
[0075] 203. Based on the minimum bounding sphere and the snapping rules of the snappers corresponding to each map level in the target tile grid, determine the target features in the target tile grid.
[0076] The snapping rules include, but are not limited to, one or more of the following: the name of the feature snapper, the map level, the snapper category, the map grade, the non-snapped map data, and the priority.
[0077] For example, the device can determine the features within the minimum bounding sphere of the target tile grid based on the minimum bounding sphere of the target tile grid, and call the snapper corresponding to each map level in the target tile grid. Through the snapping rules configured for each map level snapper, the device filters out the features that do not conform to the corresponding snapping rules, and determines the features that conform to the corresponding snapping rules as the target features.
[0078] In one implementation, an adsorption rule setting file is written according to a preset capturer configuration format. From the requirement description, it can be seen that 5 layers need to be configured with 3 adsorption rules, which are assigned as S1, S2, and S3.
[0079] One implementation introduces machine learning-based automatic generation of adsorption rules. By training a model and analyzing historical operational data, adsorption rules adapted to the business scenario are dynamically generated. This reduces manual configuration costs and improves rule adaptability, making it particularly suitable for scenarios with complex topological relationships (such as prioritizing traffic light adsorption at road intersections). Independent management of the capture unit allows for the configuration of complex adsorption logic, which can be merged into a single capture unit, reducing concurrency and improving flexibility and maintainability.
[0080] In one implementation, snappers are written according to preset snapping rules. Three snappers, SA1, SA2, and SA3, are configured based on the requirements, and corresponding snapping rules S1, S2, and S3 are written. These snapping rules may include: feature snapper name (name); snapping layers (layers, read from the layers field in the rule configuration or custom configuration); snapper type (type); map level (minimum snapping layer (options.minZoom), maximum snapping layer (options.maxZoom); data not allowed to be snapped (except); and priority (options.priority), etc. The options field in the rule configuration can be customized by the user.
[0081] In one implementation, the user writes code through the device and uses interface functions to initialize the map object (i.e., the map data to be processed) in the HTML page, sets up the map container and camera configuration, creates a snapping tool, binds the tool to the map, starts the tool, and loads the relevant layers in the map object to activate the snapping tool and perform the snapping operation.
[0082] For example, suppose a data production scenario requires loading five layers to render lane centerlines, lane boundary lines, traffic lights, and urban road lines and road point data. When the map level is <=15, capturing urban road lines and road point data is allowed; only endpoints of road lines are allowed, and road point attachments >2 are not allowed. When the map level is >15 and <=19, capturing lane centerlines, lane boundary lines, and urban road lines is allowed; lane centerlines with a "regular" type are not allowed. Lane boundary lines and lane centerlines are allowed to capture endpoints and other points, with a higher capture priority than urban road lines. Traffic lights are allowed to be captured when the map level is >19. Based on different map levels, the map is divided into n tile grids for compressed rendering. By moving the mouse on the screen and zooming with the scroll wheel, the system calculates feature data that matches the configured snapper in real time, performs snapping, and highlights the snapping effect.
[0083] 204. Highlight the target elements.
[0084] For example, the device is pre-designed with a highlight controller and a feedback controller to implement visual enhancement and status feedback during the interaction process. Through these highlight controller and feedback controller, the identified target elements are highlighted and processed.
[0085] The highlight controller is responsible for highlighting the target element when the mouse hovers over it and triggers the snapping mechanism according to the corresponding snapping rule. The feedback controller focuses on inter-tool collaboration scenarios, providing targeted visual feedback when the target element is selected through snapping logic. Both types of controllers follow preset highlight feedback rules, which can display various vector data such as points, lines, and surfaces on the canvas with a prominent visual effect, ensuring that users can intuitively perceive the interaction status and the snapping target.
[0086] One implementation method involves using a rule priority field (such as options.priority) to sort the snapping points at different map levels within the snapping target, ensuring that higher-priority rules are executed first. Layered rendering and hardware acceleration enhance the real-time performance and interactive experience of the snapping operation.
[0087] This embodiment provides a data processing method that, by constructing a snapper corresponding to each map level and configuring snapping rules, achieves flexible adaptation and efficient calculation of snapping rules in GIS data production; by constructing the minimum bounding sphere of the tile grid, the effective spatial snapping range is defined, enabling accurate filtering and snapping of elements in map data; thereby, the efficiency of data snapping operations can be improved, meeting the needs of real-time business scenarios.
[0088] Figure 4 A flowchart illustrating another data processing method provided in this application embodiment is shown below. Figure 4 As shown, the method includes:
[0089] 301. In response to a selection operation on map data in the display interface, determine the pixel coordinates of the target location indicated by the selection operation.
[0090] For example, the device displays map data to be processed, including GIS data. This map data is pre-divided into tile grids, resulting in multiple tile grids. Each tile grid includes one or more features, including map features or geographic features. Users can select map data through the display interface. Based on a monitoring mechanism, the device responds to this selection and uses tools built into the display interface to determine the target location indicated by the selection. The pixel coordinates of the target location are determined using the pixel coordinate system of the display interface, such as the pixel coordinates of the mouse cursor on the screen.
[0091] 302. Map pixel coordinates to geographic information coordinates; and obtain the target tile grid corresponding to the geographic information coordinates.
[0092] For example, the device uses a coordinate mapping algorithm to map the pixel coordinates of the target location in the pixel coordinate system to the corresponding geographic information coordinates. Based on these geographic information coordinates, the device obtains the target tile grid corresponding to these geographic information coordinates. This target tile grid contains coordinate information under the geographic information coordinates, such as geographic information coordinates.
[0093] By dividing map data into equal-scale tile grids and implementing tile-level compression and temporary storage, the spatial computing efficiency during snap-in can be significantly improved, effectively alleviating system pressure in real-time operations, so as to achieve smooth interaction in large-scale scenarios.
[0094] 303. Determine the bounding box information of the target tile mesh based on its coordinate information; the bounding box information includes the geometric center and maximum spatial span of the tile mesh bounding box.
[0095] For example, a geographic boundary coordinate system is constructed to determine the coordinate information of the target tile grid under this system, i.e., the geographic boundary coordinates. A coordinate mapping algorithm is then used to convert the geographic boundary coordinates of the target tile grid into three-dimensional Cartesian coordinates. Geometric calculations are then performed on these three-dimensional Cartesian coordinates and the bounding box of the target tile grid to obtain its bounding box information, including the geometric center and maximum spatial span of the tile grid bounding box.
[0096] 304. Based on the bounding box information of the target tile mesh, construct the minimum enclosing sphere corresponding to the target tile mesh.
[0097] For example, the device invokes a preset algorithm to calculate the bounding box information of the target tile mesh, determines the center coordinates and radius of the initial enclosing sphere of the target tile mesh, and iteratively calculates the center coordinates and radius of the initial enclosing sphere according to the sphere calculation equation, continuously shrinking the sphere of the enclosing sphere to obtain the minimum enclosing sphere corresponding to the target tile mesh.
[0098] By determining the range of the target tile grid based on the target location and dynamically generating the minimum bounding sphere, the effective spatial capture range can be defined, which helps to achieve accurate selection of elements.
[0099] 305. Based on the real-time position of the target viewpoint and the minimum bounding sphere, determine the coordinate information of the hexahedron corresponding to the target tile mesh; wherein, the hexahedron is the hexahedron intercepted by the intersection between the view frustum formed by the target viewpoint facing the target position and the minimum bounding sphere of the target tile mesh.
[0100] For example, based on the data display effect of the user viewing the display interface of the device, the viewpoint corresponding to the user or other devices viewing the data display effect can be determined, which is the target viewpoint, such as the user's eyes or image acquisition devices (such as cameras). Figure 5 A schematic diagram of a hexahedron with two views provided for an embodiment of this application, as shown below. Figure 5 As shown, the device determines the real-time position of the viewpoint currently facing the display interface (which can be a fixed position or a dynamically changing position), and determines the viewing cone formed by the target viewpoint facing the target position. Figure 5 (The yellow area in the image) Based on the spatial intersection of the minimum bounding sphere corresponding to the viewing frustum and the target tile mesh, the spatial geometric relationship between the minimum bounding sphere and the viewing frustum is calculated using the coordinate information of the minimum bounding sphere and the viewing frustum in the spatial coordinate system, resulting in the hexahedron obtained by the intersection of the two. Figure 5 (The gray area in the image) and obtain the coordinate information of the hexahedron in the spatial coordinate system.
[0101] In one implementation, the parametric equations of the minimum enclosing sphere and the viewing cone are determined based on their coordinate information in the spatial coordinate system. The two parametric equations are then solved simultaneously to obtain the parametric equations corresponding to the hexahedron, thereby obtaining the hexahedron and its coordinate information, which defines the geometric shape of the effective space in the actual capture process.
[0102] In one implementation, a dynamic radius adjustment mechanism can be introduced. Based on the real-time position of the target viewpoint and the user's operation frequency, the radius of the minimum enclosing sphere is dynamically scaled to obtain the adjusted minimum enclosing sphere. The parametric equations of the adjusted minimum enclosing sphere and the view frustum are then solved simultaneously to obtain the hexahedron and its coordinate information. By introducing the dynamic radius adjustment mechanism, redundant data retrieval is reduced, further improving the real-time performance and accuracy of the adsorption operation.
[0103] In one possible implementation, step 305 includes the following steps:
[0104] The first step is to construct a projection ray that points from the real-time position of the target viewpoint to the target position.
[0105] The second step involves generating the first and second cross sections based on the parametric equations of the projected ray and the spherical equations of the smallest enclosing sphere.
[0106] The third step is to determine the width and height of the second cross-section, as well as its planar dimensions in the spatial coordinate system, based on the distance between the real-time position of the target viewpoint and the first cross-section, and the distance between the real-time position of the target viewpoint and the second cross-section.
[0107] The fourth step is to determine the coordinate information of the hexahedron based on the width and height of the second cross section and its planar dimensions in the spatial coordinate system.
[0108] Specifically, based on the real-time position of the target viewpoint, a projection ray is constructed from the real-time position of the target viewpoint to the target position. When the projection ray intersects with the minimum bounding sphere, the ray parameter equation of the projection ray and the spherical equation of the minimum bounding sphere are determined in the spatial coordinate system where the projection ray and the minimum bounding sphere are located. These equations are then solved simultaneously to obtain the intersection point, which is integrated to obtain the corresponding first cross-section (the near cross-section closer to the target viewpoint) and second cross-section (the far cross-section farther from the target viewpoint). The distance between the real-time position of the target viewpoint and the first cross-section is calculated, as well as the distance between the real-time position of the target viewpoint and the second cross-section. Using the parameter mapping relationship of the view frustum from the target viewpoint to the target position, these two distances are calculated to obtain the width and height of the second cross-section, as well as its planar dimensions in the spatial coordinate system. Based on the spatial geometric calculation algorithm, the width and height of the second cross section, as well as its planar dimensions in the spatial coordinate system, are calculated to obtain the hexahedron obtained by the intersection of the view frustum from the target viewpoint toward the target position and the smallest enclosing sphere, and then the coordinate information of the hexahedron in the spatial coordinate system is determined.
[0109] In one implementation, combined with Figure 5 Based on the camera's real-time position, a projection ray emanating from the camera's optical center is constructed. This projection ray follows the principle of perspective projection, initiating spatial probing towards the target tile grid. The parametric equations of the projection ray and the spherical equations of the minimum bounding sphere are solved simultaneously to obtain the intersection point, generating two cross-sections: a near cross-section and a far cross-section. The distance from the camera's optical center to the near cross-section is defined as 'near', and the distance from the camera's optical center to the far cross-section as 'far'. The width and height of the far cross-section are calculated using the parameter mapping relationship of the camera's view frustum. Using inherent camera parameters such as the field of view and aspect ratio, the dimensions of the far cross-section in the spatial coordinate system are determined by an algorithm. The near and far cross-sections, as spatial planes, together with the ray, form a hexahedron (…). Figure 5 The gray area (in the middle) is a spatial geometric hexahedron formed by the intersection of the camera's view frustum and the smallest enclosing sphere. Through real-time calculations of ray intersection, distance measurement, and planar dimension derivation, the coordinate information of the hexahedron is dynamically constructed and updated to define the geometric shape of the effective space in the actual capture process.
[0110] Based on viewpoint-based ray casting and 3D geometric calculations, combined with subsequent target tile mesh alignment algorithms, millimeter-level precision 3D snapping is achieved, meeting the requirements for high-precision GIS data production.
[0111] 306. Based on the snapping rules of the snappers corresponding to each map level in the target tile grid and the coordinate information of the hexahedron, select the target features from the hexahedron.
[0112] For example, after the device determines the hexahedron corresponding to the target tile grid, it determines the spatial geometric range of the hexahedron based on the coordinate information of the hexahedron in the spatial coordinate system. Then, it can determine the feature data in the target tile grid that are included in the spatial geometric range of the hexahedron. According to the snapping rules of the snapper corresponding to each map level in the target tile grid, it performs snapping principle judgment on the features in each map level of these feature data to filter out the target features.
[0113] In one implementation, the core region of the hexahedron's spatial geometry can be defined according to the snapping rules of the snappers corresponding to each map level. For example, a preset size ratio can be set, and the spatial geometry of the hexahedron can be reduced and adjusted according to the preset size ratio to obtain the core region of the hexahedron. Based on the snapping rules of the snappers corresponding to each map level in the target tile grid, the snapping principle of each map level within the core region of the hexahedron is judged to filter out the target features.
[0114] By constructing a hexahedral spatial range to limit the search area of the target elements to be adsorbed, and combining the adsorption rules of multiple capture devices for adsorption screening, flexible adaptation and efficient calculation of adsorption rules in GIS data production can be achieved, and the adsorption accuracy of complex geometry and three-dimensional data can be improved.
[0115] In one possible implementation, step 306 includes the following steps:
[0116] The first step is to select at least one feature to be snapped from the hexahedron based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron.
[0117] The second step is to determine the distance between the element to be adsorbed and each boundary of the hexahedron based on the coordinate information of the hexahedron.
[0118] The third step is to determine at least one candidate element from at least one element to be adsorbed based on the distances corresponding to at least one element to be adsorbed.
[0119] The fourth step is to determine the target element based on the distance between at least one candidate element and the target viewpoint.
[0120] Specifically, based on the coordinate information of the hexahedron, feature data within the spatial range of the hexahedron are determined from the target tile grid. Following the snapping rules of the snapper corresponding to each map layer in the target tile grid, features conforming to the corresponding snapping rules are selected from this feature data, resulting in multiple features to be snapped. Based on the coordinate information of the hexahedron and the coordinate information of each feature to be snapped, a spatial geometric algorithm is used to calculate the distances from each feature to be snapped to the boundaries of the hexahedron. According to preset rules, each feature to be snapped is judged based on its distances to the boundaries of the hexahedron to determine whether it meets the preset rule conditions, thus identifying at least one candidate feature that conforms to the preset rules. Based on the coordinate information of each candidate feature and the real-time position of the target viewpoint, the straight-line distance between each candidate feature and the target viewpoint is calculated, and candidate features whose straight-line distances conform to the preset distance range are selected as the final target features.
[0121] In one implementation, the distances from each element to be adsorbed to the boundaries of the hexahedron are calculated using vector operations, using the formula: The calculation is performed, where (x, y, z) are the coordinates of each element to be adsorbed (i.e., the position of each element to be adsorbed); A, B, and C represent coefficients describing a plane, and D is a constant term.
[0122] In one implementation, the shortest distance among the distances between each element to be adsorbed and each boundary of the hexahedron is determined, and a rule judgment is made based on the shortest distance to determine whether the element to be adsorbed is a candidate element.
[0123] By reducing redundant data retrieval through tiled management and combining it with an outsourced sphere screening mechanism, the computational load under massive data is significantly reduced, and the real-time adsorption efficiency is improved.
[0124] In one possible implementation, the third step includes: determining the minimum distance among the various distances corresponding to the element to be adsorbed; if the minimum distance corresponding to the element to be adsorbed is less than or equal to a preset tolerance, and / or if the spatial angle between the element to be adsorbed and the projection ray is less than or equal to a preset angle, then the element to be adsorbed is determined as a candidate element; wherein, the projection ray is the projection ray from the real-time position of the target viewpoint to the target position; the preset tolerance is determined based on the corresponding adsorption rule.
[0125] Specifically, for each feature to be absorbed, the minimum distance among all distances corresponding to that feature is determined. Based on the absorption rule corresponding to the map layer where the feature is located, a preset tolerance corresponding to that rule is determined, such as a real-time tolerance configuration based on the map scale. The minimum distance corresponding to each feature to be absorbed is then compared with the corresponding preset tolerance. If the minimum distance corresponding to the feature to be absorbed is less than or equal to the preset tolerance, the feature to be absorbed is determined as a candidate feature; otherwise, the feature to be absorbed is filtered to exclude redundant data that is completely deviated from the core region of the hexahedron. And / or, a projection ray from the real-time position of the target viewpoint to the target position is constructed. The spatial angle formed between each feature to be absorbed and the projection ray is calculated. The absorption rule corresponding to the map layer where the feature is located is called, and the preset angle corresponding to that rule is determined. The spatial angle corresponding to each feature to be absorbed is then compared with the preset angle. If the spatial angle corresponding to the feature to be absorbed is less than or equal to the preset angle, the feature to be absorbed is determined as a candidate feature; otherwise, the feature to be absorbed is filtered.
[0126] In one implementation, the vector dot product formula can be used: cosα=(v1*v2) / (|v1|*|v2|) to calculate the spatial angle α formed between each element to be adsorbed and the projected ray; where v1 and v2 are the vectors corresponding to each element to be adsorbed and the projected ray, respectively.
[0127] In one implementation, a Bézier curve fitting algorithm is introduced into the three-dimensional geometric calculation to calculate the tangent / normal direction of high curvature elements, determine the angle between the tangent direction of the element to be adsorbed on the complex surface and the projected ray, improve the accuracy of adsorption on complex surfaces, and reduce the accuracy loss caused by geometric simplification.
[0128] Multi-level spatial computing is used to optimize the capture range, and scattered adsorption judgments are centrally processed to reduce redundant calculations. The tolerance is dynamically adjusted based on the real-time tolerance configuration strategy of the map scale. Combined with hardware-accelerated computing, the adsorption accuracy can reach the millimeter level, realizing the production of high-precision GIS data.
[0129] In one possible implementation, the fourth step includes: calculating the straight-line distance between each candidate element and the real-time position of the target viewpoint, such as the straight-line distance between each candidate element and the optical center of the camera, for the candidate elements that pass the adsorption rules, and sorting the straight-line distances, and finally obtaining the candidate element with the smallest straight-line distance as the target element in the actual capture result.
[0130] 307. Highlight the target elements.
[0131] For example, this step can be referred to as step 204, which will not be repeated here.
[0132] In this embodiment, based on the above embodiments, on the one hand, a multi-type capture system is constructed through modular capture design. Each capture device, as an independent adsorption rule unit, can define exclusive rules as needed, realizing flexible configuration and combination of adsorption logic. Users can quickly adjust the capture strategy according to business needs, greatly enhancing the flexibility of rule adaptation. On the other hand, by emitting rays from the viewpoint to the target position, the conversion from screen coordinates to three-dimensional spatial coordinates is accurately completed. Combined with the grid alignment algorithm, the spatial positioning of candidate elements is realized. Then, through matching calculation, the intuitive visual guidance is finally provided with highlight feedback, so that the accuracy of three-dimensional data production can reach the millimeter level, meeting the business needs of high-precision GIS data production.
[0133] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application, as shown below. Figure 6 As shown, the device includes:
[0134] The first determining module 401 is used to determine the target tile grid corresponding to the target location indicated by the selection operation in response to a selection operation on map data in the display interface; wherein the map data includes at least one feature in at least one tile grid;
[0135] Module 402 is used to construct the minimum bounding sphere corresponding to the target tile mesh based on the coordinate information of the target tile mesh;
[0136] The second determining module 403 is used to determine the target features in the target tile grid based on the minimum bounding sphere and the snapping rules of the snapper corresponding to each map level in the target tile grid.
[0137] Feedback module 404 is used to highlight the target elements.
[0138] In one possible implementation, the second determining module 403 is specifically used to: determine the coordinate information of the hexahedron corresponding to the target tile grid based on the real-time position of the target viewpoint and the minimum bounding sphere; wherein, the hexahedron is the hexahedron intercepted by the intersection of the view frustum formed by the target viewpoint facing the target position and the minimum bounding sphere of the target tile grid; and filter out target elements from the hexahedron based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron.
[0139] In one possible implementation, the second determining module 403 is specifically configured to: construct a projection ray pointing from the real-time position of the target viewpoint to the target position; generate a first cross-section and a second cross-section based on the parametric equation of the projection ray and the spherical equation of the minimum bounding sphere; determine the width and height of the second cross-section, as well as its planar dimensions in the spatial coordinate system, based on the distance between the real-time position of the target viewpoint and the first cross-section, and the distance between the real-time position of the target viewpoint and the second cross-section; and determine the coordinate information of the hexahedron based on the width and height of the second cross-section and its planar dimensions in the spatial coordinate system.
[0140] In one possible implementation, the second determining module 403 is specifically configured to: select at least one element to be snapped from the hexahedron based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron; determine the distance between the element to be snapped and each boundary of the hexahedron based on the coordinate information of the hexahedron; determine at least one candidate element from the at least one element to be snapped based on the distances corresponding to the at least one element to be snapped; and determine the target element based on the distance between the at least one candidate element and the target viewpoint.
[0141] In one possible implementation, the second determining module 403 is specifically used to: determine the minimum distance among all distances corresponding to the element to be adsorbed; if the minimum distance corresponding to the element to be adsorbed is less than or equal to a preset tolerance, and / or if the spatial angle between the element to be adsorbed and the projection ray is less than or equal to a preset angle, then the element to be adsorbed is determined as a candidate element; wherein, the projection ray is the projection ray from the real-time position of the target viewpoint to the target position; the preset tolerance is determined based on the corresponding adsorption rule.
[0142] In one possible implementation, the construction module 402 is specifically used to: determine the bounding box information of the target tile mesh based on the coordinate information of the target tile mesh; wherein the bounding box information includes the geometric center and maximum spatial span of the tile mesh bounding box; and construct the minimum enclosing sphere corresponding to the target tile mesh based on the bounding box information of the target tile mesh.
[0143] In one possible implementation, the first determining module 401 is specifically used to: in response to a selection operation on map data in the display interface, determine the pixel coordinates of the target location indicated by the selection operation; map the pixel coordinates to geographic information coordinates; and obtain the target tile grid corresponding to the geographic information coordinates.
[0144] In one possible implementation, the snapping rules include, but are not limited to, one or more of the following: feature snapper name, map level, snapper category, map grade, non-snap map data, and priority.
[0145] The apparatus in this embodiment can execute the technical solutions in the above method. Its specific implementation process and technical principles are the same, and will not be repeated here.
[0146] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 7 As shown, the electronic device includes: a memory 501 and a processor 502; the memory 501 is a memory used to store instructions executable by the processor 502.
[0147] The processor 502 is configured to perform the method provided in the above embodiments.
[0148] The electronic device also includes a receiver 503 and a transmitter 504. The receiver 503 is used to receive instructions and data sent by other devices, and the transmitter 504 is used to send instructions and data to external devices.
[0149] The specific implementation process of the processor can be found in the above method embodiments, and its implementation principle and technical effect are similar, so it will not be repeated here.
[0150] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0151] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed on a computer, cause the computer to perform the technical solutions described above.
[0152] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0153] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. The readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in a device.
[0154] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the technical solutions in the above embodiments.
[0155] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0156] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as magnetic disks or optical disks.
[0157] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A data processing method, characterized in that, include: In response to a selection operation on map data in the display interface, a target tile grid corresponding to the target location indicated by the selection operation is determined; wherein the map data includes at least one feature in at least one tile grid; Based on the coordinate information of the target tile mesh, construct the minimum bounding sphere corresponding to the target tile mesh; Based on the minimum bounding sphere and the snapping rules of the snappers corresponding to each map level in the target tile grid, the target features in the target tile grid are determined; The target element is highlighted.
2. The method according to claim 1, characterized in that, The step of determining the target features in the target tile grid based on the snapping rules of the snapper corresponding to each map level in the target tile grid includes: Based on the real-time position of the target viewpoint and the minimum bounding sphere, the coordinate information of the hexahedron corresponding to the target tile mesh is determined; wherein, the hexahedron is the hexahedron intercepted by the intersection between the view frustum formed by the target viewpoint facing the target position and the minimum bounding sphere of the target tile mesh; Based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron, the target features are selected from the hexahedron.
3. The method according to claim 2, characterized in that, The step of determining the coordinate information of the hexahedron corresponding to the target tile mesh based on the real-time position of the target viewpoint and the minimum bounding sphere includes: Construct a projection ray from the real-time position of the target viewpoint to the target position; The first cross section and the second cross section are generated based on the parametric equation of the projected ray and the spherical equation of the minimum enclosing sphere. Based on the distance between the real-time position of the target viewpoint and the first cross-section, and the distance between the real-time position of the target viewpoint and the second cross-section, the width and height of the second cross-section, as well as its planar dimensions in the spatial coordinate system, are determined. The coordinate information of the hexahedron is determined based on the width and height of the second cross-section and its planar dimensions in the spatial coordinate system.
4. The method according to claim 2, characterized in that, The step of filtering the target features from the hexahedron based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron includes: Based on the snapping rules of the snapper corresponding to each map level in the target tile grid and the coordinate information of the hexahedron, at least one element to be snapped is selected from the hexahedron; Based on the coordinate information of the hexahedron, determine the distances between the element to be adsorbed and each boundary of the hexahedron; Based on the distances corresponding to the at least one element to be adsorbed, at least one candidate element is determined from the at least one element to be adsorbed; The target element is determined based on the distance between the at least one candidate element and the target viewpoint.
5. The method according to claim 4, characterized in that, The step of determining at least one candidate element from the at least one element to be adsorbed based on the distances corresponding to the at least one element to be adsorbed includes: Determine the minimum distance among all distances corresponding to the element to be adsorbed; If it is determined that the minimum distance corresponding to the element to be adsorbed is less than or equal to a preset tolerance, and / or, if it is determined that the spatial angle between the element to be adsorbed and the projection ray is less than or equal to a preset angle, then the element to be adsorbed is determined to be the candidate element; wherein, the projection ray is the projection ray from the real-time position of the target viewpoint to the target position; the preset tolerance is determined based on the corresponding adsorption rule.
6. The method according to claim 1, characterized in that, The step of constructing the minimum bounding sphere corresponding to the target tile mesh based on the coordinate information of the target tile mesh includes: Based on the coordinate information of the target tile mesh, the bounding box information of the target tile mesh is determined; wherein, the bounding box information includes the geometric center and maximum spatial span of the tile mesh bounding box; Based on the bounding box information of the target tile mesh, construct the minimum enclosing sphere corresponding to the target tile mesh.
7. The method according to claim 1, characterized in that, The step of determining the target tile grid corresponding to the target location indicated by the selection operation in response to a selection operation on map data in the display interface includes: In response to a selection operation on map data in the display interface, the pixel coordinates of the target location indicated by the selection operation are determined; The pixel coordinates are mapped to geographic information coordinates; and the target tile grid corresponding to the geographic information coordinates is obtained.
8. The method according to any one of claims 1-7, characterized in that, The snapping rules include, but are not limited to, one or more of the following: feature snapper name, map level, snapper category, map grade, non-snap map data, and priority.
9. A data processing apparatus, characterized in that, include: The first determining module is configured to, in response to a selection operation on map data in the display interface, determine the target tile grid corresponding to the target location indicated by the selection operation; wherein the map data includes at least one feature in at least one tile grid; A construction module is used to construct the minimum bounding sphere corresponding to the target tile mesh based on the coordinate information of the target tile mesh; The second determining module is used to determine the target features in the target tile grid based on the minimum outer sphere and the snapping rules of the snapper corresponding to each map level in the target tile grid; The feedback module is used to highlight the target elements.
10. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-8.
11. A computer-readable storage medium / computer program product, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-8; and / or, the computer program product includes a computer program, which, when executed by a processor, implements the method as described in any one of claims 1-8.