Inverse geocoding method, apparatus, and electronic device

By using hierarchical grids and spatial indexes of geographic description contours in reverse geocoding, the contour information of target features is determined, which solves the problem of low location accuracy in existing technologies, achieves more accurate location description, and improves efficiency in scenarios such as emergency rescue.

CN115525642BActive Publication Date: 2026-06-05CHINA MOBILE SHANGHAI ICT CO LTD +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE SHANGHAI ICT CO LTD
Filing Date
2021-06-25
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing reverse geocoding services can only provide POI-level location descriptions, resulting in low accuracy of location information. This makes it difficult to provide accurate locations, especially in scenarios such as emergency rescue, which affects rescue efficiency.

Method used

By acquiring the target's latitude and longitude coordinates, and utilizing the layered grid and spatial index of geographic description contours in the preset spatial index data, the target's feature contour information is determined, and attribution detection is performed to generate inverse geocoding information of the target's latitude and longitude coordinates, including detailed address descriptions.

Benefits of technology

It improves the accuracy of location information in reverse geocoding, and can provide more specific location descriptions, such as eight levels of address information: 'province-city-district-township/street-road-address-ground building-building', thus enhancing the accuracy of location information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115525642B_ABST
    Figure CN115525642B_ABST
Patent Text Reader

Abstract

The application provides a reverse geocoding method, device and electronic equipment. The method comprises: obtaining a target latitude and longitude coordinate; obtaining target space index data corresponding to the target latitude and longitude coordinate in preset space index data, wherein the preset space index data comprises space indexes of geographical description contours in hierarchical grids, the hierarchical grids comprise a plurality of space grids, and each space grid corresponds to the space index of a geographical feature contour in the geographical description contours; determining target geographical feature contour information corresponding to the target latitude and longitude coordinate according to the target space index data; and performing attribution detection on the target latitude and longitude coordinate according to the target geographical feature contour information to obtain reverse geocoding information of the target latitude and longitude coordinate, wherein the reverse geocoding information comprises address description information used for describing the contained relationship between the target latitude and longitude coordinate and a point of interest (POI). The embodiment of the application can improve the accuracy of obtaining position information through reverse geocoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of positioning technology, and in particular to a reverse geocoding method, apparatus and electronic device. Background Technology

[0002] With the rapid development of electronic devices, more and more users are using them for work, study, and daily life. In situations such as emergency rescue operations where location information is crucial, the ability to quickly and efficiently determine one's precise geographical location has become an urgent need.

[0003] Currently, user location information is usually obtained through reverse geocoding technology. However, existing reverse geocoding services can usually only provide location descriptions at the point of interest (POI) level, which means they can only provide approximate location descriptions, resulting in relatively low accuracy of location information obtained through reverse geocoding. Summary of the Invention

[0004] This invention provides a reverse geocoding method, apparatus, and electronic device to address the problem of low accuracy of location information obtained by reverse geocoding in the prior art.

[0005] In a first aspect, embodiments of the present invention provide a reverse geocoding method, the method comprising:

[0006] Obtain the target's latitude and longitude coordinates;

[0007] Obtain target spatial index data corresponding to the target latitude and longitude coordinates from preset spatial index data. The preset spatial index data includes the spatial index of the geographic description contour in the hierarchical grid. The hierarchical grid includes multiple spatial grids, and each spatial grid corresponds to the spatial index of the land feature contour in the geographic description contour.

[0008] Based on the target spatial index data, determine the target feature outline information corresponding to the target latitude and longitude coordinates;

[0009] Based on the target feature outline information, the target latitude and longitude coordinates are subjected to attribution detection to obtain the inverse geocoding information of the target latitude and longitude coordinates. The inverse geocoding information includes address description information used to describe the inclusion relationship between the target latitude and longitude coordinates and point of interest (POI).

[0010] Secondly, embodiments of the present invention provide a reverse geocoding apparatus, the apparatus comprising:

[0011] The first acquisition module is used to acquire the latitude and longitude coordinates of the target.

[0012] The second acquisition module is used to acquire target spatial index data corresponding to the target latitude and longitude coordinates from preset spatial index data. The preset spatial index data includes the spatial index of the geographic description contour in the hierarchical grid. The hierarchical grid includes multiple spatial grids, and each spatial grid corresponds to the spatial index of the feature contour in the geographic description contour.

[0013] The determination module is used to determine the target feature outline information corresponding to the target latitude and longitude coordinates based on the target spatial index data;

[0014] The attribution detection module is used to perform attribution detection on the latitude and longitude coordinates of the target based on the target feature outline information, and obtain the inverse geocoding information of the target latitude and longitude coordinates. The inverse geocoding information includes address description information describing the inclusion relationship between the target latitude and longitude coordinates and the Point of Interest (POI).

[0015] Thirdly, embodiments of the present invention provide an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the above-described reverse geocoding method.

[0016] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described reverse geocoding method.

[0017] In this embodiment of the invention, the following steps are taken: First, target latitude and longitude coordinates are obtained. Then, target spatial index data corresponding to the target latitude and longitude coordinates is obtained from preset spatial index data. The preset spatial index data includes spatial indexes of geographic description contours in a hierarchical grid. Each hierarchical grid includes multiple spatial grids, and each spatial grid corresponds to a spatial index of a feature contour in the geographic description contour. Based on the target spatial index data, target feature contour information corresponding to the target latitude and longitude coordinates is determined. Finally, the target latitude and longitude coordinates are subjected to attribution detection based on the target feature contour information to obtain inverse geocoding information. This inverse geocoding information includes address description information describing the inclusion relationship between the target latitude and longitude coordinates and Points of Interest (POIs). Thus, by performing attribution detection on the target latitude and longitude coordinates using the target feature contour information, the inclusion relationship between the target latitude and longitude coordinates and feature contours can be obtained. This allows for the acquisition of address description information describing the inclusion relationship between the target latitude and longitude coordinates and POIs, enabling the inverse geocoding service to provide more accurate location information and improving the accuracy of location information obtained through inverse geocoding. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the reverse geocoding method provided in an embodiment of the present invention;

[0020] Figure 2 This is a schematic diagram of the layered mesh division provided in the embodiments of this application;

[0021] Figure 3 This is a schematic diagram of the encoding of the spatial grid provided in the embodiments of this application;

[0022] Figure 4 This is a spatial search diagram of the target feature outline information provided in the embodiments of this application;

[0023] Figure 5 This is a schematic diagram illustrating the relationship between a location point and a polygonal outline of a ground feature, provided in an embodiment of this application.

[0024] Figure 6 This is a schematic diagram illustrating the relationship between location points and road sequence features in an embodiment of this application.

[0025] Figure 7 This is a schematic diagram of the reverse geocoding device provided in an embodiment of the present invention;

[0026] Figure 8 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0027] It should be noted that reverse geocoding services provide the function of converting the latitude and longitude coordinates of an electronic device's location into corresponding location information. As a core capability of location services, it is widely used in mobile map applications, map websites, and in-vehicle navigation software, and has become an integral part of people's daily lives. The electronic device can be a server or a terminal such as a mobile phone or in-vehicle terminal.

[0028] To make it easier to understand, let's first introduce the main content of converting latitude and longitude coordinates into corresponding location information through reverse geocoding.

[0029] Location information mainly includes province, city, district / county, road, house number, and POI, with precise descriptions of province, city, and district / county information. Among these:

[0030] Province information can include the latitude and longitude outlines of each administrative province within China, the province name, the province's administrative division code, and the coordinates of the province's center point.

[0031] City information can include the city's latitude and longitude outline, city name, city administrative division code, city center point coordinates, the name of the province where the city is located, and the administrative division code of the province where the city is located.

[0032] The district / county information may include the latitude and longitude outline of each district / county, the name of the district / county, the administrative division code of the district / county, the coordinates of the center point of the district / county, the name of the province where the district / county is located, the administrative division code of the province where the district / county is located, the name of the city where the district / county is located, and the administrative division code of the city where the district / county is located.

[0033] Road information may include the road's latitude and longitude sequence, road name, province name, city name, district / county name, center point latitude and longitude, and administrative division code to which the road belongs.

