CN107273414B - A kind of searching method based on geographical location - Google Patents
A kind of searching method based on geographical location Download PDFInfo
- Publication number
- CN107273414B CN107273414B CN201710312262.5A CN201710312262A CN107273414B CN 107273414 B CN107273414 B CN 107273414B CN 201710312262 A CN201710312262 A CN 201710312262A CN 107273414 B CN107273414 B CN 107273414B
- Authority
- CN
- China
- Prior art keywords
- grid
- position data
- geographic position
- search range
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
Abstract
The invention discloses a kind of searching methods based on geographical location, including data directory establishment step and data retrieval step, step.The present invention carried out Multilayer Network and formatted processing by using apart from Hierarchical Network method to map of formatting before this, then when searching for data, the geodata of level grid affiliated therewith is extracted, only so as to be significantly reduced calculation amount, search speed is greatly promoted, it is convenient and efficient.It the composite can be widely applied in the search of geographical location.
Description
Technical field
The present invention relates to field of computer technology more particularly to a kind of searching methods based on geographical location.
Background technique
Whether traditional method calculates the data item to be searched for one by one, judge data geographic position in search range
Interior, if data volume is bigger, calculation amount will be bigger, and efficiency also can be lower.
Summary of the invention
In order to solve the above-mentioned technical problem, the object of the present invention is to provide one kind can be reduced calculation amount, and can improve search
A kind of searching method based on geographical location of efficiency.
The technical solution used in the present invention is:
A kind of searching method based on geographical location, including data directory establishment step and data retrieval step, step;
The data directory establishment step specifically includes:
Gathering geographic position data;
Hierarchical Network is carried out according to distance to plane map to format processing;
The geographic position data of acquisition is belonged in corresponding graded mesh;
Geographic position data after formatting to Hierarchical Network establishes index.
The data retrieval step, step specifically includes:
Judge level grid belonging to search range;
The corresponding geographic position data of level grid-search method according to belonging to search range, and extracting geographic position data
During filter geographic position data not in search range.
As a kind of further improvement of searching method based on geographical location, it is described to plane map according to
Distance carries out Hierarchical Network and formats processing, the step for specifically include:
Gridding layering is carried out to plane map according to distance, obtains graded mesh;
Obtained graded mesh is encoded, grid coding is obtained.
As a kind of further improvement of searching method based on geographical location, in the gridding layered shaping
Hierarchy formulas are as follows:
Grid (k, n)=d*10k*(n+1);
Grid (k, n) indicates that the size of mesh opening of corresponding layering, d indicate the side length of element radix of minimum level-one;K and n is indicated
Side length of element step size.
As a kind of further improvement of searching method based on geographical location, the geographical position by acquisition
Attribution data is set into corresponding graded mesh, the step for specifically:
According to the longitude and latitude for collecting geographic position data, each data point is in each layer of institute in recording geographical position data
The grid coding of category.
As a kind of further improvement of searching method based on geographical location, it is described format to Hierarchical Network after
Geographic position data establish index, the step for specifically:
Using full-text search engine technology, for the grid number and all ownership point of the data point in geographic position data
Layer grid coding establishes index.
As a kind of further improvement of searching method based on geographical location, the judgement search range institute
The level grid of category, the step for specifically:
Affiliated level grid, specific formula for calculation are calculated by the radius of search range are as follows:
K=floor (log (r/d));
N=floor (r/ (d*10k));
Wherein, d indicates that the side length of element radix of minimum level-one, r indicate that the radius of search range, k and n indicate side length of element
Step size.
It is described according to search range institute as a kind of further improvement of searching method based on geographical location
The corresponding geographic position data of level grid-search method of category, the step for specifically include:
Judge grid coding belonging to the central point of search range;
By the radius of search range, all grid codings in search range are obtained;
According to the grid coding of acquisition, the data item belonged in these grid codings is extracted.
As a kind of further improvement of searching method based on geographical location, net belonging to the central point
The calculation formula that the grid of trellis coding is numbered in length and breadth are as follows:
X=floor ((lng-lng0)/[d*10k*(n+1)]);
Y=floor ((lat-lat0)/[d*10k*(n+1)]);
Wherein, d indicates the side length of element radix of minimum level-one;K and n indicates side length of element step size, and affiliated grid is T
The upper left corner origin of [kn] X [x] Y [y], plane map are (lng0, lat0), and the center point coordinate of search range is
(lng,lat)。
The beneficial effects of the present invention are:
A kind of searching method based on geographical location of the present invention was formatted method to map by using apart from Hierarchical Network before this
It carries out Multilayer Network to format processing, then when searching for data, only extracts the geodata of level grid affiliated therewith, so as to
It is significantly reduced calculation amount, greatly promotes search speed, it is convenient and efficient.
Detailed description of the invention
Specific embodiments of the present invention will be further explained with reference to the accompanying drawing:
Fig. 1 is the step flow chart that data directory is established in a kind of searching method based on geographical location of the present invention;
Fig. 2 is the step flow chart of data retrieval in a kind of searching method based on geographical location of the present invention.
Specific embodiment
With reference to Fig. 1 and Fig. 2, a kind of searching method based on geographical location of the present invention, including data directory establishment step and
Data retrieval step, step;
The data directory establishment step specifically includes:
Gathering geographic position data;
Hierarchical Network is carried out according to distance to plane map to format processing;
The geographic position data of acquisition is belonged in corresponding graded mesh;
Geographic position data after formatting to Hierarchical Network establishes index.
The data retrieval step, step specifically includes:
Judge level grid belonging to search range;
The corresponding geographic position data of level grid-search method according to belonging to search range, and extracting geographic position data
During filter geographic position data not in search range.
It is further used as preferred embodiment, it is described Hierarchical Network is carried out according to distance to plane map to format processing,
The step for specifically include:
Gridding layering is carried out to plane map according to distance, obtains graded mesh;
Obtained graded mesh is encoded, grid coding is obtained.
It is further used as preferred embodiment, the hierarchy formulas in the gridding layered shaping are as follows:
Grid (k, n)=d*10k*(n+1);
Grid (k, n) indicates that the size of mesh opening of corresponding layering, d indicate the side length of element radix of minimum level-one;K and n is indicated
Side length of element step size.
It is further used as preferred embodiment, it is described that the geographic position data of acquisition is belonged into corresponding Hierarchical Network
In lattice, the step for specifically:
According to the longitude and latitude for collecting geographic position data, each data point is in each layer of institute in recording geographical position data
The grid coding of category.
Be further used as preferred embodiment, it is described format to Hierarchical Network after geographic position data establish index,
The step for specifically:
Using full-text search engine technology, for the grid number and all ownership point of the data point in geographic position data
Layer grid coding establishes index.
Be further used as preferred embodiment, it is described to judge level grid belonging to search range, the step for have
Body are as follows:
Affiliated level grid, specific formula for calculation are calculated by the radius of search range are as follows:
K=floor (log (r/d));
N=floor (r/ (d*10k));
Wherein, d indicates that the side length of element radix of minimum level-one, r indicate that the radius of search range, k and n indicate side length of element
Step size.
It is further used as preferred embodiment, the level grid-search method according to belonging to search range is correspondingly
Manage position data, the step for specifically include:
Judge grid coding belonging to the central point of search range;
By the radius of search range, all grid codings in search range are obtained;
According to the grid coding of acquisition, the data item belonged in these grid codings is extracted.
It is further used as preferred embodiment, the meter that the grid of grid coding belonging to the central point is numbered in length and breadth
Calculate formula are as follows:
X=floor ((lng-lng0)/[d*10k*(n+1)]);
Y=floor ((lat-lat0)/[d*10k*(n+1)]);
Wherein, d indicates the side length of element radix of minimum level-one;K and n indicates side length of element step size, and affiliated grid is T
The upper left corner origin of [kn] X [x] Y [y], plane map are (lng0, lat0), and the center point coordinate of search range is
(lng,lat)。
Specific embodiments of the present invention are as follows:
S1, gathering geographic position data;
S2, gridding layering is carried out to plane map according to distance, obtains graded mesh;
Hierarchy formulas in the gridding layered shaping are as follows:
Grid (k, n)=d*10k*(n+1);
Grid (k, n) indicates that the size of mesh opening of corresponding layering, d indicate the side length of element radix of minimum level-one;K and n is indicated
Side length of element step size;
The value range of k is usually in 0-3;The value range of n is usually in 0-8;
If d is equal to 100, then plane map is divided into 100*100 meters of small grid, the second layer by first layer grid (0,0)
Plane map is divided into 200*200 meters of small grid by grid (0,1), and so on, layering to grid (3,8).It can will put down
Face map is layered from hundred meters of layerings to 10 myriametres, divides 36 layers.Every layer of grid number is until covering entire map, map entire in this way
Longitude and latitude will be embodied in every layer of grid.Grid number calculation formula are as follows: C=S/grid (k, n) 2;
S3, obtained graded mesh is encoded, obtains grid coding;
In the present embodiment, essentially according to level and two-dimensional coordinate system principle, to be encoded to grid, such as the 1st layer first
A grid coding is T00X0Y0;Second grid coding is T00X1Y0;2nd layer of first grid coding is T01X0Y0;Second
A grid coding is T01X1Y0;And so on unique encodings are carried out to the grids of all levels;
S4, basis collect the longitude and latitude of geographic position data, and each data point is each in recording geographical position data
Grid coding belonging to layer;
S5, using full-text search engine technology, grid number for the data point in geographic position data and all return
Belong to graded mesh coding and establishes index.
S6, judge level grid belonging to search range;
Affiliated level grid, specific formula for calculation are calculated by the radius of search range are as follows:
K=floor (log (r/d));
N=floor (r/ (d*10k));
Wherein, d indicates that the side length of element radix of minimum level-one, r indicate that the radius of search range, k and n indicate side length of element
Step size;
If search radius is 140 meters, d=100 meters, then k=0, n=0;Affiliated figure layer is T00;
If search radius is 540 meters, d=100 meters, then k=0, n=5;Affiliated figure layer is T05;
If search radius is 1400 meters, d=100 meters, then k=1, n=0;Affiliated figure layer is T10;
S7, judge grid coding belonging to the central point of search range;
The calculation formula that the grid of grid coding belonging to the central point is numbered in length and breadth are as follows:
X=floor ((lng-lng0)/[d*10k*(n+1)]);
Y=floor ((lat-lat0)/[d*10k*(n+1)]);
Wherein, d indicates the side length of element radix of minimum level-one;K and n indicates side length of element step size, and affiliated grid is T
The upper left corner origin of [kn] X [x] Y [y], plane map are (lng0, lat0), and the center point coordinate of search range is
(lng,lat);
S8, the radius by search range obtain all grid codings in search range;
S9, the grid coding according to acquisition extract the data item belonged in these grid codings.
S10, calculate one by one extracted data between central point at a distance from, such as larger than search radius then think beyond search
Range.
From the foregoing it can be that a kind of searching method based on geographical location of the present invention is before this by using apart from Hierarchical Network
Method of formatting to map carries out Multilayer Network and formats processing, then when searching for data, only extracts level grid affiliated therewith
Geodata greatly promotes search speed so as to be significantly reduced calculation amount, convenient and efficient.
It is to be illustrated to preferable implementation of the invention, but the invention is not limited to the implementation above
Example, those skilled in the art can also make various equivalent variations on the premise of without prejudice to spirit of the invention or replace
It changes, these equivalent deformations or replacement are all included in the scope defined by the claims of the present application.
Claims (5)
1. a kind of searching method based on geographical location, which is characterized in that walked including data directory establishment step and data retrieval
Suddenly;
The data directory establishment step specifically includes:
Gathering geographic position data;
Hierarchical Network is carried out according to distance to plane map to format processing;
The geographic position data of acquisition is belonged in corresponding graded mesh;
Geographic position data after formatting to Hierarchical Network establishes index;
The data retrieval step, step specifically includes:
Judge level grid belonging to search range;
The corresponding geographic position data of level grid-search method according to belonging to search range, and in the mistake for extracting geographic position data
The geographic position data not in search range is filtered in journey;
It is described Hierarchical Network is carried out according to distance to plane map to format processing, the step for specifically include:
Gridding layering is carried out to plane map according to distance, obtains graded mesh;
Obtained graded mesh is encoded, grid coding is obtained;
Hierarchy formulas in the gridding layered shaping are as follows:
Grid (k, n)=d*10k*(n+1);
Grid (k, n) indicates that the size of mesh opening of corresponding layering, d indicate the side length of element radix of minimum level-one;K and n indicates grid
Side length step size;
It is described to judge level grid belonging to search range, the step for specifically:
Affiliated level grid, specific formula for calculation are calculated by the radius of search range are as follows:
K=floor (log (r/d));
N=floor (r/ (d*10k));
Wherein, d indicates that the side length of element radix of minimum level-one, r indicate that the radius of search range, k and n indicate side length of element stepping
Size.
2. a kind of searching method based on geographical location according to claim 1, it is characterised in that: described by acquisition
Geographic position data belongs in corresponding graded mesh, the step for specifically:
According to the longitude and latitude for collecting geographic position data, each data point is belonging to each layer in recording geographical position data
Grid coding.
3. a kind of searching method based on geographical location according to claim 1, it is characterised in that: described to Hierarchical Network
Geographic position data after formatting establishes index, the step for specifically:
Grid coding and all ownership Hierarchical Networks using full-text search engine technology, for the data point in geographic position data
Trellis coding establishes index.
4. a kind of searching method based on geographical location according to claim 1, it is characterised in that: described according to search
The corresponding geographic position data of level grid-search method belonging to range, the step for specifically include:
Judge grid coding belonging to the central point of search range;
By the radius of search range, all grid codings in search range are obtained;
According to the grid coding of acquisition, the data item belonged in these grid codings is extracted.
5. a kind of searching method based on geographical location according to claim 4, it is characterised in that: the central point institute
The calculation formula that the grid of the grid coding of category is numbered in length and breadth are as follows:
X=floor ((lng-lng0)/[d*10k*(n+1)]);
Y=floor ((lat-lat0)/[d*10k*(n+1)]);
Wherein, d indicates the side length of element radix of minimum level-one;K and n indicates side length of element step size, and affiliated grid is T [kn]
X [x] Y [y], the upper left corner origin of plane map are (lng0, lat0), the center point coordinate of search range be (lng,
lat)。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710312262.5A CN107273414B (en) | 2017-05-05 | 2017-05-05 | A kind of searching method based on geographical location |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710312262.5A CN107273414B (en) | 2017-05-05 | 2017-05-05 | A kind of searching method based on geographical location |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107273414A CN107273414A (en) | 2017-10-20 |
CN107273414B true CN107273414B (en) | 2019-01-22 |
Family
ID=60074351
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710312262.5A Active CN107273414B (en) | 2017-05-05 | 2017-05-05 | A kind of searching method based on geographical location |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107273414B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109408738B (en) * | 2018-09-10 | 2021-04-06 | 中南民族大学 | Method and system for querying space entity in traffic network |
CN109857947A (en) * | 2019-01-28 | 2019-06-07 | 科大国创软件股份有限公司 | A kind of broadband installation site selecting method and system based on GIS map |
CN110986996B (en) * | 2019-11-29 | 2021-09-10 | 秒针信息技术有限公司 | Data processing method and device, electronic equipment and storage medium |
US11467584B2 (en) * | 2019-12-27 | 2022-10-11 | Baidu Usa Llc | Multi-layer grid based open space planner |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103136371B (en) * | 2013-03-21 | 2016-05-18 | 北京大学 | Subdivision mark generating method and the data retrieval method of multi-source Spatial Data |
CN103729802B (en) * | 2013-12-20 | 2017-06-06 | 深圳供电局有限公司 | Method for rapidly positioning and device based on grid equipment geography information hierarchical index |
CN104199986B (en) * | 2014-09-29 | 2017-06-06 | 国家电网公司 | Vector data space index method based on hbase and geohash |
CN105786822B (en) * | 2014-12-18 | 2019-05-24 | 高德软件有限公司 | Search space object and the method and device for establishing spatial index in electronic map |
US10372705B2 (en) * | 2015-07-07 | 2019-08-06 | International Business Machines Corporation | Parallel querying of adjustable resolution geospatial database |
-
2017
- 2017-05-05 CN CN201710312262.5A patent/CN107273414B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN107273414A (en) | 2017-10-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107273414B (en) | A kind of searching method based on geographical location | |
CN109977179B (en) | Method for realizing convergence and dispersion visualization of mass ground object mark points through layered grid division | |
CN107092680B (en) | Government affair information resource integration method based on geographic grids | |
CN103268358B (en) | Multi-source control point image database builds and update method | |
Wu et al. | An extended minimum spanning tree method for characterizing local urban patterns | |
CN108446293A (en) | A method of based on urban multi-source isomeric data structure city portrait | |
CN106528597A (en) | POI (Point Of Interest) labeling method and device | |
CN105206057B (en) | Detection method and system based on Floating Car resident trip hot spot region | |
CN105677804A (en) | Determination of authority stations and building method and device of authority station database | |
CN108804602A (en) | A kind of distributed spatial data storage computational methods based on SPARK | |
CN105426375B (en) | A kind of calculation method and device of relational network | |
CN104091005B (en) | A kind of Overhead Line Project measures indoor and field integration system | |
CN107766433A (en) | A kind of range query method and device based on Geo BTree | |
CN113139760B (en) | Typhoon risk comprehensive evaluation method and system based on wind and rain big data | |
CN104462155A (en) | Point-of-interest set membership establishing method and device | |
CN107145671B (en) | A kind of numerical reservoir simulation method and system | |
CN104422451A (en) | Road recognition method and road recognition apparatus | |
CN111062446A (en) | Land type classification method based on multi-source homeland resource data | |
CN106204316B (en) | Fine and close exploration activity method and apparatus | |
CN103678657B (en) | Method for storing and reading altitude data of terrain | |
CN106980029B (en) | Vehicle overspeed judgment method and system | |
CN116486289A (en) | Gas pipeline high-consequence area identification method driven by multi-source data and knowledge | |
CN114925043A (en) | Application method and device based on space-time grid block data and electronic equipment | |
CN109885638A (en) | A kind of three-dimensional space indexing means and system | |
CN104679765B (en) | Regional scope determines method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |