Map path automatic generation method and generation system
The method improves map accuracy and aesthetics by converting trajectory data into an array format, filtering for validity, and rendering as polylines, addressing the limitations of direct data conversion in existing systems.
Patent Information
- Application Number
- CN202411298695.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing map generation systems convert raw location data into map coordinate points directly, resulting in low accuracy and unattractive path maps.
A method involving data conversion to an array format, followed by static and/or GPS filtering to extract valid trajectory data, then converting into map coordinate points and rendering as trajectory polylines for improved accuracy and aesthetics.
Enhances map accuracy and visual appeal by filtering and rendering trajectory data as polylines, resulting in a more precise and visually appealing path map.
Smart Images

Figure CN119128037A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of map generation, and in particular to a method and system for automatically generating a map path. Background Art
[0002] With the advent of the 5G and artificial intelligence era, video images are the main means of visual information exchange, and image processing has been widely used in the fields of mobile Internet, intelligent recognition, and multimedia information exchange. With powerful computing and data processing capabilities, people can generate a path map of the walking trajectory of the target person based on the location data generated during the movement, so that people can clearly know where they have been. When generating a path map of a target person, the existing map generation system directly converts all data into map coordinate points, and then places the map coordinate points on the map to obtain the path map of the target person. The path map obtained in this way is not only not beautiful, but also has a relatively low accuracy rate. Summary of the invention
[0003] To solve the above problems, the present invention provides a method and system for automatically generating a map path. The specific technical solution of the present invention is as follows:
[0004] A method for automatically generating a map path, the method comprising the following steps: S1: a map generation system receives a map generation command, and then calls the trajectory data of a target person from a database according to the map generation command;
[0005] S2: The map generation system converts the trajectory data of the target person into an array format, and then filters the trajectory data array; S3: The map generation system filters out valid trajectory data from the array through static filtering and / or GPS filtering; S4: The map generation system converts the valid trajectory data into map coordinate points, and then creates an empty array and puts the map coordinate points into the empty array; S5: The map generation system converts the map coordinate points in the array into trajectory polylines, and renders the trajectory polylines into the map to obtain a path map of the target person.
[0006] Furthermore, the map generation command includes but is not limited to the ID of the target person, the date of the target person's walking trajectory, and the start time and end time of the target person's walking trajectory.
[0007] Further, in step S3, the map generation system filters out valid trajectory data from the array through static filtering and / or GPS filtering, including the following steps: the map generation system determines whether the static filtering is turned on through the locally stored speed filter; if the static filtering is turned on, the map generation system filters out the valid trajectory data through the static filtering; if the static filtering is not turned on, the map generation system determines whether the GPS filtering is turned on through the locally stored GPS filter; if the GPS filtering is turned on, the map generation system filters out the valid trajectory data through the GPS filtering; if the GPS filtering is not turned on, the map generation system uses the data in the trajectory data array as the valid trajectory data.
[0008] Furthermore, the map generation system filters out valid trajectory data through static screening, including the following steps: when the map generation system performs static screening, the data of items in the trajectory data array whose speed is greater than or equal to 5 in this static screening is taken as valid trajectory data; the map generation system performs static screening again on the data of items in the trajectory data array whose speed is less than 5, and when performing screening, the data of items in the trajectory data array whose speed is greater than or equal to 5 in this static screening is taken as valid trajectory data; and so on, after the map generation system fails to obtain data from the trajectory data array through static screening, the static screening is terminated to obtain valid trajectory data.
[0009] Furthermore, the map generation system filters out valid trajectory data through GPS screening, including the following steps: when the map generation system performs GPS screening, the data of the items in the trajectory data array whose GPS is equal to 1 is taken as valid trajectory data, and the GPS screening is ended to obtain the valid trajectory data.
[0010] Further, in step S4, the map generation system converts the valid trajectory data into map coordinate points, including the following steps: the map generation system first initializes the valid trajectory data, wherein the valid trajectory data is the trajectory data points, and then creates a map through the new BMapGL function; the map generation system converts the longitude and latitude of the valid trajectory data into the longitude and latitude of the map coordinate points through the new BMapGL function.
[0011] Furthermore, in step S5, the map generation system converts the map coordinate points in the array into trajectory polylines, including the following steps: the map generation system creates a poly line array, and then puts the map coordinate points into the poly line array; the map generation system converts the map coordinate points in the poly line array into trajectory polylines through a custom rendering function.
[0012] Furthermore, in step S5, the map generation system renders the trajectory polyline to the map, including the following steps: the map generation system renders the trajectory polyline to the map through the add overlay function to obtain the path map of the target person.
[0013] Furthermore, after the map generation system obtains the path map of the target person, S6: the map generation system calculates the map coordinate points of the trajectory polyline through a road book function algorithm to obtain a trajectory polyline that can be played on the path map.
[0014] A map generation system generates a path map of a target person through the above-mentioned map path automatic generation method.
[0015] Compared with the existing technology, the beneficial effects of the present invention are: when generating a path map, the map path generation system described in the present application first converts the trajectory data of the target person into an array format, and then filters out the valid trajectory data from the array through static screening and / or GPS screening, and then converts the valid trajectory data into map coordinate points, so that the accuracy of the map coordinate points is higher, thereby improving the accuracy of the path map; the map path generation system first converts the map coordinate points into trajectory polylines, and then places the trajectory polylines on the map by rendering, so that the path map of the target person obtained is more beautiful. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The figure is a flow chart of a method for automatically generating a map path in one embodiment of the present invention. DETAILED DESCRIPTION
[0017] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions.
[0018] In the description of the present invention, it should be noted that directional words, such as the terms "center", "lateral", "longitudinal", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", etc., indicating directions and positional relationships are based on the directions or positional relationships shown in the accompanying drawings, which are only for the convenience of narrating the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and cannot be understood as limiting the specific scope of protection of the present invention.
[0019] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features. Therefore, the definition of "first" and "second" features can explicitly or implicitly include one or more of the features. In the description of the present invention, "at least" means one or more, unless otherwise clearly and specifically defined.
[0020] In the present invention, unless otherwise specified and limited, the terms "assemble", "connect", and "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can also be a mechanical connection; it can be directly connected, or it can be connected through an intermediate medium, or the two elements can be internally connected. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0021] In the invention, unless otherwise specified and limited, a first feature being “above” or “below” a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being “above”, “below”, and “above” a second feature includes that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being “above”, “below”, and “below” a second feature includes that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0022] The following is a further description of the specific embodiments of the present invention in conjunction with the drawings of the specification, so that the technical solution and its beneficial effects of the present invention are clearer and more explicit. The following description of the embodiments with reference to the drawings is exemplary and intended to explain the present invention, but cannot be understood as limiting the present invention.
[0023] like Figure 1As shown, a method for automatically generating a map path includes the following steps: S1: the map generation system receives a map generation command, and then calls the trajectory data of the target person from the database through PHP according to the map generation command. If the data interface of the map generation system does not call the trajectory data of the target person, the map generation system ends the map generation. The map generation command can be sent to the map generation system by an electronic device such as a mobile phone or a computer; the trajectory data can be the moving trajectory data recorded by the mobile phone of the target person. PHP (PHP: Hypertext Preprocessor) is a scripting language executed on the server side, which is particularly suitable for Web development and can be embedded in HTML. S2: the map generation system converts the trajectory data of the target person into an array format, the data type of the array (Array) is object, and the map generation system can convert the trajectory data into an array format by using a common data conversion method, and then the map generation system filters the trajectory data array. S3: the map generation system filters out valid trajectory data from the array by static filtering or / and GPS filtering. The map generation system can only use static filtering or GPS filtering to filter out valid trajectory data, or the map generation system can first use static filtering for filtering, and then use GPS filtering for filtering. S4: The map generation system converts valid trajectory data into map coordinate points, then creates an empty array and puts the map coordinate points into the empty array. The map generation system can convert addresses to longitude and latitude, or convert longitude and latitude to addresses through formulas. For example, the ml-search[GetAddrByGaode] function can be used to convert known addresses to longitude and latitude, while the ml-search[GetGPSByGaode] function can be used to convert longitude and latitude to addresses. In addition, the ml-search[GetMapByGaode] function can be used to obtain map images, and the ml-search[GetCityCodeByGaode] and ml-search[GetADCodeByGaode] functions can be used to obtain information such as telephone area codes and administrative area codes. UTM coordinate conversion: For UTM (Universal Transverse Mercator) coordinates, conversion can be performed through specialized software or libraries in programming languages. For example, in MATLAB, the ml-search[utm2deg] function can be used to convert UTM coordinates to longitude and latitude coordinates. This involves reading UTM coordinate data and then applying a conversion algorithm to obtain longitude and latitude values. Coordinate conversion in GIS software: GIS software such as ArcGIS can be used to convert longitude and latitude coordinates to geodetic coordinates. This involves importing longitude and latitude data into the GIS software, selecting the appropriate coordinate system, and performing projection conversion.For example, the longitude and latitude data of the WGS84 coordinate system can be converted into the geographic coordinate system of a specific region, such as the CGCS2000 coordinate system of China. S5: The map generation system converts the map coordinate points in the array into trajectory polylines, and renders the trajectory polylines into the map to obtain a path map of the target person.
[0024] Rendering data to a map involves multiple steps, including data acquisition, processing, and final visualization on the map. Here are the detailed steps:
[0025] Data acquisition: First, you need to obtain data from reliable sources. For example, the data can come from the Hejing Community, which is a platform that provides various data sets. The data on this platform is about the average GDP value added of each province in China.
[0026] Data processing: After obtaining the data, some processing may be required to meet specific visualization requirements. For example, if you need to show the average GDP instead of the sum, then you need to calculate the average of the data. This involves changing the "sum" setting to "average" to ensure that the average GDP value added is displayed instead of the sum.
[0027] Map visualization: After processing the data, the next step is to render the data on a map. This includes choosing the appropriate visualization tools and settings. For example, use OpenLayers to view or download the data, or choose a suitable format on the map for downloading. In addition, you can also use QGIS to directly visualize the data in PostGIS, or convert the data into 3D shapes, process it in 3D graphics software or game engines, and finally display and render it in the browser.
[0028] Custom GeoJSON: When customizing GeoJSON, custom properties should be placed under properties so that they can be obtained through feature.get:'parameter name'). In addition, use the :ml-search[layer.getSource()].forEachFeature((f)=>{}) function to traverse all features on the layer. The screen progress range can be obtained through :ml-search[map.getView()].calculateExtent(map.getSize()), and the returned result is [minLon,minLat,maxLon,maxLat].
[0029] As one embodiment, the map generation command includes but is not limited to the ID of the target person, the date of the target person's walking trajectory, the start time and end time of the target person's walking trajectory. The ID of the target person can be the number registered by the user on the map generation system, or it can be the number registered on the map generation system by the mobile phone that uploads the trajectory data. The ID of the target person is used to determine who the target person is. The date of the target person's walking trajectory is used to determine which day the target person's walking trajectory is. The start time and end time of the target person's walking trajectory are used to determine which time period the target person's walking trajectory is.
[0030] As one embodiment, in step S3, the map generation system filters out valid trajectory data from the array through static screening or / and GPS screening, including the following steps: the map generation system determines whether the static screening is turned on through the locally stored speed filter (isspeed filter). If the static screening is turned on, the map generation system filters out the valid trajectory data through static screening. If the static screening is not turned on, the map generation system determines whether the GPS screening is turned on through the locally stored GPS filter (is GPS filter). If the GPS screening is turned on, the map generation system filters out the valid trajectory data through GPS screening. If the GPS screening is not turned on, the map generation system uses the data in the trajectory data array as the valid trajectory data. The static screening set determines the screening conditions when the data set is created and remains unchanged throughout the life cycle of the data set. It can be used for preliminary screening and filtering of data to reduce the amount of data to be processed subsequently. Static screening includes data preparation, screening condition setting, screening method selection, screening operation, result verification and screening result processing. GPS data screening is an important method to improve the accuracy and reliability of GPS positioning. Through screening, errors or abnormal values in GPS data can be removed or corrected, thereby improving the performance of the navigation system. GPS data screening methods include a variety of technical means based on machine vision, ADSB technology, indoor and outdoor positioning strategies, Python data processing, and physical screening equipment. Each method has its specific application scenarios and advantages, which together improve the accuracy and reliability of GPS data.
[0031] The map generation system may also first determine whether GPS filtering is turned on. If GPS filtering is turned on, the map generation system uses GPS filtering to filter out valid trajectory data. If GPS filtering is not turned on, the map generation system then determines whether static filtering is turned on. If static filtering is turned on, the map generation system uses static filtering to filter out valid data. If static filtering is not turned on, the map generation system uses all trajectory data as valid trajectory data.
[0032] As one embodiment, the map generation system filters out valid trajectory data through static screening, including the following steps: when the map generation system performs static screening, the data of the items in the trajectory data array whose speed is greater than or equal to 5 in the static screening is used as valid trajectory data. The map generation system performs static screening again on the data of the items in the trajectory data array whose speed is less than 5, and when screening, the data of the items in the trajectory data array whose speed is greater than or equal to 5 in the static screening is used as valid trajectory data. By analogy, after the map generation system fails to obtain data from the trajectory data array through static screening, the static screening ends and the valid trajectory data is obtained.
[0033] The map generation system may also first use the data of the items in the trajectory data array whose speed is greater than or equal to 5 as the valid trajectory data, and then filter the data of the items in the trajectory data array whose speed is less than 5 through GPS filtering.
[0034] As one embodiment, the map generation system filters out valid trajectory data through GPS filtering, including the following steps: when the map generation system performs GPS filtering, the data of the items in the trajectory data array whose GPS is equal to 1 are taken as valid trajectory data, and the GPS filtering is ended to obtain the valid trajectory data.
[0035] The map generation system may also first use the data of the items in the trajectory data array whose GPS is equal to 1 as the valid trajectory data, and then filter out the valid data again from the remaining data through static filtering.
[0036] As one embodiment, in step S4, the map generation system converts the valid trajectory data into map coordinate points, including the following steps: the map generation system first initializes the valid trajectory data, where the valid trajectory data is the trajectory data point, and then creates a map through the new BMapGL function. The map generation system converts the longitude and latitude of the valid trajectory data into the longitude and latitude of the map coordinate point through the new BMapGL function. The map generation system sets point = new BMapGLpoint (lng.lat) to convert the initialized longitude and latitude of the valid trajectory data into the longitude and latitude of the map coordinate point, where point refers to the valid trajectory data.
[0037] As one of the embodiments, in step S5, the map generation system converts the map coordinate points in the array into trajectory polylines, including the following steps: the map generation system creates a poly line array, and then puts the map coordinate points into the polyline array. The map generation system converts the map coordinate points in the poly line array into trajectory polylines through a custom rendering function. Poly line is a graphic element used to represent a series of ordered points in computer graphics, which are connected by straight line segments to form a continuous polyline. Poly line can be composed of multiple line segments, each of which is defined by two endpoints. The map generation system lets render line = new BMapGL Poly line (Poly line) to convert the map coordinate points in the poly line array into a trajectory polyline render line that can be rendered to the map.
[0038] As one embodiment, in step S5, the map generation system renders the trajectory line to the map, including the following steps: the map generation system renders the trajectory line to the map through the add overlay function to obtain the path map of the target person. The add overlay function is used to add an overlay layer to the map. The map generation system uses map addoverlay(render line) to render the trajectory line to the map.
[0039] As one embodiment, after the map generation system obtains the path map of the target person, S6: the map generation system calculates the map coordinate points of the trajectory line through the road book function algorithm to obtain the trajectory line that can be played on the path map. The map generation system can control the play, pause and play speed of the trajectory line on the map through lushu start(), lushu pause() and lushu speed.
[0040] A map generation system generates a path map of a target person through the above-mentioned map path automatic generation method.
[0041] Compared with the existing technology, the beneficial effect of the present invention is that when generating a path map, the map path generation system described in the present application first converts the trajectory data of the target person into an array format, then filters out the valid trajectory data from the array through static screening and / or GPS screening, and then converts the valid trajectory data into map coordinate points, so that the accuracy of the map coordinate points is higher, and the accuracy of the path map is improved. The map path generation system first converts the map coordinate points into trajectory polylines, and then places the trajectory polylines on the map by rendering, so that the path map of the target person obtained is more beautiful.
[0042] In the description of the specification, the description with reference to the terms "one embodiment", "preferably", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention, and the schematic expressions of the above terms in this specification do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. The connection method connected in the description of the specification has obvious effects and practical effectiveness.
[0043] Through the description of the above structure and principle, technicians in the relevant technical field should understand that the present invention is not limited to the above-mentioned specific implementation methods. Improvements and substitutions based on the present invention using the well-known technology in the field all fall within the protection scope of the present invention and should be defined by the claims.
Claims
1. A method for automatically generating a map path, characterized in that: The method comprises the following steps: S1: The map generation system receives a map generation command, and then calls the trajectory data of the target person from the database according to the map generation command; S2: The map generation system converts the trajectory data of the target person into an array format, and then filters the trajectory data array; S3: The map generation system selects valid trajectory data from the array through static filtering and / or GPS filtering; S4: The map generation system converts the valid trajectory data into map coordinate points, then creates an empty array and puts the map coordinate points into the empty array; S5: The map generation system converts the map coordinate points in the array into trajectory polylines, and renders the trajectory polylines into the map to obtain a path map of the target person.
2. The method for automatically generating a map path according to claim 1, characterized in that: The map generation command includes but is not limited to the ID of the target person, the date of the target person's walking track, and the start time and end time of the target person's walking track.
3. The method for automatically generating a map path according to claim 1, characterized in that: In step S3, the map generation system selects valid trajectory data from the array by static screening and / or GPS screening, including the following steps: The map generation system uses the locally stored speed filter to determine whether static filtering is turned on; If static filtering is turned on, the map generation system will filter out valid trajectory data through static filtering; If static filtering is not turned on, the map generation system determines whether GPS filtering is turned on by using the locally stored GPS filter; If GPS filtering is turned on, the map generation system will filter out valid track data through GPS filtering; If GPS filtering is not turned on, the map generation system uses the data in the trajectory data array as valid trajectory data.
4. The method for automatically generating a map path according to claim 3, characterized in that: The map generation system filters out valid trajectory data through static filtering, including the following steps: When the map generation system performs static screening, the data of the items in the trajectory data array whose speed is greater than or equal to 5 in the static screening is regarded as valid trajectory data; The map generation system statically screens the data of the items whose speed is less than 5 in the trajectory data array again, and when screening, the data of the items whose speed is greater than or equal to 5 in the trajectory data array in this static screening is used as the valid trajectory data; By analogy, when the map generation system fails to obtain data from the trajectory data array through static filtering, the static filtering ends and valid trajectory data is obtained.
5. The method for automatically generating a map path according to claim 3, characterized in that: The map generation system filters out valid trajectory data through GPS filtering, including the following steps: When the map generation system performs GPS screening, the data of the items in the trajectory data array whose GPS is equal to 1 are taken as valid trajectory data, and the GPS screening is ended to obtain the valid trajectory data.
6. The method for automatically generating a map path according to claim 1, characterized in that: In step S4, the map generation system converts the valid trajectory data into map coordinate points, including the following steps: The map generation system first initializes the valid trajectory data, where the valid trajectory data is the trajectory data point, and then creates the map through the new BMapGL function; The map generation system converts the longitude and latitude of valid trajectory data into the longitude and latitude of map coordinate points through the new BMapGL function.
7. The method for automatically generating a map path according to claim 6, characterized in that: In step S5, the map generation system converts the map coordinate points in the array into trajectory polylines, including the following steps: The map generation system creates a poly line array and then puts the map coordinate points into the poly line array; The map generation system converts the map coordinate points in the poly line array into trajectory polylines through a custom rendering function.
8. The method for automatically generating a map path according to claim 7, characterized in that: In step S5, the map generation system renders the trajectory polyline to the map, including the following steps: The map generation system renders the trajectory polyline into the map through the add overlay function to obtain the path map of the target person.
9. The method for automatically generating a map path according to claim 1, characterized in that: After the map generation system obtains the target person’s path map, S6: The map generation system calculates the map coordinate points of the trajectory polyline through the road book function algorithm to obtain the trajectory polyline that can be played on the path map.
10. A map generation system, characterized in that: The map generation system generates a path map of the target person by using the map path automatic generation method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method and device for generating GPS trajectory curve
CN103809195A
Method and device for generating GPS trajectory curve
CN109870713A
Map motion trail animation implementation method and device, electronic equipment and storage medium
CN111063010A
Unmanned aerial vehicle inspection route construction method
CN111091622A
Internet of vehicles 3D real-time map and 3D track playback system
CN114777798A
Cited By
Motion space dictionary generation method, intelligent device and readable storage medium
CN122020614A
Action space dictionary generation method, intelligent device, and readable storage medium
CN122020614B