[0034] The address information may include the address name, the province where the address is located, the city where the address is located, the district / county where the address is located, the latitude and longitude of the address, and the administrative division code to which the address belongs.

[0035] POI information can include basic information such as name, address, phone number, coordinates, and category, as well as value-added information such as reviews, cost of living, featured recommendations, availability of parking, and credit card payment.

[0036] In addition, location information can also include country information, which can include the latitude and longitude outlines of various countries around the world, country names, and coordinates of the country's center point.

[0037] In related technologies, reverse geocoding uses the above information to compile latitude and longitude coordinates according to the following processing flow to obtain their corresponding reverse geocoding information, which includes multiple address description information of latitude and longitude coordinates. These multiple address description information together determine the location information of latitude and longitude coordinates.

[0038] Taking country A as an example, the specific process of reverse geocoding is as follows:

[0039] To find the name of the province, first determine which province's polygon outline the latitude and longitude coordinates belong to among the provinces of a country, and then confirm the province name.

[0040] Find the city name, and based on the confirmed province name, find all city names under that province. Determine which city's polygon outline the latitude and longitude coordinates belong to, and confirm the city name.

[0041] Find the name of the district / county. Based on the confirmed city name, find all district / county names under that city. Determine which district / county the polygon outline belongs to based on the latitude and longitude coordinates, and confirm the district / county name.

[0042] To find the nearest road, based on the obtained district / county name, extract the road data under that district / county and use a straight-line distance comparison method to obtain the name of the nearest road.

[0043] Find the nearest POI by comparing the distance between the location point and all POI points within that district, based on the obtained district / county name.

[0044] Find the nearest house number and obtain the house number address information corresponding to the obtained POI name.

[0045] Correspondingly, its reverse geocoding information is an address description of "province-city-district-road-house number-POI". Existing reverse geocoding services can usually only provide POI-level location descriptions, that is, only provide approximate location descriptions and cannot provide the user's precise location. Especially when the person reporting the incident cannot describe the current accurate location, it adds difficulty to the police response and delays valuable rescue time.

[0046] Based on the above findings, embodiments of the present invention provide a novel reverse geocoding scheme.

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] The reverse geocoding method provided in the embodiments of the present invention will be described below.

[0049] It should be noted that the reverse geocoding method provided in this embodiment of the invention relates to technical fields such as electronic maps and positioning. This method can be executed by the reverse geocoding device of this embodiment. The reverse geocoding device can be configured in any electronic device to execute the reverse geocoding method; this electronic device can be a server or a terminal, and no specific limitation is made here.

[0050] See Figure 1 The figure shows a flowchart illustrating the reverse geocoding method provided in an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:

[0051] Step 101: Obtain the target latitude and longitude coordinates.

[0052] Here, the latitude and longitude coordinates of the target can be the coordinates of the positioning point, which can be the location of the positioning object, and can include the longitude and latitude coordinates in the geographic coordinate system.

[0053] The latitude and longitude coordinates of the target can be obtained in various ways. For example, they can be obtained through the positioning software of electronic devices such as smartphones or tablets. When a user needs to determine their current location, they can open their terminal device, query their current location, and the terminal device will then call the positioning software to initiate a positioning request. The positioning software will obtain the actual latitude and longitude of the current location through the Global Positioning System (GPS) or BeiDou positioning module, thereby obtaining the latitude and longitude coordinates of the target.

[0054] For example, it can receive the target latitude and longitude coordinates sent by other electronic devices, such as receiving the target latitude and longitude coordinates located by the electronic devices of users in need of rescue.

[0055] Step 102: Obtain the target spatial index data corresponding to the target latitude and longitude coordinates from the preset spatial index data. The preset spatial index data includes the spatial index of the geographic description contour in the hierarchical grid. The hierarchical grid includes multiple spatial grids, and each spatial grid corresponds to the spatial index of the feature contour in the geographic description contour.

[0056] In this step, the preset spatial index data is spatial index data determined based on a pre-set hierarchical grid, which includes the spatial index of geographic description contours within the hierarchical grid. The geographic description contour can refer to a regional contour on an electronic map. This regional contour can be a world-level regional contour, encompassing regions of multiple countries, or a country-level regional contour, encompassing a region of a single country, or a regional contour at other administrative levels. For example, it could be a regional contour of a specific country. The reverse geocoding service can perform reverse geocoding on the target latitude and longitude coordinates of this regional contour to determine the specific location information of the target latitude and longitude coordinates within that regional contour.

[0057] The hierarchical grid can be preset, and the method of setting it is not limited. However, regardless of the method used, it can include multiple spatial grids, and each spatial grid can correspond to a spatial index of the feature outline in the geographic description outline.

[0058] In one optional implementation, a layered grid with a preset number of layers can be set, such that each layer of the layered grid covers the same geographic description contour on the electronic map and contains all feature contour information on that geographic description contour. Furthermore, each layer of the layered grid can be divided into spatial grids, and the spatial index of the target latitude and longitude coordinates can be obtained based on the position of the target latitude and longitude coordinates in the spatial grid of each layer of the layered grid.

[0059] In one example, prior to step 102, the method further includes:

[0060] Obtain a map including the geographic description outline;

[0061] The map is divided into a grid with a preset number of layers to obtain the layered grid. Each layer of the layered grid covers the geographic description outline. The number of spatial grids in the first layer of the layered grid is a preset number. Based on the first layer of the layered grid, the number of spatial grids in each layer of the layered grid increases layer by layer.

[0062] The preset spatial index data is generated based on the correspondence between the spatial grids in the hierarchical grid and the feature outlines in the geographic description outline.

[0063] It's easy to understand that, based on actual needs, a map at a preset administrative level can be obtained, which may include geographical delineation outlines. For example, if the required location information includes the user's country, a world map is needed, which includes global regional outlines. If the user already knows their country and needs location information starting from the province, a map of the current country is needed, which includes national-level regional outlines.

[0064] The map is divided into grids with a preset number of layers to represent the geographic outline, resulting in a layered grid. Each layered grid can include multiple spatial grids. The idea behind creating the spatial grid is to convert the latitude and longitude of the geographic outline into a more granular layered grid. Each layer of the layered grid refines the granularity of the previous layer. The number of grids in the first layer of the spatial grid can be 1, 2, or other values, depending on the requirements.

[0065] Based on the first layer of the hierarchical grid, the number of spatial grids increases progressively in each subsequent layer. Since each layer contains all the feature outlines in the geographic description contour, each spatial grid has a corresponding feature outline. For example, such as... Figure 2 As shown, the number of layers in the hierarchical mesh is set to 16, and the number of spatial grids in the first layer is 2. 0 Next, each floor will be 2 2 Incremental, the second level is 2 0 ×22 = 4 spatial grids, the third layer is 2 0 ×2 2 ×2 2 =8 spatial grids, and so on. The final 16th layer has 1 billion spatial grids. Based on the area of ​​the geographic description contour, the average coverage of a spatial grid in the geographic description contour can be determined. Correspondingly, each spatial grid can contain the contours of land features within the corresponding coverage area of ​​the geographic description contour. Each spatial grid in the layered grid can be assigned an identifier ID to represent a geographic range.

[0066] Since each layer of the hierarchical grid covers the entire outline of the terrain features, the same latitude and longitude coordinates will correspond to multiple spatial grids. Grid coordinate encoding can be performed on the spatial grids in each layer of the hierarchical grid; this grid coordinate encoding is the spatial index of the latitude and longitude coordinates within the hierarchical grid, such as... Figure 3 As shown, the only way to represent a spatial grid is by “layer number encoding, grid coordinate encoding”, such as (3, 5, 5), which represents the spatial grid with coordinates (5, 5) in the 3rd layer.

[0067] As shown in Table 1, there are four groups of latitude and longitude coordinates. Each group can be assigned an ID: ID 10453553940 (coordinates: (121.655313, 41.105908)); ID 10453181960 (coordinates: (122.033664, 41.19394)); ID 10453607176 (coordinates: (123.204077, 41.269867)); and ID 10453607176 (coordinates: (123.363573, 41.780716)). When the number of layers in the grid is 16, each group of latitude and longitude coordinates corresponds to 16 spatial indices, which can be denoted as FIELD1-FIELD16, forming the spatial index of that latitude and longitude coordinate.

[0068] Table 1 Index of Latitude and Longitude Coordinates and Spatial Grid

[0069] ID 10453553940 10453181960 10453607176 10453573217 X coordinate 121.655313 122.033664 123.204077 123.363573 Y coordinate 41.105908 41.19394 41.269867 41.780716 FIELD1 (1,1) (1,1) (1,1) (1,1) FIELD2 (2,2) (2,2) (2,2) (2,2) FIELD3 (3,3) (3,3) (3,3) (3,3) FIELD4 (11,11) (12,11) (13,11) (13,11) FIELD5 (43,42) (47,44) (50,44) (50,45) FIELD6 (175,160) (175,169) (190,171) (199,179) FIELD7 (701,647) (703,684) (764,686) (801,721) FIELD8 (2805,2595) (2815,2744) (3060,2746) (3209,2889) FIELD9 (11221,10387) (11263,10984) (12244,10986) (12841,11561) FIELD10 (44885,41555) (45055,43944) (48980,43946) (51369,46249) FIELD11 (179541,166227) (180223,175784) (195924,175786) (205481,185001) FIELD12 (718165,664915) (720895,703144) (783700,703146) (821929,740009) FIELD13 (2872661,2659667) (2883583,2812584) (3134804,2812586) (3287721,2960041) FIELD14 (11490645,10638675) (11534335,11250344) (12539220,11250346) (13150889,11840169) FIELD15 (45962581,42554707) (46137343,45001384) (50156884,45001386) (52603561,47360681) FIELD16 (183850325,170218835) (184549375,180005544) (200627540,180005546) (210414249,189442729)

[0070] Subsequently, based on the correspondence between the spatial grids in the layered grid and the feature outlines in the geographic description contour, preset spatial index data can be generated. Specifically, preset spatial index data can be generated based on the correspondence between the spatial grids in the layered grid and latitude and longitude coordinates, as well as the correspondence between latitude and longitude coordinates and feature outlines in the geographic description contour. The preset spatial index data may include the spatial index of the latitude and longitude coordinates of each feature outline in the geographic description contour within the layered grid.

[0071] In this embodiment of step 102, by dividing the map including the geographic description outline into a grid with a preset number of layers, each layer of the layered grid is refined based on the previous layer, and each spatial grid contains the corresponding land feature outline, so that the land feature outline can be divided very finely, and the land feature outline information corresponding to the latitude and longitude coordinates can be found quickly through the layered grid, thereby improving the efficiency of reverse geocoding.

[0072] Furthermore, after generating the preset spatial index data, the target spatial index data corresponding to the target latitude and longitude coordinates can be obtained from the preset spatial index data. Specifically, the target spatial index data corresponding to the target latitude and longitude coordinates may only include the spatial index of the target latitude and longitude coordinates in the layered grid. Accordingly, the spatial index of the target latitude and longitude coordinates in the layered grid is obtained from the preset spatial index data to obtain the target spatial index data. Alternatively, the target spatial index data may simultaneously include the target latitude and longitude coordinates and the spatial indices of latitude and longitude coordinates within a certain surrounding area in the layered grid. Accordingly, the area containing the target latitude and longitude coordinates is obtained, and the spatial index corresponding to that area is obtained from the preset spatial index data to obtain the target spatial index data.

[0073] Step 103: Determine the target feature outline information corresponding to the target latitude and longitude coordinates based on the target spatial index data.

[0074] In this step, based on the correspondence between the feature outlines in the target spatial index data and the spatial index, the feature outline information corresponding to the target latitude and longitude coordinates can be determined. The feature outline information can be the feature outlines around the positioning point corresponding to the target latitude and longitude coordinates.

[0075] The target feature outline information may include a first target feature outline of an administrative division, a second target feature outline of at least one road, a third target feature outline of a POI, and a fourth target feature outline of objects within the POI. The administrative division may include provinces, cities, districts, counties, and townships / streets.

[0076] Objects within a Point of Interest (POI) can include buildings. For example, if a POI is a residential community or office park, its internal objects can include buildings such as "Building G13," "Building H16," or "Building H26" within a residential community. Objects within a POI can also include lakes. For instance, if a POI is a tourist park, its internal objects can include lake attractions.

[0077] The terrain features surrounding the location point corresponding to the target latitude and longitude coordinates may or may not include the location point corresponding to the target latitude and longitude coordinates. For example, the location point can only be determined to belong to an administrative region if it is located within that administrative region. Or, if the location point is not located within any of its surrounding POIs, the nearest POI can be determined as the POI corresponding to that location point.

[0078] Step 104: Based on the target feature outline information, perform attribution detection on the target latitude and longitude coordinates to obtain the inverse geocoding information of the target latitude and longitude coordinates. The inverse geocoding information includes address description information describing the inclusion relationship between the target latitude and longitude coordinates and the Point of Interest (POI).

[0079] In this step, the reverse geocoding information of the target latitude and longitude coordinates differs from previous technologies in that it can be divided into more detailed categories. It includes address description information that describes the inclusion relationship between the target latitude and longitude coordinates and the Point of Interest (POI). The location described by this address description information is more specific than the location at the POI level.

[0080] The address description information can vary depending on the location point. For example, when the location point is located inside a POI, that is, when the location point and the POI are contained within each other, the address description information is used to describe the specific location of the location point within the POI that contains the location point.

[0081] For example, when a location point is located outside of all surrounding POIs (points of interest), i.e., when the location point and POIs are not contained within each other, the address description information can include the closest location to the location point within the POIs closest to it, along with the corresponding distance. The closest location to the location point within a POI can include which direction within the POI is closest to the location point, and / or which object within the POI is closest to the location point.

[0082] The reverse geocoding information may also include the administrative division information, road information, and target POI information to which the location point corresponding to the latitude and longitude coordinates of the target belongs. The administrative division information may include province information, city information, and district / county information. In an optional embodiment, the administrative division information may also include township / street information. Township / street information is street information in cities and township information in suburban areas.

[0083] Road information refers to the information of the road closest to the location point, and target POI information refers to the information of the POI containing the location point or the information of the POI closest to the location point.

[0084] In addition, the reverse geocoding information may also include the address information corresponding to the location point. That is, in an optional embodiment, the reverse geocoding information includes province information, city information, district / county information, township / street information, road information, address information, target POI information, and address description information corresponding to the target POI information. The POI corresponding to the target POI information can be a ground building, and the address description information can include target object information. The object corresponding to the target object information can be a building. In this way, the eight-level address information of "province-city-district / county-township / street-road-address-ground building-building" can be finally output, so as to obtain a very specific location description of the location point.

[0085] The methods for determining the attribution of the target latitude and longitude coordinates based on the target feature outline information can include various approaches. For example, the target latitude and longitude coordinates can be compared with the range of latitude and longitude coordinates of the feature outline in the target feature outline information to determine the feature outline information containing the target latitude and longitude coordinates, and correspondingly, the inverse geocoding information of the target latitude and longitude coordinates can be obtained.

[0086] For example, a ray can be drawn based on the position of the target latitude and longitude coordinates in the layered grid, traversing the feature outline in the target feature outline information, so that the ray intersects with the feature outline in the target feature outline information; the inverse geocoding information of the target latitude and longitude coordinates can be determined based on the number of intersections with the feature outline in the target feature outline information.

[0087] For example, the projected distance between the target's latitude and longitude coordinates and the latitude and longitude coordinate sequence of the feature outline in the target feature outline information can be calculated, and the inverse geocoding information of the target's latitude and longitude coordinates can be determined based on the projected distance.

