Disclosure of Invention
The application relates to a city query method, device, equipment and storage medium based on longitude and latitude, which can reduce the calculation amount of computer equipment, improve the search efficiency and reduce the excessive occupation of computer calculation resources in the scene of mapping cities by the longitude and latitude of billions. The technical scheme is as follows:
in one aspect, a city query method based on longitude and latitude is provided, the method comprising:
acquiring a target longitude and latitude;
converting the target longitude and latitude into a target Geohash code;
inquiring in a map index based on the target Geohash code to obtain a target Geohash area; the map index comprises the corresponding relation between each index area and the Geohash code; each index area comprises a first type index area, and the first type index area comprises at least two drop point areas;
determining a target drop point area of the target longitude and latitude in the target Geohash area in response to the target Geohash area being the first type index area; the target drop point area is one of at least two drop point areas contained in the target Geohash area;
and determining a city query result corresponding to the longitude and latitude of the target based on the target landing area.
In a possible implementation manner, the determining, in response to that the target Geohash region is the first type index region, a target landing point region of the target longitude and latitude in the target Geohash region includes:
responding to the target Geohash area as the first type index area, and performing ray calculation on at least two drop point areas contained in the target Geohash area based on the target longitude and latitude; and determining the target landing point area based on the ray calculation result.
In one possible implementation, the determining the target landing point region based on the ray calculation result includes:
and obtaining the falling point areas with the odd ray calculation results as the target falling point areas in the at least two falling point areas.
In a possible implementation manner, each of the landing areas corresponds to a different city code, and determining a city query result corresponding to the target longitude and latitude based on the target landing area includes:
determining a city code corresponding to the drop point area based on the target drop point area;
and outputting the city query result corresponding to the target longitude and latitude based on the city code.
In a possible implementation manner, each index area includes a second type index area, and the method further includes:
responding to the target Geohash area as the second type index area, and determining the city query result corresponding to the target longitude and latitude based on the Geohash code of the target Geohash area; the second-type index region contains a single drop point region.
In one possible implementation, before the obtaining the target longitude and latitude, the method includes:
obtaining a polygon corresponding to at least one city, wherein the polygon corresponding to the at least one city is constructed based on city boundary data of the at least one city;
determining a Geohash area based on points on a polygon corresponding to a target city to obtain a first type index area corresponding to the target city; each Geohash area is provided with a corresponding Geohash code; the target city is any one of the at least one city;
acquiring a second type index area corresponding to the target city based on the first type index area corresponding to the target city and the polygon corresponding to the target city;
and constructing a city index of the target city based on the first type index area corresponding to the target city and the second type index area corresponding to the target city.
In a possible implementation manner, the constructing the city index of the target city based on the first type index area corresponding to the target city and the second type index area corresponding to the target city includes:
obtaining effective drop point areas corresponding to the target city in at least two drop point areas in a first type index area corresponding to the target city;
and constructing a city index of the target city based on the second type index area corresponding to the target city and the effective drop point area corresponding to the target city in the first type index area corresponding to the target city.
In a possible implementation manner, the polygon corresponding to the at least one city is constructed by connecting the city boundary data of the at least one city according to a specified direction;
the obtaining of the effective drop point areas corresponding to the target city in at least two drop point areas in the first type index area corresponding to the target city includes:
and acquiring effective drop point areas corresponding to the target city in at least two drop point areas of the first type index area corresponding to the target city based on the edge of the polygon corresponding to the target city and the designated direction.
In one possible implementation, the specified direction includes a clockwise direction and a counterclockwise direction;
obtaining, from the at least two drop point areas of the first type index area, an effective drop point area corresponding to the target city based on the edge of the polygon corresponding to the target city and the designated direction, including:
in response to that the designated direction is clockwise, acquiring a drop point area of a first type index corresponding to the target city on the left side of the edge of the polygon corresponding to the target city as an effective drop point area corresponding to the target city;
and in response to the fact that the designated direction is the anticlockwise direction, acquiring a drop point area of a first type index area corresponding to the target city on the right side of the polygon corresponding to the target city as an effective drop point area corresponding to the target city.
In a possible implementation manner, the obtaining, based on the polygon corresponding to the target city and the first type index area corresponding to the target city, the second type index area corresponding to the target city includes:
acquiring a minimum adjacent rectangle of a polygon corresponding to the target city;
and determining a second type index area corresponding to the target city based on the Geohash area contained in the minimum adjacent rectangle and the first type index area corresponding to the target city.
In a possible implementation manner, the determining, based on the Geohash region in the minimum adjacent rectangle and the first-type index region corresponding to the target city, the second-type index region corresponding to the target city includes:
acquiring a Geohash area to be determined in Geohash areas contained in the minimum adjacent rectangle, wherein the Geohash area to be determined is a Geohash area except for a first type index area corresponding to the target city in the minimum adjacent rectangle;
performing ray calculation on a polygon corresponding to the target city based on the Geohash area to be determined;
and determining a second type index area corresponding to the target city based on the ray calculation result.
In a possible implementation manner, the determining, based on the ray calculation result, a second type index area corresponding to the target city includes:
and obtaining a Geohash area with an odd-numbered ray calculation result of each edge of the polygon corresponding to the target city in the Geohash area to be determined as a second type index area corresponding to the target city.
In a possible implementation manner, the constructing the city index of the target city based on the second type index area corresponding to the target city and the effective drop point area corresponding to the target city in the first type index area corresponding to the target city includes:
establishing a first mapping relation between a second type index area corresponding to the target city and a city code of the target city;
establishing a second mapping relation between the effective drop point area corresponding to the target city in the first type index area corresponding to the target city and the city code of the target city;
and acquiring the first mapping relation and the second mapping relation as city indexes of the target city.
In another aspect, a city inquiry apparatus based on longitude and latitude is provided, the apparatus comprising:
the longitude and latitude acquisition module is used for acquiring the longitude and latitude of a target;
the Geohash code conversion module is used for converting the target longitude and latitude into a target Geohash code;
the Geohash area acquisition module is used for inquiring in a map index based on the target Geohash code to obtain a target Geohash area; the map index comprises the corresponding relation between each index area and the Geohash code; each index area comprises a first type index area, and the first type index area comprises at least two drop point areas;
a drop point area determination module, configured to determine, in response to that the target Geohash area is the first type index area, a target drop point area where the target longitude and latitude are in the target Geohash area; the target drop point area is one of at least two drop point areas contained in the target Geohash area;
and the first city query result determining module is used for determining a city query result corresponding to the target longitude and latitude based on the target landing point area.
In a possible implementation manner, the drop point region determining module includes:
the ray calculation sub-module is used for responding to the first type index area as the target Geohash area, and performing ray calculation on at least two drop point areas contained in the target Geohash area based on the target longitude and latitude;
and the drop point area determining submodule is used for determining the target drop point area based on the ray calculation result.
In a possible implementation manner, the drop point region determining submodule is configured to determine that, of the at least two drop point regions, a drop point region with an odd number of the ray calculation results is the target drop point region.
In a possible implementation manner, each of the drop point areas corresponds to a different city code, and the first city query result determining module includes:
the city code determining submodule is used for determining a city code corresponding to the drop point area based on the target drop point area;
and the city query result output submodule is used for outputting the city query result corresponding to the target longitude and latitude based on the city code.
In a possible implementation manner, each of the index regions includes a second type index region, and the apparatus further includes:
a second city query result determining module, configured to determine, in response to the target Geohash region being the second type index region, the city query result corresponding to the target longitude and latitude based on the Geohash code of the target Geohash region; the second-type index region contains a single drop point region.
In one possible implementation, the apparatus further includes:
the system comprises a polygon obtaining module, a polygon obtaining module and a polygon setting module, wherein the polygon obtaining module is used for obtaining a polygon corresponding to at least one city, and the polygon corresponding to the at least one city is constructed based on city boundary data of the at least one city;
the first type index area acquisition module is used for determining a Geohash area based on points on a polygon corresponding to a target city and acquiring a first type index area corresponding to the target city; each Geohash area is provided with a corresponding Geohash code; the target city is any one of the at least one city;
a second type index area obtaining module, configured to obtain a second type index area corresponding to the target city based on the first type index area corresponding to the target city and the polygon corresponding to the target city;
and the city index building module is used for building a city index of the target city based on the first type index area corresponding to the target city and the second type index area corresponding to the target city.
In one possible implementation manner, the city index building module includes:
the effective drop point area obtaining submodule is used for obtaining effective drop point areas corresponding to the target city in at least two drop point areas in the first type index area corresponding to the target city;
and the city index construction submodule is used for constructing the city index of the target city based on the second type index area corresponding to the target city and the effective drop point area corresponding to the target city in the first type index area corresponding to the target city.
In a possible implementation manner, the polygon corresponding to the at least one city is constructed by connecting the city boundary data of the at least one city according to a specified direction;
the effective drop point area obtaining submodule is configured to obtain, based on the edge of the polygon corresponding to the target city and the designated direction, effective drop point areas corresponding to the target city in at least two drop point areas of the first type index area corresponding to the target city.
In one possible implementation, the specified direction includes a clockwise direction and a counterclockwise direction;
the effective drop point region obtaining submodule comprises:
a first effective drop point region obtaining unit, configured to, in response to that the specified direction is a clockwise direction, obtain a drop point region of a first type index corresponding to the target city on a right side of a polygon corresponding to the target city as an effective drop point region corresponding to the target city;
and a second effective drop point area obtaining unit, configured to, in response to that the designated direction is a counterclockwise direction, obtain a drop point area of a first type index area corresponding to the target city on a left side of a side of the polygon corresponding to the target city as an effective drop point area corresponding to the target city.
In a possible implementation manner, the second-type index area obtaining module includes:
a minimum adjacent rectangle obtaining submodule, configured to obtain a minimum adjacent rectangle of a polygon corresponding to the target city;
and the second type index area determining submodule is used for determining a second type index area corresponding to the target city based on the Geohash area contained in the minimum adjacent rectangle and the first type index area corresponding to the target city.
In a possible implementation manner, the second-type index area determining sub-module includes:
a to-be-determined Geohash region obtaining unit, configured to obtain a to-be-determined Geohash region in Geohash regions included in the minimum adjacent rectangle, where the to-be-determined Geohash region is a Geohash region in the minimum adjacent rectangle except for a first type index region corresponding to the target city;
a ray calculation unit, configured to perform ray calculation on a polygon corresponding to the target city based on the Geohash region to be determined;
and the second type index area determining unit is used for determining a second type index area corresponding to the target city based on the ray calculation result.
In a possible implementation manner, the second-type index region determining unit is configured to obtain, in the geo-hash region to be determined, a geo-hash region in which a result of ray calculation on each edge of a polygon corresponding to the target city is an odd number is the second-type index region corresponding to the target city.
In one possible implementation, the city index building module includes:
the first mapping relation establishing submodule is used for establishing a first mapping relation between a second type index area corresponding to the target city and the city code of the target city;
a second mapping relation establishing submodule, configured to establish a second mapping relation between an effective drop point area corresponding to the target city in the first type index area corresponding to the target city and a city code of the target city;
and the city index obtaining submodule is used for obtaining the first mapping relation and the second mapping relation as the city index of the target city.
In another aspect, a computer device is provided, which includes a processor and a memory, where at least one instruction, at least one program, a code set, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement the longitude and latitude based city query method provided in the embodiment of the present application.
In another aspect, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set, or a set of instructions is stored, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by a processor to implement the longitude and latitude-based city query method provided in the embodiment of the present application.
In another aspect, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the longitude and latitude-based city query method provided in the above-mentioned various optional implementations.
The beneficial effect that technical scheme that this application provided brought includes at least:
the method comprises the steps of carrying out initial positioning through Geohash codes corresponding to target longitude and latitude coordinates, and when a target Geohash area of the Geohash codes corresponding to the target longitude and latitude coordinates is located at a certain city boundary, carrying out accurate positioning through the target longitude and latitude coordinates in the target Geohash area so as to determine a city query result corresponding to the target longitude and latitude, so that under a scene that the longitude and latitude of a billion level is mapped to a city, in the process of carrying out city query through the longitude and latitude, the calculation amount of computer equipment is reduced, the search performance of the computer equipment is improved, and excessive occupation of computing resources of the computer equipment caused by the city query is reduced.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
First, the terms referred to in the embodiments of the present application will be briefly described:
the GeoHash index is a spatial index algorithm based on a B-tree (B-tree) index and combined with the idea of grid index. The GeoHash codes the space position into a string of characters, the approximate range of the space can be obtained through comparison of the character strings, and the longer the character string is, the more accurate the represented range is.
Fig. 1 shows a flowchart of a GeoHash encoding process shown in an exemplary embodiment of the present application, where the process includes:
and S101, acquiring geographic coordinates.
The geographic coordinates are latitude and longitude coordinates.
And S102, carrying out recursive segmentation on the longitude and latitude coordinates to obtain binary codes corresponding to the longitude and the latitude respectively.
The latitude interval of the earth is (-90, 90), and the longitude interval of the earth is (-180, 180); when generating the Geohash codes corresponding to the longitude and latitude coordinates, binary coding is performed by continuously reducing the intervals of the longitude and latitude by adopting a bisection method, taking the longitude and latitude coordinates as (114.360734E, 30.541093N) as an example, for the longitude, the median of the (-180, 180) interval is 0, and the longitude interval (-180, 180) is halved to obtain a left interval (-180, 0) and a right interval (0, 180), and for the longitude 114.360734, it can be determined that the left interval (0, 180) is located, so that a 1 is obtained; then, the interval (0, 180) is divided into a left interval (0, 90) and a right interval (90, 180) in two, and it can be determined that the longitude 114.360734 belongs to the right interval (90, 180), and thus is written as 1; recursion of the above process, if longitude 114.360734 belongs to the left interval, it is recorded as 0, if it belongs to the right interval, it is recorded as 1, and finally the binary sequence of longitude 114.360734 is obtained as 110100010101001; table 1 shows a longitude binary representation provided by an exemplary embodiment of the present application.
TABLE 1
|
Longitude range
|
Partition area 0
|
Dividing compartment 1
|
114.360734
|
1
|
(-180,180)
|
(-180,0)
|
(0,180)
|
1
|
2
|
(0,180)
|
(0,90)
|
(90,180)
|
1
|
3
|
(90,180)
|
(90,135)
|
(135,180)
|
0
|
4
|
(90,135)
|
(90,112.5)
|
(112.5,135)
|
1
|
5
|
(112.5,135)
|
(112.5,123.75)
|
(123.75,135)
|
0
|
6
|
(112.5,123.75)
|
(112.5,118.125)
|
(118.125,123.75)
|
0
|
…
|
…
|
…
|
…
|
… |
For latitude, the median value of the (-90, 90) interval is 0, and the latitude interval (-90, 90) is halved to obtain a left interval (-90, 0) and a right interval (0, 90), and for latitude 30.541093, it can be determined to be in the right interval (0, 90), thus obtaining a 1; then, the interval (0, 90) is divided into a left interval (0, 45) and a right interval (45, 90), and it can be determined that the latitude 30.541093 belongs to the left interval (0, 45), and is therefore marked as 1; by repeating the above procedure, if the latitude 30.541093 belongs to the left interval, it is recorded as 0, and if it belongs to the right interval, it is recorded as 1, and finally binary 101010110110111 of the latitude 30.541093 is obtained, and table 2 shows a binary representation of the latitude provided in an exemplary embodiment of the present application.
TABLE 2
And S103, fusing the binary codes respectively corresponding to the longitude and the latitude to obtain a synthetic binary code.
Merging the longitude and latitude fusion according to the parity bits, namely sequentially fusing the longitude before and the latitude after, writing the first bit of the longitude, writing the first bit of the latitude, writing the second bit of the longitude and the second bit of the latitude, and so on, taking the longitude and latitude binary sequence corresponding to the longitude and latitude coordinates (114.360734E, 30.541093N) as an example, and obtaining a synthetic binary code 111001100100011100110110010111.
And S104, dividing each five bits of the composite binary code into a group and converting the group into decimal codes.
The above synthetic binary codes are schematically divided into 11100, 11001, 00011, 10011, 01100 and 10111, and then converted into 28, 25, 3, 19, 12 and 23.
And S105, performing Base32 coding on the obtained decimal code to obtain the GeoHash code of the longitude and latitude.
Illustratively, encoding is performed according to Base32, and table 3 shows a Base32 encoding table provided in an exemplary embodiment of the present application:
TABLE 3
Decimal system
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
|
12
|
13
|
14
|
15
|
Base32
|
0
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
b
|
c
|
d
|
e
|
f
|
g
|
Decimal system
|
16
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
31
|
Base32
|
h
|
j
|
k
|
m
|
n
|
p
|
q
|
r
|
s
|
t
|
u
|
v
|
w
|
x
|
y
|
z |
Schematically, the reference table converts the 28, 25, 3, 19, 12, 23 into wt3mdr, and the wt3mdr is a GeoHash code corresponding to longitude and latitude coordinates (114.360734E, 30.541093N).
GeoHash is a general geocoding algorithm with the following properties:
1) the hierarchical spatial data structure divides the geographic position by rectangular grids, and the geography in the same grid is the same; that is, the GeoHash code represents not one point but a rectangular area, and all points falling within the rectangular area can be represented by the code.
2) Geographical location coordinates of any precision may be represented as long as the code length is sufficiently long.
3) The longer the code prefix match, the more adjacent the geographic location.
In a possible implementation manner, the present application provides a city query method based on latitude and longitude, which is applicable to a scene of querying a city by using a million-level latitude and longitude, and is executed by an offline terminal, and fig. 2 shows a schematic structural diagram of a terminal shown in an exemplary embodiment of the present application, and as shown in fig. 2, the terminal includes a main board 210, an external output/input device 220, a memory 230, an external interface 240, a capacitive touch system 250, and a power supply 260.
The main board 210 has a processor, a controller, and other processing elements integrated therein.
The external input/output devices 220 may include a display component (e.g., a display screen), a sound playing component (e.g., a speaker), a sound collecting component (e.g., a microphone), and various keys.
The memory 230 has program codes and data stored therein.
The external interface 240 may include a headset interface, a charging interface, a data interface, and the like.
The capacitive touch system 250 may be integrated in a display component or a key of the external input/output device 220, and the capacitive touch system 250 is used to detect a touch operation performed by a user on the display component or the key.
The power supply 260 is used to power various other components in the terminal.
In this embodiment, the processor in the motherboard 210 may perform city query based on latitude and longitude by executing or calling the program code and data stored in the memory, and display the city query result through the external input/output device 220. In the process of city query based on longitude and latitude, the touch operation executed when the user interacts with the terminal can be detected through the capacitive touch system 250.
Fig. 3 is a flowchart illustrating a city query method based on latitude and longitude according to an exemplary embodiment of the present application. The city query method based on longitude and latitude can be executed by a computer device, the computer device can be implemented as a terminal shown in fig. 2, as shown in fig. 3, the city query method based on longitude and latitude includes the following steps:
step 310, obtaining the longitude and latitude of the target.
The target longitude and latitude is the longitude and latitude to be queried in the city, and the target longitude and latitude can be the longitude and latitude input based on the query operation of the user.
And step 320, converting the longitude and latitude of the target into a Geohash code of the target.
In one possible implementation, according to the Geohash encoding step shown in fig. 1, the target longitude and latitude is converted into a Geohash code corresponding to the target longitude and latitude, which is called a target Geohash code.
Step 330, inquiring in a map index based on the target Geohash code to obtain a target Geohash area; the map index comprises the corresponding relation between each index area and the Geohash code; each index region comprises a first type index region comprising at least two drop point regions.
In one possible implementation, the map index is established based on indexes of different cities, each city has a corresponding city area, and the city area of each city is, illustratively, an area formed by polygons enclosed by city boundaries of the respective cities.
In one possible implementation manner, a polygon defined by a target Geohash region and a city boundary of a certain city has three relations of phase separation, intersection and inclusion, wherein the phase separation means that the target Geohash region does not belong to the city; the intersection shows that the target Geohash area partially belongs to the city and partially does not belong to the city; the inclusion indicates that the target Geohash area all belongs to the city. A Geohash area which has an intersection relation with a polygon surrounded by city boundaries of a city is called a first type area; a Geohash region having an inclusive relationship with a polygon surrounded by city boundaries of a city is referred to as a second type region. Fig. 4 is a schematic diagram illustrating a relationship between a Geohash region and a polygon surrounded by city boundaries of a city according to an exemplary embodiment of the present application, where, as shown in fig. 4, the Geohash region 410 is a Geohash region having a separated relationship with a polygon 440 surrounded by city boundaries of the city; the Geohash region 420 is a Geohash region having an intersection relation with a polygon 440 surrounded by city boundaries of the city; the Geohash region 430 is a Geohash region having an inclusive relationship with a polygon 440 enclosed by city boundaries of the city.
In one possible implementation manner, the index area corresponding to a certain city only includes the first index area, or in another possible implementation manner, the index area corresponding to a certain city includes the first index area and the second index area; the present application explains that the index area corresponding to the city includes a first index area and a second index area.
Step 340, responding to the target Geohash area as a first type index area, and determining a target drop point area of the target longitude and latitude in the target Geohash area; the target drop point area is one of at least two drop point areas contained in the target Geohash area.
In a possible implementation manner, when the target Geohash region is a first type index region, that is, when the target Geohash region is a Geohash region intersecting a polygon enclosed by a city boundary, there may be two cases corresponding to the longitude and latitude of the target Geohash region, that is, the target Geohash region exists in the city or does not exist in the city, as shown in fig. 4, the Geohash region 421 intersects the polygon 440 enclosed by the city boundary, that is, the polygon 440 enclosed by the city boundary divides the Geohash region 421 into two drop point regions, that is, a drop point region 4211 and a drop point region 4212, and if the target longitude and latitude corresponding to the target Geohash region is in the drop point region 4211, the drop point region 4211 is determined as a target drop point region; if the target longitude and latitude corresponding to the target Geohash area is in the drop point area 4212, determining that the drop point area 4212 is the target drop point area.
And 350, determining a city query result corresponding to the longitude and latitude of the target based on the target point-falling area.
To sum up, in the city query method based on latitude and longitude provided by the embodiment of the present application, the Geohash codes corresponding to the target latitude and longitude coordinates are used for preliminary positioning, and when it is determined that the target Geohash area of the Geohash codes corresponding to the target latitude and longitude is located at a certain city boundary, the target Geohash area is accurately positioned through the target latitude and longitude coordinates, so as to determine the city query result corresponding to the target latitude and longitude, so that under a scene that the latitude and longitude of a billion level are mapped to a city, in the process of performing the city query through the latitude and longitude, the calculation amount of the computer device is reduced, the search performance of the computer device is improved, and thus, the excessive occupation of the computing resources of the computer device caused by the city query is reduced.
In a possible implementation manner, the city query method based on the longitude and latitude provided by the application comprises a map index construction stage and a city query stage based on the longitude and latitude; fig. 5 is a flowchart illustrating a longitude and latitude based city query method according to an exemplary embodiment of the present application, where the longitude and latitude based city query method may be executed by a computer device, where the computer device may be implemented as the terminal shown in fig. 2, as shown in fig. 5, where the longitude and latitude based city query method includes the following steps:
step 501, obtaining a polygon corresponding to at least one city, where the polygon corresponding to the at least one city is constructed based on city boundary data of the at least one city.
In a possible implementation manner, the city boundary data of the at least one city may be data expressed in the form of latitude and longitude coordinates, and the city boundary data may be data obtained from a relevant database of the map application program, and the city boundary data of the at least one city is connected according to a specified order to form a polygon corresponding to the at least one city.
Step 502, determining a Geohash area based on points on a polygon corresponding to a target city, and obtaining a first type index area corresponding to the target city; each Geohash area is provided with a corresponding Geohash code; the target city is any one of the at least one city.
Since the ways used by the cities in constructing the city index are the same, the embodiment of the present application takes the target city as an example to explain the process of constructing the city index.
In a possible implementation manner, in the process of determining the Geohash region by using the points on the polygon corresponding to the target city, the determination is performed with the same precision, that is, the character strings of the Geohash code determined based on the points have the same length, so as to ensure the uniformity of the division of the Geohash region.
In a possible implementation manner, the Geohash region determined based on the points on the polygon intersects with the polygon of the target city, that is, the points on the polygon are included in the corresponding Geohash region, fig. 6 shows a schematic diagram of determining the Geohash region based on the points on the polygon in an exemplary embodiment of the present application, and as shown in fig. 6, the Geohash regions corresponding to the points with close distances on the polygon may be the same or different, for example, the Geohash regions corresponding to the point 610 and the point 620 are the same, but the Geohash regions corresponding to the point 610 and the point 630 are different, but each point on the polygon is included in the corresponding Geohash region.
Step 503, based on the first type index area corresponding to the target city and the polygon corresponding to the target city, obtaining a second type index area corresponding to the target city.
In a possible implementation manner, a minimum adjacent rectangle of a polygon corresponding to a target city is obtained;
and determining a second type index area corresponding to the target city based on the Geohash area contained in the minimum adjacent rectangle and the first type index area corresponding to the target city.
In one possible implementation, obtaining the minimum adjacent rectangle of the polygon corresponding to the target city includes:
acquiring a target point in the city boundary data, wherein the target point comprises a point corresponding to the maximum longitude, a point corresponding to the minimum longitude, a point corresponding to the maximum latitude and a point corresponding to the minimum latitude;
and constructing a minimum adjacent rectangle of the polygon corresponding to the target city based on the target point.
When the computer equipment calculates the Geohash code, the east longitude is taken as positive, and the west longitude is taken as negative; the longitude and latitude coordinates are recursively divided according to a rule that north latitude is positive and south latitude is negative, fig. 7 shows a schematic diagram of constructing a minimum adjacent rectangle of a polygon corresponding to a target city shown in an exemplary embodiment of the present application, and as shown in fig. 7, a point corresponding to the maximum longitude, a point corresponding to the minimum longitude, a point corresponding to the maximum latitude, and a point corresponding to the minimum latitude of the polygon of the target city are respectively a point 710, a point 720, a point 730, and a point 740, the four points are used as target points, and a rectangle constructed by taking a Geohash region as a minimum step length is a minimum adjacent rectangle 750 of the polygon corresponding to the target city. As shown in fig. 7, the minimum adjacent rectangle includes a plurality of Geohash regions, including a Geohash region intersecting a polygon corresponding to the target city and a Geohash region having a separation and inclusion relationship with the polygon corresponding to the target city.
In order to determine, in a Geohash region having a disjunctive relationship and an inclusive relationship with a polygon corresponding to a target city, a Geohash region having an inclusive relationship with a polygon corresponding to a target city, in one possible implementation:
acquiring a Geohash area to be determined in Geohash areas contained in the minimum adjacent rectangle, wherein the Geohash area to be determined is a Geohash area except a first type index area corresponding to a target city in the minimum adjacent rectangle;
performing ray calculation on a polygon corresponding to a target city based on the Geohash area to be determined;
and determining a second type index area corresponding to the target city based on the ray calculation result.
In a possible implementation manner, a Geohash region in which the ray calculation result of each side of a polygon corresponding to a target city is an odd number in a to-be-determined Geohash region is obtained as a second type index region corresponding to the target city.
In a possible implementation manner, the ray calculation refers to that rays are emitted to each side of a polygon corresponding to a target city based on a first to-be-determined region, and in response to that intersection points of all the rays emitted based on the first to-be-determined region and the polygon corresponding to the target city are odd numbers, a position relationship between the first to-be-determined region and the polygon corresponding to the target city is determined to be an inclusion relationship; and determining the position relation between the first area to be determined and the polygon corresponding to the target city as an inclusion relation in response to the existence of even numbers of intersections of all the rays emitted based on the first area to be determined and the polygon corresponding to the target city. Fig. 8 is a schematic diagram illustrating ray calculation based on a region to be determined according to an exemplary embodiment of the present application, and as shown in part (a) in fig. 8, rays are emitted to each side of a polygon corresponding to a target city based on a region to be determined 810 (for example, with a region center), because the number of intersections between all rays corresponding to the region to be determined 810 and the polygon corresponding to the target city is 1 (odd number), a computer device may acquire the region to be determined 810 as an index region of a second type; as shown in part (B) of fig. 8, rays are emitted from each side of a polygon corresponding to a target city based on a region to be determined 820, and since rays having an intersection of 2 (even number) with respect to the polygon corresponding to the target city exist in the rays corresponding to the region to be determined 820, the computer device may determine that the region to be determined 820 is a Geohash region having a separation relationship with the polygon corresponding to the target city.
Step 504, a city index of the target city is constructed based on the first type index area corresponding to the target city and the second type index area corresponding to the target city.
In a possible implementation manner, effective drop point areas corresponding to a target city in at least two drop point areas in a first type index area corresponding to the target city are obtained;
and constructing a city index of the target city based on the second type index area corresponding to the target city and the effective drop point area corresponding to the target city in the first type index area corresponding to the target city.
The effective drop point areas corresponding to the target city in at least two drop point areas in the first type index area corresponding to the target city, that is, the areas in the first type index area belonging to the target city, that is, the areas in the first type index area located inside the boundary of the target city.
In a possible implementation manner, the polygon corresponding to the at least one city is constructed by connecting the city boundary data of the at least one city according to a specified direction.
The obtaining of the effective drop point areas corresponding to the target city in the at least two drop point areas in the first type index area corresponding to the target city includes:
and acquiring effective drop point areas corresponding to the target city in at least two drop point areas of the first type index area corresponding to the target city based on the edge and the designated direction of the polygon corresponding to the target city.
In one possible implementation, the specified direction includes a clockwise direction and a counterclockwise direction;
responding to the fact that the designated direction is clockwise, and obtaining a drop point area of a first type index corresponding to a target city on the right side of the polygon corresponding to the target city as an effective drop point area corresponding to the target city;
and in response to the designated direction being the counterclockwise direction, acquiring a drop point area of a first type index area corresponding to a target city on the left side of the polygon corresponding to the target city as an effective drop point area corresponding to the target city. Fig. 9 is a schematic diagram illustrating a determination of a valid drop point area corresponding to a target city according to an exemplary embodiment of the present application, in which part (a) of fig. 9 illustrates the schematic diagram when a designated direction is clockwise, and part (B) of fig. 9 illustrates the schematic diagram when the designated direction is counterclockwise; as shown in part (a) of fig. 9, when the designated direction is clockwise, the edge of the polygon corresponding to the target city, which passes through the first-type index region 910, penetrates the first-type index region 910 from the right side of the first-type index region 910, penetrates the first-type index region 910 from the left side of the first-type index region 910, and corresponding to the direction, the right side of the edge passing through the first-type index region 910 is an effective drop point region belonging to the target city in the first-type index region 910, and the left side thereof is an effective drop point region of a non-target city; as shown in part (B) of fig. 9, when the designated direction is counterclockwise, the edge of the polygon corresponding to the target city, which passes through the first-type index region 910, penetrates the first-type index region 910 from the left side of the first-type index region 910, and, corresponding to the direction, the left side of the edge passing through the first-type index region 910 is an effective drop point region belonging to the target city in the first-type index region 910, and the right side thereof is an effective drop point region of a non-target city.
It should be noted that, when map index is constructed, polygons corresponding to each city are constructed by connecting city boundary data in the same direction, that is, polygons corresponding to the city are constructed by connecting the city boundary data in the same time, or polygons corresponding to the city are constructed by connecting the city boundary data in the same time.
In a possible implementation manner, the constructing the city index of the target city based on the second type index area corresponding to the target city and the effective drop point area corresponding to the target city in the first type index area corresponding to the target city includes:
establishing a first mapping relation between a second type index area corresponding to the target city and the city code of the target city;
establishing a second mapping relation between the effective drop point area corresponding to the target city in the first type index area corresponding to the target city and the city code of the target city;
and acquiring the first mapping relation and the second mapping relation as city indexes of the target city.
For the second type index area, because the second type index area is a Geohash area having an inclusion relationship with a polygon corresponding to a target city, after the Geohash area corresponding to the latitude and longitude of the target is determined to be the second type index area, the city corresponding to the Geohash area can be determined directly according to the first mapping relationship between the second type index area and the city code of the target city without further judgment, so that when the city index is constructed, for the second type index area, the mapping relationship between the second type index area corresponding to the target city and the city code of the target city can be directly established, or the mapping relationship between the Geohash code of the second type index area and the city code of the target city can also be established;
for the first type index area, since the second type index area is a Geohash area having an intersection relationship with a polygon corresponding to the target city, after the Geohash area corresponding to the target longitude and latitude is determined to be the first type index area, it still cannot be determined whether the target longitude and latitude exists in the polygon corresponding to the target city, and it is necessary to further determine a drop point area of the target longitude and latitude in the target Geohash area, so that it is necessary to establish a mapping relationship between an effective drop point area corresponding to the target city in the first type index area and a city code of the target city, or to establish a mapping relationship between a drop point area code corresponding to the effective drop point area of the target city in the first type index area and a city code of the target city.
And 505, acquiring the longitude and latitude of the target.
Step 506, converting the latitude and longitude of the target into a Geohash code of the target.
Step 507, inquiring in a map index based on the target Geohash code to obtain a target Geohash area; the map index comprises the corresponding relation between each index area and the Geohash code; each index region comprises a first type index region comprising at least two drop point regions.
Step 508, in response to that the target Geohash area is the first type index area, performing ray calculation on at least two drop point areas included in the target Geohash area based on the target longitude and latitude; and determining a target landing point area based on the ray calculation result.
In one possible implementation, the computer device may determine whether the target Geohash region is a first-type index region or a second-type index region based on the number of city codes corresponding to the target Geohash region:
determining that the target Geohash area is a second type index area in response to the fact that the number of the city codes corresponding to the target Geohash area is one;
and determining the target Geohash area as a first type index area in response to the fact that the number of the city codes corresponding to the target Geohash area is more than one.
In a possible implementation manner, of the at least two drop point regions, the drop point region with the odd number of the ray calculation results is obtained as the target drop point region. Fig. 10 is a schematic diagram illustrating a ray calculation performed on at least two drop point areas included in a target Geohash area based on a target longitude and latitude according to an exemplary embodiment of the present application, where geographic positions of the target longitude and latitude are fixed, and a ray is respectively emitted to each edge of two drop point areas (a drop point area 1021 and a drop point area 1022) included in a target Geohash area 1020 based on the target longitude and latitude 1010, where intersection points of all rays emitted to the drop point area 1021 based on the target longitude and latitude 1010 are 1 (odd number), and therefore, a computer device determines that the drop point area of the target longitude and latitude is the drop point area 1021; in the rays emitted to the drop point region 1022 based on the target longitude and latitude 1010, there are rays whose intersection points are all 2 (even number), and therefore, the computer device determines that the target longitude and latitude does not fall in the drop point region 1022.
Because the drop point area in the target Geohash area is a polygon area formed by polygons corresponding to the target city and the edges of the target Geohash area, the number of the edges is far less than that of the polygons corresponding to the target city, in a scene of inquiring the city based on the latitude and longitude at the billion level, the calculation amount required by the computer equipment when determining whether the target latitude and longitude exist in the target city can be greatly reduced, and thus the consumption of the calculation resources of the computer equipment is reduced.
In a possible implementation manner, the process of determining the drop point area based on the target longitude and latitude is performed sequentially, that is, when the drop point area is judged, ray calculation is performed on a first drop point area in the target Geohash area, after the target longitude and latitude is determined not to fall in the first drop point area, ray calculation is performed on a second drop point area in the target Geohash area, and the like; and in response to the fact that the target Geohash area determines the drop point area of the latitude and longitude of the target, stopping the step of performing ray calculation on other drop point areas in the target Geohash area so as to reduce unnecessary calculation and save the calculation resources of the terminal.
Step 509, determining a city query result corresponding to the target longitude and latitude based on the target landing area.
In a possible implementation manner, each drop point region corresponds to a different city code, and the above process is implemented as follows:
determining a city code corresponding to the drop point area based on the target drop point area;
and outputting a city query result corresponding to the target longitude and latitude based on the city code.
In one possible implementation, the city query result may refer to province and city information of the city, such as "the Shandong province and the Zea", or the city query result may further include travel information of the city, such as tourist attractions of the city; traffic information such as a path plan to the city from the current location of the terminal; food information such as featured snack recommendations for the city, etc., the application is not limited as to the type of city query results.
Step 510, in response to that the target Geohash area is the second type index area, determining a city query result corresponding to the longitude and latitude of the target based on the Geohash code of the target Geohash area; the second-type index region contains a single drop point region.
To sum up, in the city query method based on latitude and longitude provided by the embodiment of the present application, the Geohash codes corresponding to the target latitude and longitude coordinates are used for preliminary positioning, and when it is determined that the target Geohash area of the Geohash codes corresponding to the target latitude and longitude is located at a certain city boundary, the target Geohash area is accurately positioned through the target latitude and longitude coordinates, so as to determine the city query result corresponding to the target latitude and longitude, so that under a scene that the latitude and longitude of a billion level are mapped to a city, in the process of performing the city query through the latitude and longitude, the calculation amount of the computer device is reduced, the search performance of the computer device is improved, and thus, the excessive occupation of the computing resources of the computer device caused by the city query is reduced.
Fig. 11 is a schematic diagram of a longitude and latitude-based city query method according to an exemplary embodiment of the present application, where the longitude and latitude-based city query method includes a map index construction phase 1110 and a city query phase 1120 based on longitude and latitude, where in the map index construction phase 1110, a Geohash area is determined based on a point on a polygon corresponding to a city boundary by obtaining the polygon corresponding to the city boundary, that is, a first type index area corresponding to the city is determined; constructing a minimum adjacent rectangle corresponding to a polygon of the city boundary, and determining a second type index area in the range of the minimum adjacent rectangle; and determining an effective landing area for the city in the first type index area based on the construction direction of the polygon corresponding to the city boundary, and finally, establishing a mapping relation between the second type index area and the city code of the city and establishing a mapping relation between the effective landing area for the city in the first type index area and the city code of the city. In the stage 1120 of city query based on longitude and latitude, the computer device converts the obtained target longitude and latitude into a Geohash code, queries in the map index constructed in the map index construction stage 1110 based on the Geohash code, and directly outputs a city query result based on the mapping relationship between the second type index area and the city code if the Geohash area corresponding to the Geohash code belongs to the second type index area; if the Geohash area corresponding to the Geohash code belongs to the first type index area, determining a target landing area in the first type index area, and outputting a city query result based on a mapping relation between the target landing area and the city code.
Fig. 12 is a block diagram illustrating a city query device based on latitude and longitude according to an exemplary embodiment of the present application. The longitude and latitude-based city inquiry apparatus may be applied to a computer device, where the computer device may be implemented as a terminal as shown in fig. 2, as shown in fig. 12, and the longitude and latitude-based city inquiry apparatus includes:
a latitude and longitude acquisition module 1210 for acquiring the latitude and longitude of the target;
the Geohash code conversion module 1220 is configured to convert the target longitude and latitude into a target Geohash code;
a Geohash region obtaining module 1230, configured to query the map index based on the target Geohash code to obtain a target Geohash region; the map index comprises the corresponding relation between each index area and the Geohash code; each index area comprises a first type index area, and the first type index area comprises at least two drop point areas;
the falling point area determining module 1240 is used for determining a target falling point area of the target longitude and latitude in the target Geohash area in response to the target Geohash area being the first type index area; the target drop point area is one of at least two drop point areas contained in the target Geohash area;
the first city query result determining module 1250 is configured to determine a city query result corresponding to the target longitude and latitude based on the target landing area.
In a possible implementation manner, the drop point area determining module 1240 includes:
the ray calculation sub-module is used for responding to the fact that the target Geohash area is the first type index area, and performing ray calculation on at least two drop point areas contained in the target Geohash area on the basis of the target longitude and latitude;
and the drop point area determining submodule is used for determining a target drop point area based on the ray calculation result.
In a possible implementation manner, the drop point region determining submodule is configured to determine that, of at least two drop point regions, a drop point region with an odd number of the ray calculation results is a target drop point region.
In a possible implementation manner, each of the landing areas corresponds to a different city code, and the first city query result determining module 1250 includes:
the city code determining submodule is used for determining a city code corresponding to the drop point area based on the target drop point area;
and the city query result output submodule is used for outputting a city query result corresponding to the target longitude and latitude based on the city code.
In one possible implementation manner, each index area includes a second type index area, and the apparatus further includes:
the second city query result determining module is used for responding to the target Geohash area as a second type index area, and determining a city query result corresponding to the target longitude and latitude based on the Geohash code of the target Geohash area; the second-type index region contains a single drop point region.
In one possible implementation, the apparatus further includes:
the system comprises a polygon obtaining module, a polygon obtaining module and a polygon setting module, wherein the polygon obtaining module is used for obtaining a polygon corresponding to at least one city, and the polygon corresponding to the at least one city is constructed based on city boundary data of the at least one city;
the first type index area acquisition module is used for determining a Geohash area based on point conversion on a polygon corresponding to a target city and acquiring a first type index area corresponding to the target city; each Geohash area is provided with a corresponding Geohash code; the target city is any one of at least one city;
the second type index area acquisition module is used for acquiring a second type index area corresponding to the target city based on the first type index area corresponding to the target city and the polygon corresponding to the target city;
and the city index building module is used for building a city index of the target city based on the first type index area corresponding to the target city and the second type index area corresponding to the target city.
In a possible implementation manner, the city index building module includes:
the effective drop point area obtaining submodule is used for obtaining effective drop point areas corresponding to the target city in at least two drop point areas in the first type index area corresponding to the target city;
and the city index building submodule is used for building the city index of the target city based on the second type index area corresponding to the target city and the effective drop point area corresponding to the target city in the first type index area corresponding to the target city.
In a possible implementation manner, a polygon corresponding to at least one city is constructed by connecting city boundary data of the at least one city according to a specified direction;
the effective drop point area obtaining submodule is used for obtaining effective drop point areas corresponding to the target city in at least two drop point areas of the first type index area corresponding to the target city based on the edge and the designated direction of the polygon corresponding to the target city.
In one possible implementation, the specified direction includes a clockwise direction and a counterclockwise direction;
the effective drop point region acquisition submodule comprises:
a first effective drop point region obtaining unit, configured to, in response to that the designated direction is the clockwise direction, obtain a drop point region of a first type index corresponding to a target city on the right side of a polygon edge corresponding to the target city as an effective drop point region corresponding to the target city;
and the second effective drop point area acquisition unit is used for responding to the fact that the designated direction is the anticlockwise direction, and acquiring the drop point area of the first type index area corresponding to the target city on the left side of the polygon corresponding to the target city as the effective drop point area corresponding to the target city.
In a possible implementation manner, the second-type index area obtaining module includes:
the minimum adjacent rectangle obtaining submodule is used for obtaining a minimum adjacent rectangle of a polygon corresponding to the target city;
and the second type index area determining submodule is used for determining a second type index area corresponding to the target city based on the Geohash area contained in the minimum adjacent rectangle and the first type index area corresponding to the target city.
In a possible implementation manner, the second-type index area determining sub-module includes:
a to-be-determined Geohash region obtaining unit, configured to obtain a to-be-determined Geohash region in Geohash regions included in a minimum adjacent rectangle, where the to-be-determined Geohash region is a Geohash region in the minimum adjacent rectangle except for a first type index region corresponding to a target city;
the ray calculation unit is used for performing ray calculation on a polygon corresponding to the target city based on the Geohash area to be determined;
and the second type index area determining unit is used for determining a second type index area corresponding to the target city based on the ray calculation result.
In a possible implementation manner, the second-type index region determining unit is configured to obtain, in the geo-hash region to be determined, a geo-hash region in which a result of ray calculation for each side of a polygon corresponding to a target city is an odd number is a second-type index region corresponding to the target city.
In one possible implementation, the city index building module includes:
the first mapping relation establishing submodule is used for establishing a first mapping relation between a second type index area corresponding to the target city and the city code of the target city;
the second mapping relation establishing submodule is used for establishing a second mapping relation between the effective drop point area corresponding to the target city in the first type index area corresponding to the target city and the city code of the target city;
and the city index obtaining submodule is used for obtaining the first mapping relation and the second mapping relation as the city index of the target city.
To sum up, the latitude and longitude-based city query device provided in the embodiment of the present application is applied to a computer device, and performs initial positioning through a Geohash code corresponding to a target latitude and longitude coordinate, and when it is determined that a target Geohash area of the Geohash code corresponding to the target latitude and longitude is located at a certain city boundary, performs accurate positioning through the target latitude and longitude coordinate in the target Geohash area, thereby determining a city query result corresponding to the target latitude and longitude, so that in a scene where a hundred billion-level latitude and longitude is mapped to a city, in a process of performing city query through the latitude and longitude, the calculation amount of the computer device is reduced, the search performance of the computer device is improved, and thereby the excessive occupation of computing resources of the computer device due to city query is reduced.
Fig. 13 is a block diagram illustrating the structure of a computer device 1300 according to an example embodiment. The computer device 1300 may be a terminal, such as a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a laptop computer, or a desktop computer. Computer device 1300 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
Generally, computer device 1300 includes: a processor 1301 and a memory 1302.
Processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 1301 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 1301 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also referred to as a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 1301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing content that the display screen needs to display. In some embodiments, processor 1301 may further include an AI (Artificial Intelligence) processor for processing computational operations related to machine learning.
Memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer-readable storage medium in memory 1302 is used to store at least one instruction for execution by processor 1301 to implement the latitude and longitude based city query method provided by method embodiments herein.
In some embodiments, computer device 1300 may also optionally include: a peripheral interface 1303 and at least one peripheral. Processor 1301, memory 1302, and peripheral interface 1303 may be connected by a bus or signal line. Each peripheral device may be connected to the peripheral device interface 1303 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 1304, display screen 1305, camera assembly 1306, audio circuitry 1307, positioning assembly 1308, and power supply 1309.
In some embodiments, computer device 1300 also includes one or more sensors 1310. The one or more sensors 1310 include, but are not limited to: acceleration sensor 1311, gyro sensor 1312, pressure sensor 1313, fingerprint sensor 1314, optical sensor 1315, and proximity sensor 1316.
Those skilled in the art will appreciate that the architecture shown in FIG. 13 is not intended to be limiting of the computer device 1300, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
An embodiment of the present application further provides a computer-readable storage medium for storing at least one instruction, at least one program, a code set, or a set of instructions, which is loaded and executed by a processor to implement all or part of the steps of the above-mentioned longitude and latitude based city query method. For example, the computer readable storage medium may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform all or part of the steps of the latitude and longitude-based city query method shown in the above embodiments.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.