Invention content
An embodiment of the present invention provides a kind of population longitudes and latitudes to determine method and apparatus, can obtain more accurate population
Longitude and latitude.
In a first aspect, a kind of population longitude and latitude of the embodiment of the present invention determines method, including:Map script is pre-set, also
Including:
S1:Obtain population essential information;
S2:According to the population essential information, regional extent is determined;
S3:Judge to whether there is population longitude and latitude in the population essential information, if so, executing S4, otherwise, execute
S5;
S4:The population longitude and latitude is judged whether in the regional extent using the map script, if not, executing
S5;
S5:According to the regional extent, target demographic longitude and latitude is determined;
S6:The population essential information is updated using the target demographic longitude and latitude.
Preferably,
The S5, including:
A1:Random number is generated using pre-set random function;
A2:According to the regional extent and the random number, virtual longitude and latitude is generated;
A3:The virtual longitude and latitude is judged whether in the regional extent using the map script, if so, executing
Otherwise A4 executes A1;
A4:Determine that the virtual longitude and latitude is target demographic longitude and latitude.
Preferably,
The A2, including:
Determine the central point longitude and latitude of the regional extent, the width and height of the regional extent;
According to the width of the central point longitude and the regional extent of the random number, the regional extent, utilization is following
First formula generates virtual longitude;
First formula, including:
Wherein, x is for characterizing the virtual longitude, x0Central point longitude for characterizing the regional extent, w are used for table
The width of the regional extent is levied, r is for characterizing the random number;
According to the height of the central point latitude and the regional extent of the random number, the regional extent, utilization is following
Second formula generates virtual latitude;
Second formula, including:
Wherein, y is for characterizing the virtual latitude, y0Central point latitude for characterizing the regional extent, h are used for table
The height of the regional extent is levied, r is for characterizing the random number.
Second aspect, an embodiment of the present invention provides a kind of population longitude and latitude determining devices, including:
Setting unit, for map script to be arranged;
Acquiring unit, according to the population essential information, determines regional extent for obtaining population essential information;
Judging unit whether there is population longitude and latitude for judging in the population essential information that the acquiring unit obtains
Degree, if so, otherwise triggering execution unit triggers determination unit;
The execution unit, for judging the population longitude and latitude using the map script of setting unit setting
Whether in the regional extent, if not, triggering the determination unit;
The determination unit, the regional extent for being determined according to the acquiring unit, determines target demographic longitude and latitude
Degree;
Updating unit, it is basic that the target demographic longitude and latitude for being determined using the determination unit updates the population
Information.
Preferably,
The determination unit is used for A1:Random number is generated using pre-set random function;A2:According to the region
Range and the random number, generate virtual longitude and latitude;A3:Judge the virtual longitude and latitude whether in institute using the map script
It states in regional extent, if so, executing A4, otherwise, executes A1;A4:Determine that the virtual longitude and latitude is target demographic longitude and latitude.
Preferably,
The determination unit, for determine the central point longitude and latitude of the regional extent, the width of the regional extent and
Highly;According to the width of the central point longitude and the regional extent of the random number, the regional extent, following first are utilized
Formula generates virtual longitude;
First formula, including:
Wherein, x is for characterizing the virtual longitude, x0Central point longitude for characterizing the regional extent, w are used for table
The width of the regional extent is levied, r is for characterizing the random number;
According to the height of the central point latitude and the regional extent of the random number, the regional extent, utilization is following
Second formula generates virtual latitude;
Second formula, including:
Wherein, y is for characterizing the virtual latitude, y0Central point latitude for characterizing the regional extent, h are used for table
The height of the regional extent is levied, r is for characterizing the random number.
The third aspect, an embodiment of the present invention provides a kind of readable mediums, including execute instruction, when the place of storage control
When being executed instruction described in reason device execution, the storage control executes the method described in any of the above-described embodiment.
Fourth aspect, an embodiment of the present invention provides a kind of storage controls, including:Processor, memory and bus;
The memory is executed instruction for storing, and the processor is connect with the memory by the bus, when
When the storage control operation, the processor executes the described of memory storage and executes instruction, so that the storage
Controller executes the method described in any of the above-described embodiment.
An embodiment of the present invention provides a kind of population longitudes and latitudes to determine method and apparatus, wherein when in population essential information
It, can be according to regional extent when there is no population longitudes and latitudes or existing population longitude and latitude not in determining regional extent
It determines target demographic longitude and latitude, and the population essential information is updated using the target demographic longitude and latitude.This method can obtain
More accurate population longitude and latitude avoids the occurrence of that population longitude and latitude missing or population longitude and latitude are inaccurate.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments, based on the embodiments of the present invention, those of ordinary skill in the art
The every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
As shown in Figure 1, an embodiment of the present invention provides a kind of population longitudes and latitudes to determine that method, this method may include following
Step:
Step 101:Map script is set;
Step 102:Obtain population essential information;
Step 103:According to population essential information, regional extent is determined;
Step 104:Judge to whether there is population longitude and latitude in population essential information, if so, step 105 is executed, otherwise,
Execute step 106;
Step 105:Judge whether population longitude and latitude is interior at the regional level using map script, if not, executing step
106;
Step 106:According to regional extent, target demographic longitude and latitude is determined;
Step 107:Utilize target demographic longitude and latitude more New Population essential information.
When there is no population longitudes and latitudes or existing population longitude and latitude not in determining region model in population essential information
When enclosing interior, target demographic longitude and latitude can be determined according to regional extent, and basic using the target demographic longitude and latitude more New Population
Information.This method can obtain more accurate population longitude and latitude, avoid population longitude and latitude missing or population longitude and latitude inaccurate
The occurrence of true.
In one embodiment of the invention, in order to obtain more accurate population longitude and latitude, step 106, including:
A1:Random number is generated using pre-set random function;
A2:According to regional extent and random number, virtual longitude and latitude is generated;
A3:Judge whether virtual longitude and latitude is interior at the regional level using map script, if so, executing A4, otherwise, executes
A1;
A4:Determine that virtual longitude and latitude is target demographic longitude and latitude.
Ranging from the 0~1 of the random number that random function can generate.For example, the virtual longitude and latitude generated using random number 0.2
When degree is not interior at the regional level, needs to generate new random number 0.3 using random function again, random number 0.3 is recycled to generate
Virtual longitude and latitude, and so on, until the virtual longitude and latitude of generation is interior at the regional level.
In one embodiment of the invention, A2, including:
Determine the central point longitude and latitude of regional extent, the width and height of regional extent;
According to random number, the central point longitude of regional extent and the width of regional extent virtual warp is generated using formula (1)
Degree;
Wherein, x is for characterizing virtual longitude, x0Central point longitude for characterizing regional extent, w is for characterizing region model
The width enclosed, r is for characterizing random number;
According to random number, the central point latitude of regional extent and the height of regional extent virtual latitude is generated using formula (2)
Degree;
Wherein, y is for characterizing virtual latitude, y0Central point latitude for characterizing regional extent, h is for characterizing region model
The height enclosed, r is for characterizing random number.
In order to enable to population longitude and latitude be more in line with actual conditions, regional extent is generally the minimum row where population
Administrative division domain, for example, village.Determine that the general process of regional extent is as follows:Its home address information is taken out from population essential information,
The corresponding regional extent of population is determined according to the most final stage region ID of home address information in population essential information.
It should be noted that can be handled for a population essential information, it can also be directed to and include a plurality of population
The population information table of essential information is handled.
As shown in Fig. 2, the embodiment of the present invention determines that method carries out by taking a population essential information as an example, to population longitude and latitude
It explains in detail, this method includes:
Step 201:Map script is set.
Step 202:Obtain population essential information.
Step 203:According to population essential information, regional extent is determined.
Population essential information includes home address information, regional extent is determined according to home address information, in this implementation
In example, which is the minimum administrative region where population, village.
Step 204:Judge to whether there is population longitude and latitude in population essential information, if so, step 205 is executed, otherwise,
Execute step 206.
Step 205:Judge whether population longitude and latitude is interior at the regional level using map script, if not, executing step
206。
Step 206:Random number is generated using pre-set random function.
In the present embodiment, random number is any one number in 0~1.
Step 207:Determine the central point longitude and latitude of regional extent, the width and height of regional extent.
Most final stage region ID in home address information corresponds to the central point seat for taking out the regional extent in zone information table
The width and height of mark and the regional extent.
Step 208:According to random number, the central point longitude of regional extent and the width of regional extent, virtual longitude is generated.
Using formula (3), virtual longitude is generated,
Wherein, x is for characterizing virtual longitude, x0Central point longitude for characterizing regional extent, w is for characterizing region model
The width enclosed, r is for characterizing random number;
For example, the central point longitude of regional extent is x0=60 °, width w=10, the r=0.2 of regional extent, substitute into formula
(3), x=57 °.
Step 209:According to random number, the central point latitude of regional extent and the height of regional extent, virtual latitude is generated.
Using formula (4), virtual latitude is generated,
Wherein, y is for characterizing virtual latitude, y0Central point latitude for characterizing regional extent, h is for characterizing region model
The height enclosed, r is for characterizing random number.
For example, the central point latitude of regional extent is x0=50 °, height w=20, the r=0.1 of regional extent, substitute into formula
(3), y=42 °.
Step 210:Judge whether virtual longitude and latitude is interior at the regional level using map script, if so, executing step
211, otherwise, execute step 206.
Step 211:Determine that virtual longitude and latitude is target demographic longitude and latitude.
Step 212:Utilize target demographic longitude and latitude more New Population essential information.
In one embodiment of the invention, by taking poor household's information table as an example, the program of this method is realized and is carried out in detail
Ground explanation:
(1), poor household's information table Arc_Poor_Family is as shown in table 1, only enumerates the relevant portion of this flow in the following table
Divide field.
Table 1
Field number |
Field name |
Field type |
AAA001 |
ID |
Varchar(36) |
AZC001 |
Province number |
Varchar(20) |
AZC002 |
It numbers in city |
Varchar(20) |
AZC003 |
It numbers in county |
Varchar(20) |
AZC004 |
It numbers in township |
Varchar(20) |
AZC005 |
It numbers in village |
Varchar(20) |
LONGITUDE |
Longitude |
Number |
LATITUDE |
Latitude |
Number |
(2), the data of poor household are obtained by the table input module in ETL tools.
Select*from arc_poor_family where aad105=' national standard ' and NAD003!=0
(3), map administrative region table (VILLAGE) is as shown in table 2.
(4), the data in the table of village administrative region are obtained by the table input module in ETL tools.
Select*from VILLAGE
(5), it will be numbered by village with record set fastening means in ETL after the data sorting of two table input modules acquisition
It is attached.
Table 2
Field number |
Field name |
Field type |
ID |
ID |
Varchar(36) |
V_Code |
It numbers in village |
Varchar(20) |
LONGITUDE_center |
Central point longitude |
Varchar(20) |
LATITUDE_center |
Central point latitude |
Varchar(20) |
Width |
Peak width |
Varchar(20) |
Hight |
Region height |
Varchar(20) |
polygon |
Graphic limit |
SHAPE |
(6), after record set fastening means, a JavaScript processing component is closely followed.It completes in the assembly original
Whether there is or not the judgements with correctness for longitude and latitude, and are subsequently generated the operation of virtual longitude and latitude.
(7), using table more New Parent, in longitude and latitude x, the y update to table that will eventually determine.
As shown in figure 3, an embodiment of the present invention provides a kind of population longitude and latitude determining devices, including:
Setting unit 301, for map script to be arranged;
Acquiring unit 302, according to population essential information, determines regional extent for obtaining population essential information;
Judging unit 303, for judge acquiring unit 302 obtain population essential information in whether there is population longitude and latitude
Degree, if so, otherwise triggering execution unit 304 triggers determination unit 305;
Whether execution unit 304, the map script for being arranged using setting unit 301 judge population longitude and latitude in region
In range, if not, triggering determination unit 305;
Determination unit 305, the regional extent for being determined according to acquiring unit 302, determines target demographic longitude and latitude;
Updating unit 306, the target demographic longitude and latitude more New Population essential information for being determined using determination unit 305.
In one embodiment of the invention, determination unit 305 are used for A1:It is generated using pre-set random function
Random number;A2:According to regional extent and random number, virtual longitude and latitude is generated;A3:Judge that virtual longitude and latitude is using map script
It is no interior at the regional level, if so, executing A4, otherwise, execute A1;A4:Determine that virtual longitude and latitude is target demographic longitude and latitude.
In one embodiment of the invention, determination unit 305, central point longitude and latitude, area for determining regional extent
The width and height of domain range;According to random number, the central point longitude of regional extent and the width of regional extent, following are utilized
One formula generates virtual longitude;
First formula, including:
Wherein, x is for characterizing virtual longitude, x0Central point longitude for characterizing regional extent, w is for characterizing region model
The width enclosed, r is for characterizing random number;
It is generated using following second formula according to random number, the central point latitude of regional extent and the height of regional extent
Virtual latitude;
Second formula, including:
Wherein, y is for characterizing virtual latitude, y0Central point latitude for characterizing regional extent, h is for characterizing region model
The height enclosed, r is for characterizing random number.
The contents such as the information exchange between each unit, implementation procedure in above-mentioned apparatus, due to implementing with the method for the present invention
Example is based on same design, and particular content can be found in the narration in the method for the present invention embodiment, and details are not described herein again.
An embodiment of the present invention provides a kind of readable mediums, including execute instruction, when the processor of storage control executes
When executing instruction, method that storage control executes any of the above-described embodiment.
An embodiment of the present invention provides a kind of storage controls, including:Processor, memory and bus;
Memory is executed instruction for storing, and processor is connect with memory by bus, when storage control is run,
Processor executes executing instruction for memory storage, so that the method that storage control executes any of the above-described embodiment.
To sum up, each embodiment of the present invention at least has the following effects that:
1, in embodiments of the present invention, when there is no population longitudes and latitudes or existing population to pass through in population essential information
When latitude is not in determining regional extent, target demographic longitude and latitude can be determined according to regional extent, and utilize the target person
Mouth longitude and latitude more New Population essential information.This method can obtain more accurate population longitude and latitude, and population longitude and latitude is avoided to lack
The occurrence of mistake or population longitude and latitude are inaccurate.
It should be noted that herein, such as first and second etc relational terms are used merely to an entity
Or operation is distinguished with another entity or operation, is existed without necessarily requiring or implying between these entities or operation
Any actual relationship or order.Moreover, the terms "include", "comprise" or its any other variant be intended to it is non-
It is exclusive to include, so that the process, method, article or equipment including a series of elements includes not only those elements,
But also include other elements that are not explicitly listed, or further include solid by this process, method, article or equipment
Some elements.In the absence of more restrictions, the element limited by sentence " including a 〃 〃 ", it is not excluded that
There is also other identical factors in the process, method, article or apparatus that includes the element.
One of ordinary skill in the art will appreciate that:Realize that all or part of step of above method embodiment can pass through
The relevant hardware of program instruction is completed, and program above-mentioned can be stored in computer-readable storage medium, the program
When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes:ROM, RAM, magnetic disc or light
In the various media that can store program code such as disk.
Finally, it should be noted that:The foregoing is merely presently preferred embodiments of the present invention, is merely to illustrate the skill of the present invention
Art scheme, is not intended to limit the scope of the present invention.Any modification for being made all within the spirits and principles of the present invention,
Equivalent replacement, improvement etc., are included within the scope of protection of the present invention.