[0088] In this embodiment, the target latitude and longitude coordinates are obtained; target spatial index data corresponding to the target latitude and longitude coordinates is obtained from preset spatial index data. The preset spatial index data includes the spatial index of the geographic description contour in a layered grid. The layered grid includes multiple spatial grids, each spatial grid corresponding to the spatial index of the feature contour in the geographic description contour; target feature contour information corresponding to the target latitude and longitude coordinates is determined based on the target spatial index data; the target latitude and longitude coordinates are subjected to attribution detection based on the target feature contour information to obtain the reverse geocoding information of the target latitude and longitude coordinates. The reverse geocoding information includes address description information describing the inclusion relationship between the target latitude and longitude coordinates and the point of interest (POI). Thus, by performing attribution detection on the target latitude and longitude coordinates using the target feature contour information, the inclusion relationship between the target latitude and longitude coordinates and the feature contour can be obtained, thereby obtaining address description information describing the inclusion relationship between the target latitude and longitude coordinates and the POI. This allows the reverse geocoding service to provide more accurate location information and improves the accuracy of location information obtained through reverse geocoding.

[0089] Optionally, step 102 specifically includes:

[0090] Determine the polygonal outline corresponding to the latitude and longitude coordinates of the target in the geographic description outline;

[0091] Determine the spatial grid covered by the polygonal outline in the layered grid;

[0092] Obtain the target spatial index data that matches the spatial grid covered by the polygon outline from the preset spatial index data.

[0093] In this embodiment, using the target latitude and longitude coordinates and a pre-established hierarchical network, it is possible to search for the outlines of all ground features around the target latitude and longitude coordinates, including the outlines of all points of interest (POIs) around the location point.

[0094] Taking the search for the geographic feature outlines of all POIs surrounding a location point as an example, the polygonal outline corresponding to the target's latitude and longitude coordinates in the geographic description outline can be determined based on the target's latitude and longitude coordinates and radius. This polygonal outline can be a rectangular outline. Figure 4 As shown, the spatial grid marked with diagonal lines represents the target latitude and longitude coordinates of location point 401, i.e., location point X. The outline formed by the spatial grid marked with light color represents the polygon outline 402 corresponding to location point X in the geographic description outline. The spatial grid marked with no color represents the outline of ground features of POIs around other location points.

[0095] By determining which spatial grids in the layered grid the rectangular outline covers, and based on the preset spatial index data, the correspondence between the spatial grids and the feature outlines of the POIs can be obtained. Furthermore, it can be determined which POI feature outlines are around the location point.

[0096] For the feature outlines of POIs that are completely covered by rectangular outlines, all feature outlines of POIs need to be selected as candidate data. For feature outlines of POIs that are partially covered by rectangular outlines, the feature outlines of POIs need to be redrawn, and then the inclusion relationship between the location points and the feature outlines of POIs needs to be determined.

[0097] like Figure 4 As shown, the outlines 403 of building A and 404 of building B are completely covered by the polygonal outline 402 (rectangular outline) of location point X. Using the original outline information, the inclusion relationship between the location point and the POI's feature outline is determined. Building C is partially covered by the rectangular outline of location point X. Therefore, a new feature outline for the POI needs to be redrawn using the boundary between the already covered portion and the rectangular outline of location point X. Figure 4 The polygon outline 405, marked in dark color, represents the redrawn outline of building C.

[0098] In this embodiment, the polygonal outline corresponding to the target latitude and longitude coordinates in the geographic description contour is determined; the spatial grid covered by the polygonal outline in the layered grid is determined; and the target spatial index data matching the spatial grid covered by the polygonal outline is obtained from the preset spatial index data. In this way, all feature outlines around the location point corresponding to the target latitude and longitude coordinates can be searched, thereby improving the accuracy of each address description in the reverse geocoding information.

[0099] Reverse geocoding typically encodes regions from largest to smallest, first determining the administrative division information to which the target's latitude and longitude coordinates belong, including province, city, district / county, and township / street information.

[0100] Optionally, the target feature outline information includes the first target feature outline of the administrative division, and the reverse geocoding information includes the administrative division information to which the target's latitude and longitude coordinates belong. Step 104 specifically includes:

[0101] Draw a ray based on the position of the target's latitude and longitude coordinates in the layered grid, traversing the outline of the first target feature, so that the ray intersects with the outline of the first target feature;

[0102] Based on the number of intersections with the outline of the first target feature, the administrative division information to which the latitude and longitude coordinates of the target belong is determined. The administrative division information includes province information, city information, district / county information, and township / street information.

[0103] In this embodiment, the relationship between the positioning point corresponding to the target latitude and longitude coordinates and the feature outline is determined. If the feature outline is a polygonal outline, a ray can be drawn based on the position of the target latitude and longitude coordinates in the layered grid, traversing the feature outline in the target feature outline information, so that the ray and the feature outline in the target feature outline information form an intersection point. The relationship between the target latitude and longitude coordinates and the feature outline is determined based on the number of intersection points.

[0104] The specific principle is as follows:

[0105] For any closed curve in a plane, it can be considered that the curve divides the plane into two parts: "inner" and "outer". The "inner" refers to the region of the polygonal outline, and the "outer" refers to the region outside the polygonal outline in the plane. When a ray is drawn from a positioning point and the line crosses the boundary of the polygonal outline, there are exactly two possibilities: entering the polygonal outline or exiting the polygonal outline. The line cannot enter the polygonal outline again from the inside or exit the polygonal outline again from the outside. That is, the two consecutive cases of crossing the boundary must be in pairs.

[0106] A straight line can extend infinitely, while the area enclosed by a closed curve is finite. Therefore, the last time a ray crosses the boundary of a polygonal contour, it must exit the polygonal contour and reach the outside. If the locating point is inside the area of ​​the polygonal contour, the first time the ray crosses the boundary, it must exit the polygonal contour. If the locating point is outside the area of ​​the polygonal contour, the first time the ray crosses the boundary, it must enter the polygonal contour.

[0107] When the number of times a ray crosses the boundary of a polygon (i.e., the number of intersections) is even, all even-numbered crossings (including the last one) exit the polygon's outline, and all odd-numbered crossings (including the first one) enter the polygon's outline. Therefore, it can be inferred that the location point is outside the polygon's outline. In other words, it can be determined that the feature outline does not contain the location point. Similarly, when the number of times a ray crosses the boundary of a polygon (i.e., the number of intersections) is odd, it can be determined that the feature outline contains the location point.

[0108] like Figure 5 As shown, the number of times that the positioning point A crosses the polygonal contour is 2 times and 3 times, a total of 5 times, which is an odd number, so it is inside the polygonal contour area. The number of times that the positioning point B crosses the polygonal contour is 1 time and 1 time, a total of 2 times, which is an even number, so it is outside the polygonal contour.

[0109] Correspondingly, by using the above-mentioned method of determining the relationship between the positioning point and the outline of the ground features, the administrative division information to which the target's latitude and longitude coordinates belong can be determined.

[0110] Specifically, based on the relationship between the aforementioned location points and the outlines of geographical features, the target's latitude and longitude coordinates are determined according to the first target feature outline of the country, confirming which country the target belongs to. After confirming the country information, the next step is to determine the province. Specifically, the target's latitude and longitude coordinates are determined according to the first target feature outline of the province, identifying which province within that country the target belongs to. Based on the province confirmation result, the target's latitude and longitude coordinates are further confirmed according to the first target feature outline of the city, identifying which city within that province the target belongs to. Based on the city confirmation result, the district / county information is confirmed, and based on the district / county confirmation result, the township / subdistrict information is further confirmed.

[0111] In this embodiment, the administrative division information to which the target's latitude and longitude coordinates belong is determined by judging the relationship between the above-mentioned positioning point and the outline of the ground features, which can improve the coding accuracy of the administrative division information to which the target's latitude and longitude coordinates belong.

[0112] Optionally, the target feature contour information further includes a second target feature contour of at least one road, and the reverse geocoding information includes the target road information to which the target's latitude and longitude coordinates belong. Step 104 specifically includes:

[0113] Based on the outline of the second target feature, obtain the latitude and longitude sequence of the at least one road;

[0114] Based on the road latitude and longitude sequence, calculate the projected distance between the target latitude and longitude coordinates and each of the at least one road;

[0115] The road information of the road with the shortest projected distance to the target latitude and longitude coordinates among the at least one road is determined as the target road information.

[0116] In this embodiment, the relationship between the positioning point corresponding to the target latitude and longitude coordinates and the outline of the ground feature is judged. If the outline of the ground feature corresponds to a road sequence, the target road information of the target latitude and longitude coordinates can be determined by the projection distance.

[0117] Specifically, such as Figure 6 As shown, the target latitude and longitude coordinates can correspond to at least one road, that is, the target feature outline information can also include the second target feature outline of at least one road, and the road latitude and longitude sequence of the at least one road can be obtained based on the second target feature outline.

[0118] Since the road latitude and longitude sequence includes multiple sets, straight lines representing the roads are fitted based on the road latitude and longitude sequence. A vertical projection is made from the target latitude and longitude coordinates onto the surrounding road straight lines to find the coordinate points where the target latitude and longitude coordinates intersect with each road straight line. The distances between these coordinate points and the target latitude and longitude coordinates are calculated sequentially using the method for calculating the distance between two points. This is the projected distance between the target latitude and longitude coordinates and the road latitude and longitude sequence, and the points are sorted in ascending order of projected distance.

[0119] The road information of the road with the shortest projected distance to the target latitude and longitude coordinates among the at least one road is determined as the target road information.

[0120] In this embodiment, road information around the target latitude and longitude coordinates is obtained based on the outline of the second target feature; the projected distance between the target latitude and longitude coordinates and each of the at least one road is calculated based on the road latitude and longitude sequence; the road information of the road with the shortest projected distance to the target latitude and longitude coordinates among the at least one road is determined as the target road information. In this way, the encoding accuracy of the target road information corresponding to the target latitude and longitude coordinates can be improved.

[0121] Optionally, the target feature contour information further includes the third target feature contour of the POI, and the reverse geocoding information further includes the target POI information corresponding to the target latitude and longitude coordinates. Step 104 specifically includes:

[0122] Based on the position of the target's latitude and longitude coordinates in the layered grid, draw a ray that crosses the outline of the third target feature, so that the ray intersects with the outline of the third target feature;

[0123] Based on the number of intersections formed with the outline of the third target feature, a first inclusion relationship between the latitude and longitude coordinates of the target and the POI corresponding to the outline of the third target feature is determined;

[0124] Based on the first inclusion relationship, the target POI information corresponding to the target latitude and longitude coordinates is determined.

[0125] In this embodiment, the first inclusion relationship between the target latitude and longitude coordinates and the POI corresponding to the third target feature outline includes two types. The first type is that the positioning point corresponding to the target latitude and longitude coordinates is included inside the POI, and the second type is that the positioning point corresponding to the target latitude and longitude coordinates is not included inside all surrounding POIs, that is, the positioning point is outside the POI.

[0126] The first inclusion relationship between the target latitude and longitude coordinates and the POI corresponding to the third target feature outline can be determined based on the number of intersections formed with the outline of the third target feature. That is, when the number of intersections is even, it can be determined that the feature outline of the POI does not contain the location point, and when the number of intersections is odd, it can be determined that the feature outline of the POI contains the location point.

[0127] Based on the first inclusion relationship, the target POI information corresponding to the target latitude and longitude coordinates is determined. Specifically, determining the target POI information corresponding to the target latitude and longitude coordinates based on the first inclusion relationship includes:

[0128] If the target latitude and longitude coordinates are contained within the POI corresponding to the outline of the third target feature in the first inclusion relationship, the information of the POI containing the target latitude and longitude coordinates is determined as the target POI information;

[0129] If the target latitude and longitude coordinates are not contained within the POI corresponding to the third target feature outline as characterized by the first inclusion relationship, the target distance between the target latitude and longitude coordinates and the POI corresponding to the third target feature outline is calculated, and the information of the POI with the shortest target distance to the target latitude and longitude coordinates among the POIs corresponding to the third target feature outline is determined as the target POI information.

[0130] That is, when the location point corresponding to the latitude and longitude coordinates of the target is contained within the POI, the POI containing the location point is determined as the target POI, and the information of the target POI is obtained accordingly.

[0131] When the location point corresponding to the target's latitude and longitude coordinates is not included in all surrounding POIs, the POI closest to that location point is determined as the target POI, and the information of that target POI is obtained accordingly.

[0132] The distance between the POI and the positioning point can be characterized by the distance between the positioning point and the latitude and longitude coordinates of the POI, or by the vertical distance between the positioning point and at least one plane of the POI. No specific limitation is made here.

[0133] In this embodiment, a ray is drawn from the target's latitude and longitude coordinates within the layered grid, traversing the outline of the third target feature, so that the ray intersects with the outline of the third target feature. Based on the number of intersections with the outline of the third target feature, a first inclusion relationship between the target's latitude and longitude coordinates and the POI corresponding to the outline of the third target feature is determined. Based on the first inclusion relationship, the target POI information corresponding to the target's latitude and longitude coordinates is determined. This improves the encoding accuracy of the target POI information corresponding to the target's latitude and longitude. Furthermore, by determining the inclusion relationship between the location point and the POI's feature outline, the error problem when the user is located at multiple feature boundaries can be effectively solved, allowing for more accurate determination of the target POI information and making the reverse geocoding results more accurate.

[0134] After determining the target POI information with its latitude and longitude coordinates, in an optional implementation, to provide a more detailed description of the target's location, inverse geocoding eight-level address information can be provided, specifically "Province-City-District / County-Township / Street-Road-Address-Ground Building-Building". Buildings belong to the eighth level of address, while POIs belong to the seventh level. Geographically, buildings belong to POIs and are considered parent-child data. For example, if the POI name is Residential Community H, then this POI is the "parent data," and its "child data" includes "Building G13," "Building H16," and "Building H26."

[0135] To further improve the accuracy of location description, after determining the relationship between the location point and the POI, high-precision map data can be used to further determine which specific building under the POI corresponds to the target's latitude and longitude coordinates. "Which specific building under the POI corresponds to the target's latitude and longitude coordinates" can refer to which specific building under the POI the target's latitude and longitude coordinates belong to, or which specific building under the POI the target's latitude and longitude coordinates are closest to.

[0136] Unlike the POI contour determination process based on location point affiliation, this method eliminates the need for spatial search of object contours. It can obtain all building contours to be determined based on the parent-child relationship of the identified target POI. By using the relationship between the location point and the building contour and the distance between the location point and the building, the most reasonable building information can be obtained.

[0137] Optionally, when the first inclusion relationship indicates that the POI corresponding to the third target feature outline contains the target latitude and longitude coordinates, the target feature outline information also includes the fourth target feature outline of the object inside the POI corresponding to the target POI information, the reverse geocoding information also includes the target object information corresponding to the target latitude and longitude coordinates, the target object information is the information of the object inside the POI corresponding to the target POI information, the address description information includes the target object information, and step 104 specifically includes:

[0138] Draw a ray through the outline of the fourth target feature based on the position of the target's latitude and longitude coordinates in the layered grid, so that the ray intersects with the outline of the fourth target feature;

[0139] Based on the number of intersections formed with the outline of the fourth target feature, a second inclusion relationship between the latitude and longitude coordinates of the target and the object corresponding to the outline of the fourth target feature is determined;

[0140] Based on the second inclusion relationship, the target object information corresponding to the target latitude and longitude coordinates is determined.

[0141] In this embodiment, when the first inclusion relationship indicates that the POI corresponding to the third target feature outline contains the target latitude and longitude coordinates, the fourth target feature outline of the object inside the POI corresponding to the target POI information can be obtained. Then, based on the relationship between the target latitude and longitude coordinates and the fourth target feature outline, the target object information corresponding to the target latitude and longitude coordinates is determined.

[0142] The second inclusion relationship can include two cases: First, the location point corresponding to the target's latitude and longitude coordinates is included in the objects corresponding to the fourth target feature outline. In this case, the object containing the location point is identified as the target object. Second, the location point corresponding to the target's latitude and longitude coordinates is not included in any of the objects corresponding to the fourth target feature outline. In this case, the object closest to the location point is identified as the target object. Accordingly, the target object information is obtained. The distance between the object in the POI and the location point can be characterized by the distance between the location point and the object's latitude and longitude coordinates, or by the perpendicular distance between the location point and at least one plane of the object; no specific limitation is made here.

[0143] In this embodiment, a ray is drawn from the target's latitude and longitude coordinates within the layered grid, traversing the fourth target feature outline, so that the ray intersects with the fourth target feature outline. Based on the number of intersections with the fourth target feature outline, a second inclusion relationship between the target's latitude and longitude coordinates and the object corresponding to the fourth target feature outline is determined. Based on this second inclusion relationship, the target object information corresponding to the target's latitude and longitude coordinates is determined. This improves the encoding accuracy of the target object information corresponding to the target's latitude and longitude coordinates.

[0144] Optionally, calculating the target distance between the target's latitude and longitude coordinates and the POI corresponding to the third target feature outline includes:

[0145] Based on the outline of the third target feature, obtain the latitude and longitude coordinate range of the POI corresponding to the outline of the third target feature;

[0146] Based on the latitude and longitude coordinate range, at least one plane of the POI corresponding to the third target feature outline is determined;

[0147] Calculate the vertical distance between the target's latitude and longitude coordinates and the at least one plane;

[0148] The shortest vertical distance between the target latitude and longitude coordinates and the at least one plane is determined as the target distance.

[0149] In related technologies, reverse geocoding technology uses a point-to-point straight-line distance calculation method. However, in practice, when a user is at the boundary of multiple land features or inside a large park, industrial area, school, or hospital, the point-to-point straight-line distance calculation method can lead to huge errors in the location description results, affecting the user's timely acquisition of the real location.

[0150] In this embodiment, when the target's latitude and longitude coordinates are not included in all POIs around the positioning point, the target distance between the target's latitude and longitude coordinates and the POI corresponding to the third target feature outline can be calculated using the vector method.

[0151] Among them, the vector method refers to calculating the distance from a point to a plane. It involves placing the point and the plane in a rectangular coordinate system for calculation. This is different from the distance calculation between the location point and the latitude and longitude coordinates of the POI. The result obtained after calculating the distance between the point and the plane is closer to the actual situation.

[0152] Specifically, it could be: Let the equation of the plane τ containing the outline of the third target feature be:

[0153] τ:A x +B y +C z +D=0

[0154] Let vector Let τ be the normal vector, and let M be a point outside the plane. i Given coordinates (x1, y1, z1), take a point M0 on the plane. Then point M... i The distance d to plane τ is:

[0155]

[0156] Where, θ is The included angle,

[0157] therefore, Therefore, in the end

[0158] In this way, by calculating the distance between the target's latitude and longitude coordinates and the outline of the third target feature using the point-to-plane distance calculation method, the vertical distance between the user's location and the POI's plane can be determined more accurately, making the reverse geocoding results more accurate.

[0159] In addition, when acquiring target feature outline information such as the second target feature outline of roads and the second target feature outline of POIs, since it is only necessary to determine it from the feature outlines that are close to the target latitude and longitude coordinates, the feature outlines contained in the last layer or the last few layers of the spatial grid corresponding to the target latitude and longitude coordinates can be obtained. The specific number of spatial grid layers can be selected as needed, and it is not necessary to obtain the feature outlines contained in all layers of spatial grids. Therefore, the amount of data processing can be reduced, thereby improving the efficiency of reverse geocoding.

[0160] The reverse geocoding device provided in the embodiments of the present invention will be described below.

[0161] See Figure 7 The figure shows a schematic diagram of the reverse geocoding device provided in an embodiment of the present invention. Figure 7 As shown, the reverse geocoding device 700 includes:

[0162] The first acquisition module 701 is used to acquire the latitude and longitude coordinates of the target.

[0163] The second acquisition module 702 is used to acquire target spatial index data corresponding to the target latitude and longitude coordinates from preset spatial index data. The preset spatial index data includes the spatial index of the geographic description contour in the hierarchical grid. The hierarchical grid includes multiple spatial grids, and each spatial grid corresponds to the spatial index of the feature contour in the geographic description contour.

[0164] The determining module 703 is used to determine the target feature outline information corresponding to the target latitude and longitude coordinates based on the target spatial index data;

[0165] The attribution detection module 704 is used to perform attribution detection on the latitude and longitude coordinates of the target based on the target feature outline information, and obtain the inverse geocoding information of the target latitude and longitude coordinates. The inverse geocoding information includes address description information describing the inclusion relationship between the target latitude and longitude coordinates and the point of interest (POI).

[0166] Optionally, the device further includes:

[0167] The third acquisition module is used to acquire a map including the geographic description outline;

[0168] The grid division module is used to divide the geographic description contour of the map into a grid with a preset number of layers to obtain the layered grid. Each layer of the layered grid covers the geographic description contour. The number of spatial grids in the first layer of the layered grid is a preset number. Based on the first layer of the layered grid, the number of spatial grids in each layer of the layered grid increases layer by layer.

[0169] The generation module is used to generate the preset spatial index data based on the correspondence between the spatial grids in the hierarchical grid and the feature outlines in the geographic description outline.

[0170] Optionally, the second acquisition module 702 is specifically used for:

[0171] Determine the polygonal outline corresponding to the latitude and longitude coordinates of the target in the geographic description outline;

[0172] Determine the spatial grid covered by the polygonal outline in the layered grid;

[0173] Obtain the target spatial index data that matches the spatial grid covered by the polygon outline from the preset spatial index data.

[0174] Optionally, the target feature outline information includes the first target feature outline of the administrative division, the reverse geocoding information includes the administrative division information to which the target's latitude and longitude coordinates belong, and the attribution detection module 704 is specifically used for:

[0175] Based on the position of the target's latitude and longitude coordinates in the layered grid, draw a ray that crosses the outline of the first target feature, so that the ray intersects with the outline of the first target feature;

[0176] Based on the number of intersections with the outline of the first target feature, the administrative division information to which the latitude and longitude coordinates of the target belong is determined. The administrative division information includes province information, city information, district / county information, and township / street information.

[0177] Optionally, the target feature contour information further includes a second target feature contour of at least one road, the reverse geocoding information includes target road information to which the target's latitude and longitude coordinates belong, and the attribution detection module 704 is further specifically used for:

[0178] Based on the outline of the second target feature, obtain the latitude and longitude sequence of the at least one road;

[0179] Based on the road latitude and longitude sequence, calculate the projected distance between the target latitude and longitude coordinates and each of the at least one road;

[0180] The road information of the road with the shortest projected distance to the target latitude and longitude coordinates among the at least one road is determined as the target road information.

[0181] Optionally, the target feature contour information further includes the third target feature contour of the POI, and the reverse geocoding information further includes the target POI information corresponding to the target latitude and longitude coordinates. The attribution detection module 704 is also specifically used for:

[0182] Based on the position of the target's latitude and longitude coordinates in the layered grid, draw a ray that crosses the outline of the third target feature, so that the ray intersects with the outline of the third target feature;

[0183] Based on the number of intersections formed with the outline of the third target feature, a first inclusion relationship between the latitude and longitude coordinates of the target and the POI corresponding to the outline of the third target feature is determined;

[0184] Based on the first inclusion relationship, the target POI information corresponding to the target latitude and longitude coordinates is determined.

[0185] Optionally, the attribution detection module 704 is specifically used for:

[0186] If the target latitude and longitude coordinates are contained within the POI corresponding to the outline of the third target feature in the first inclusion relationship, the information of the POI containing the target latitude and longitude coordinates is determined as the target POI information;

[0187] If the target latitude and longitude coordinates are not contained within the POI corresponding to the third target feature outline as characterized by the first inclusion relationship, the target distance between the target latitude and longitude coordinates and the POI corresponding to the third target feature outline is calculated, and the information of the POI with the shortest target distance to the target latitude and longitude coordinates among the POIs corresponding to the third target feature outline is determined as the target POI information.

[0188] Optionally, when the first inclusion relationship indicates that the POI corresponding to the third target feature outline contains the target latitude and longitude coordinates, the target feature outline information also includes the fourth target feature outline of the object inside the POI corresponding to the target POI information, the reverse geocoding information also includes the target object information corresponding to the target latitude and longitude coordinates, the target object information is the information of the object inside the POI corresponding to the target POI information, the address description information includes the target object information, and the attribution detection module 704 is further specifically used for:

[0189] Draw a ray through the outline of the fourth target feature based on the position of the target's latitude and longitude coordinates in the layered grid, so that the ray intersects with the outline of the fourth target feature;

[0190] Based on the number of intersections formed with the outline of the fourth target feature, a second inclusion relationship between the latitude and longitude coordinates of the target and the object corresponding to the outline of the fourth target feature is determined;

[0191] Based on the second inclusion relationship, the target object information corresponding to the target latitude and longitude coordinates is determined.

[0192] Optionally, the attribution detection module 704 is specifically used for:

[0193] Based on the outline of the third target feature, obtain the latitude and longitude coordinate range of the POI corresponding to the outline of the third target feature;

[0194] Based on the latitude and longitude coordinate range, at least one plane of the POI corresponding to the third target feature outline is determined;

[0195] Calculate the vertical distance between the target's latitude and longitude coordinates and the at least one plane;

[0196] The shortest vertical distance between the target latitude and longitude coordinates and the at least one plane is determined as the target distance.

[0197] The reverse geocoding device 700 can implement all the processes implemented in the above-described reverse geocoding method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0198] The electronic device provided in the embodiments of the present invention will be described below.

[0199] See Figure 8 The figure shows a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 8 As shown, the electronic device 800 includes: a processor 801, a memory 802, a user interface 803, and a bus interface 804.

[0200] Processor 801 is used to read the program from memory 802 and execute the following procedures:

[0201] Obtain the target's latitude and longitude coordinates;

[0202] Obtain target spatial index data corresponding to the target latitude and longitude coordinates from preset spatial index data. The preset spatial index data includes the spatial index of the geographic description contour in the hierarchical grid. The hierarchical grid includes multiple spatial grids, and each spatial grid corresponds to the spatial index of the land feature contour in the geographic description contour.

[0203] Based on the target spatial index data, determine the target feature outline information corresponding to the target latitude and longitude coordinates;

[0204] Based on the target feature outline information, the target latitude and longitude coordinates are subjected to attribution detection to obtain the inverse geocoding information of the target latitude and longitude coordinates. The inverse geocoding information includes address description information used to describe the inclusion relationship between the target latitude and longitude coordinates and point of interest (POI).

[0205] exist Figure 8 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 801 and memory represented by memory 802 together. The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 804 provides an interface. For different user devices, user interface 803 can also be an interface capable of connecting external or internal devices, including but not limited to keypads, displays, speakers, microphones, joysticks, etc.

[0206] The processor 801 is responsible for managing the bus architecture and general processing, while the memory 802 can store the data used by the processor 801 when performing operations.

[0207] Optionally, the processor 801 is also used for:

[0208] Obtain a map including the geographic description outline;

[0209] The map is divided into a grid with a preset number of layers to obtain the layered grid. Each layer of the layered grid covers the geographic description outline. The number of spatial grids in the first layer of the layered grid is a preset number. Based on the first layer of the layered grid, the number of spatial grids in each layer of the layered grid increases layer by layer.

[0210] The preset spatial index data is generated based on the correspondence between the spatial grids in the hierarchical grid and the feature outlines in the geographic description outline.

[0211] Optionally, the processor 801 is also used for:

[0212] Determine the polygonal outline corresponding to the latitude and longitude coordinates of the target in the geographic description outline;

[0213] Determine the spatial grid covered by the polygonal outline in the layered grid;

[0214] Obtain the target spatial index data that matches the spatial grid covered by the polygon outline from the preset spatial index data.

[0215] Optionally, the target feature outline information includes the first target feature outline of the administrative division, and the reverse geocoding information includes the administrative division information to which the target's latitude and longitude coordinates belong. The processor 801 is further configured to:

[0216] Based on the position of the target's latitude and longitude coordinates in the layered grid, draw a ray that crosses the outline of the first target feature, so that the ray intersects with the outline of the first target feature;

[0217] Based on the number of intersections with the outline of the first target feature, the administrative division information to which the latitude and longitude coordinates of the target belong is determined. The administrative division information includes province information, city information, district / county information, and township / street information.

[0218] Optionally, the target feature contour information further includes a second target feature contour of at least one road, and the reverse geocoding information includes target road information to which the target's latitude and longitude coordinates belong. The processor 801 is further configured to:

[0219] Based on the outline of the second target feature, obtain the latitude and longitude sequence of the at least one road;

[0220] Based on the road latitude and longitude sequence, calculate the projected distance between the target latitude and longitude coordinates and each of the at least one road;

[0221] The road information of the road with the shortest projected distance to the target latitude and longitude coordinates among the at least one road is determined as the target road information.

[0222] Optionally, the target feature contour information further includes a third target feature contour of the POI, and the reverse geocoding information further includes the target POI information corresponding to the target latitude and longitude coordinates. The processor 801 is further configured to:

[0223] Based on the position of the target's latitude and longitude coordinates in the layered grid, draw a ray that crosses the outline of the third target feature, so that the ray intersects with the outline of the third target feature;

[0224] Based on the number of intersections formed with the outline of the third target feature, a first inclusion relationship between the latitude and longitude coordinates of the target and the POI corresponding to the outline of the third target feature is determined;

[0225] Based on the first inclusion relationship, the target POI information corresponding to the target latitude and longitude coordinates is determined.

[0226] Optionally, the processor 801 is also used for:

[0227] If the target latitude and longitude coordinates are contained within the POI corresponding to the outline of the third target feature in the first inclusion relationship, the information of the POI containing the target latitude and longitude coordinates is determined as the target POI information;

[0228] If the target latitude and longitude coordinates are not contained within the POI corresponding to the third target feature outline as characterized by the first inclusion relationship, the target distance between the target latitude and longitude coordinates and the POI corresponding to the third target feature outline is calculated, and the information of the POI with the shortest target distance to the target latitude and longitude coordinates among the POIs corresponding to the third target feature outline is determined as the target POI information.

[0229] Optionally, when the first inclusion relationship indicates that the POI corresponding to the third target feature outline contains the target latitude and longitude coordinates, the target feature outline information also includes the fourth target feature outline of the object inside the POI corresponding to the target POI information, the reverse geocoding information also includes the target object information corresponding to the target latitude and longitude coordinates, the target object information is the information of the object inside the POI corresponding to the target POI information, the address description information includes the target object information, and the processor 801 is further configured to:

[0230] Draw a ray through the outline of the fourth target feature based on the position of the target's latitude and longitude coordinates in the layered grid, so that the ray intersects with the outline of the fourth target feature;

[0231] Based on the number of intersections formed with the outline of the fourth target feature, a second inclusion relationship between the latitude and longitude coordinates of the target and the object corresponding to the outline of the fourth target feature is determined;

[0232] Based on the second inclusion relationship, the target object information corresponding to the target latitude and longitude coordinates is determined.

[0233] Optionally, the processor 801 is also used for:

[0234] Based on the outline of the third target feature, obtain the latitude and longitude coordinate range of the POI corresponding to the outline of the third target feature;

[0235] Based on the latitude and longitude coordinate range, at least one plane of the POI corresponding to the third target feature outline is determined;

[0236] Calculate the vertical distance between the target's latitude and longitude coordinates and the at least one plane;

[0237] The shortest vertical distance between the target latitude and longitude coordinates and the at least one plane is determined as the target distance.

[0238] Preferably, the present invention also provides an electronic device, including a processor 801, a memory 802, and a computer program stored in the memory 802 and executable on the processor 801. When the computer program is executed by the processor 801, it implements the various processes of the above-described reverse geocoding method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0239] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described reverse geocoding method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0240] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0241] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0242] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0243] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.

[0244] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0245] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion 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 described in 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, ROM, RAM, magnetic disks, or optical disks.

[0246] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A reverse geocoding method, characterized in that, The method includes: Obtain the target's latitude and longitude coordinates; Obtain target spatial index data corresponding to the target latitude and longitude coordinates from preset spatial index data. The preset spatial index data includes the spatial index of the geographic description contour in the hierarchical grid. The hierarchical grid includes multiple spatial grids, and each spatial grid corresponds to the spatial index of the land feature contour in the geographic description contour. Based on the target spatial index data, determine the target feature outline information corresponding to the target latitude and longitude coordinates; Based on the target feature outline information, the target latitude and longitude coordinates are subjected to attribution detection to obtain the inverse geocoding information of the target latitude and longitude coordinates. The inverse geocoding information includes address description information used to describe the inclusion relationship between the target latitude and longitude coordinates and the Point of Interest (POI). The target feature outline information includes a first target feature outline of an administrative division, a second target feature outline of at least one road, and a third target feature outline of a POI. The reverse geocoding information also includes administrative division information to which the target latitude and longitude coordinates belong, target road information to which the target latitude and longitude coordinates belong, and target POI information corresponding to the target latitude and longitude coordinates. The step of performing attribution detection on the target latitude and longitude coordinates based on the target feature outline information to obtain the reverse geocoding information of the target latitude and longitude coordinates includes: Based on the position of the target's latitude and longitude coordinates in the layered grid, draw a ray that crosses the outline of the first target feature, so that the ray intersects with the outline of the first target feature; Based on the number of intersections with the outline of the first target feature, the administrative division information to which the latitude and longitude coordinates of the target belong is determined. The administrative division information includes province information, city information, district / county information, and township / street information. Based on the outline of the second target feature, obtain the latitude and longitude sequence of the at least one road; Based on the road latitude and longitude sequence, calculate the projected distance between the target latitude and longitude coordinates and each of the at least one road; The road information of the road with the shortest projected distance to the target latitude and longitude coordinates among the at least one roads is determined as the target road information; Based on the position of the target's latitude and longitude coordinates in the layered grid, draw a ray that crosses the outline of the third target feature, so that the ray intersects with the outline of the third target feature; Based on the number of intersections formed with the outline of the third target feature, a first inclusion relationship between the latitude and longitude coordinates of the target and the POI corresponding to the outline of the third target feature is determined; Based on the first inclusion relationship, the target POI information corresponding to the target latitude and longitude coordinates is determined.

2. The reverse geocoding method according to claim 1, characterized in that, Before obtaining the target spatial index data corresponding to the target latitude and longitude coordinates from the preset spatial index data, the method further includes: Obtain a map including the geographic description outline; The map is divided into a grid with a preset number of layers to obtain the layered grid. Each layer of the layered grid covers the geographic description outline. The number of spatial grids in the first layer of the layered grid is a preset number. Based on the first layer of the layered grid, the number of spatial grids in each layer of the layered grid increases layer by layer. The preset spatial index data is generated based on the correspondence between the spatial grids in the hierarchical grid and the feature outlines in the geographic description outline.

3. The reverse geocoding method according to claim 1, characterized in that, The step of obtaining the target spatial index data corresponding to the target latitude and longitude coordinates from the preset spatial index data includes: Determine the polygonal outline corresponding to the latitude and longitude coordinates of the target in the geographic description outline; Determine the spatial grid covered by the polygonal outline in the layered grid; Obtain the target spatial index data that matches the spatial grid covered by the polygon outline from the preset spatial index data.

4. The reverse geocoding method according to claim 1, characterized in that, The step of determining the target POI information corresponding to the target latitude and longitude coordinates based on the first inclusion relationship includes: If the target latitude and longitude coordinates are contained within the POI corresponding to the outline of the third target feature in the first inclusion relationship, the information of the POI containing the target latitude and longitude coordinates is determined as the target POI information; If the target latitude and longitude coordinates are not contained within the POI corresponding to the third target feature outline as characterized by the first inclusion relationship, the target distance between the target latitude and longitude coordinates and the POI corresponding to the third target feature outline is calculated, and the information of the POI with the shortest target distance to the target latitude and longitude coordinates among the POIs corresponding to the third target feature outline is determined as the target POI information.

5. The reverse geocoding method according to claim 4, characterized in that, In the case where the first inclusion relationship characterizes the POI corresponding to the third target feature outline as containing the target latitude and longitude coordinates, the target feature outline information also includes the fourth target feature outline of the object inside the POI corresponding to the target POI information. The reverse geocoding information also includes the target object information corresponding to the target latitude and longitude coordinates. The target object information is the information of the object inside the POI corresponding to the target POI information. The address description information includes the target object information. The step of performing attribution detection on the target latitude and longitude coordinates based on the target feature outline information to obtain the reverse geocoding information of the target latitude and longitude coordinates includes: Draw a ray through the outline of the fourth target feature based on the position of the target's latitude and longitude coordinates in the layered grid, so that the ray intersects with the outline of the fourth target feature; Based on the number of intersections formed with the outline of the fourth target feature, a second inclusion relationship between the latitude and longitude coordinates of the target and the object corresponding to the outline of the fourth target feature is determined; Based on the second inclusion relationship, the target object information corresponding to the target latitude and longitude coordinates is determined.

6. The reverse geocoding method according to claim 4, characterized in that, The calculation of the target distance between the target's latitude and longitude coordinates and the POI corresponding to the third target feature outline includes: Based on the outline of the third target feature, obtain the latitude and longitude coordinate range of the POI corresponding to the outline of the third target feature; Based on the latitude and longitude coordinate range, at least one plane of the POI corresponding to the third target feature outline is determined; Calculate the vertical distance between the target's latitude and longitude coordinates and the at least one plane; The shortest vertical distance between the target latitude and longitude coordinates and the at least one plane is determined as the target distance.

7. A reverse geocoding device, characterized in that, The device includes: The first acquisition module is used to acquire the latitude and longitude coordinates of the target. The second acquisition module is used to acquire target spatial index data corresponding to the target latitude and longitude coordinates from preset spatial index data. The preset spatial index data includes the spatial index of the geographic description contour in the hierarchical grid. The hierarchical grid includes multiple spatial grids, and each spatial grid corresponds to the spatial index of the feature contour in the geographic description contour. The determination module is used to determine the target feature outline information corresponding to the target latitude and longitude coordinates based on the target spatial index data; The attribution detection module is used to perform attribution detection on the latitude and longitude coordinates of the target based on the target feature outline information, and obtain the inverse geocoding information of the target latitude and longitude coordinates. The inverse geocoding information includes address description information that describes the inclusion relationship between the target latitude and longitude coordinates and the point of interest (POI). The target feature outline information includes the first target feature outline of the administrative division, the reverse geocoding information includes the administrative division information to which the target's latitude and longitude coordinates belong, and the attribution detection module is specifically used for: Draw a ray based on the position of the target's latitude and longitude coordinates in the layered grid, traversing the outline of the first target feature, so that the ray intersects with the outline of the first target feature; Based on the number of intersections with the outline of the first target feature, the administrative division information to which the latitude and longitude coordinates of the target belong is determined. The administrative division information includes province information, city information, district / county information, and township / street information. The target feature contour information also includes a second target feature contour of at least one road, and the reverse geocoding information includes the target road information to which the target's latitude and longitude coordinates belong. The attribution detection module is further specifically used for: Based on the outline of the second target feature, obtain the latitude and longitude sequence of the at least one road; Based on the road latitude and longitude sequence, calculate the projected distance between the target latitude and longitude coordinates and each of the at least one road; The road information of the road with the shortest projected distance to the target latitude and longitude coordinates among the at least one roads is determined as the target road information; The target feature contour information also includes the third target feature contour of the POI, and the reverse geocoding information also includes the target POI information corresponding to the target latitude and longitude coordinates. The attribution detection module is further specifically used for: Based on the position of the target's latitude and longitude coordinates in the layered grid, draw a ray that crosses the outline of the third target feature, so that the ray intersects with the outline of the third target feature; Based on the number of intersections formed with the outline of the third target feature, a first inclusion relationship between the latitude and longitude coordinates of the target and the POI corresponding to the outline of the third target feature is determined; Based on the first inclusion relationship, the target POI information corresponding to the target latitude and longitude coordinates is determined.

8. An electronic device, characterized in that, The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the reverse geocoding method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the reverse geocoding method as described in any one of claims 1 to 6.