CN102841933B - Method and device for writing raster data and method for reading raster data - Google Patents

Method and device for writing raster data and method for reading raster data Download PDF

Info

Publication number
CN102841933B
CN102841933B CN201210277886.5A CN201210277886A CN102841933B CN 102841933 B CN102841933 B CN 102841933B CN 201210277886 A CN201210277886 A CN 201210277886A CN 102841933 B CN102841933 B CN 102841933B
Authority
CN
China
Prior art keywords
value
raster data
target
grid cells
integer numbers
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
Application number
CN201210277886.5A
Other languages
Chinese (zh)
Other versions
CN102841933A (en
Inventor
孙成宝
郑国柱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Datum Science & Technology Development Co Ltd
Original Assignee
Beijing Datum Science & Technology Development Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Datum Science & Technology Development Co Ltd filed Critical Beijing Datum Science & Technology Development Co Ltd
Priority to CN201210277886.5A priority Critical patent/CN102841933B/en
Publication of CN102841933A publication Critical patent/CN102841933A/en
Application granted granted Critical
Publication of CN102841933B publication Critical patent/CN102841933B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a method and a device for writing raster data and a method and a device for reading raster data. The method for writing the raster data comprises following steps of S101, acquiring original raster data; S102, sequentially extracting value of nine continuous raster units; S103, judging the value of the nine continuous raster units falls in between 0 to 9 or not; executing the step S104 if the value of the nine continuous raster units falls in between 0 to 9, and otherwise executing the step S105; S104, adopting a first target numerical value to substitute the value of the nine continuous raster units; S105, extracting the value of the first four raster units from the value of the nine continuous raster units, and adopting a second target numerical value to substitute the value of the four continuous raster units; S106, judging whether all raster units are traversed or not, and executing the step S107 if all raster units are traversed; otherwise returning to the step S102; and S107, organizing the first target numerical value and the second target numerical value to target raster data. Due to adopting the method and the device, the storage space of the raster data can be saved, and the processing efficiency of the raster data can be improved.

Description

The method of raster data write and device, the method that raster data reads and device
Technical field
The application relates to the technical field of raster data processing, particularly relates to a kind of wiring method of raster data, a kind of writing station of raster data, a kind of read method of raster data, and a kind of reading device of raster data.
Background technology
Raster data is the data structure based on Raster Data Model, refers to and compartition is become well-regulated grid, be called grid cell, each grid cell provides corresponding property value to represent a kind of Organization of Data form of geographical entity.In modern generalized information system application, a large amount of use raster datas, especially magnanimity raster data, to the storage space of application system, performance requirement, network broadband etc. are proposed a lot of challenge.
Suppose that raster data arranges a grid cell by the capable N of M and forms, what each grid cell stored is 0 to 99 round values.If by commonsense method, each grid cell 1 byte stores, then need M*N byte, and required storage space is very large, this storage to system, performance, and the transfer efficiency of network all requires very high.
Therefore, those skilled in the art's technical matters in the urgent need to address is how to save the storage space of raster data, improves the treatment effeciency of raster data.
Summary of the invention
Technical problems to be solved in this application are to provide method and the device of the write of a kind of raster data, and the method that raster data reads and device, in order to save the storage space of raster data, improve the treatment effeciency of raster data.
In order to solve the problem, this application discloses the method for a kind of raster data write, comprising:
Step S101, obtains original raster data, and described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, described M is row, and N is row;
Step S102, extracts the value of 9 continuous grid cells successively from a described M*N grid cell;
Step S103, judges that the value of described 9 continuous grid cells is whether between 0 to 9 respectively; If so, then perform step S104, if not, then perform step S105;
Step S104, adopts first object numerical value to replace the value of described 9 continuous grid cells; Described first object numerical value is the 4 byte integer numbers generated according to the value of described 9 continuous grid cells;
Step S105, extracts the value of front 4 grid cells from the value of described 9 continuous grid cells, adopts the second target value to replace the value of described 4 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells;
Step S106, judges whether to have traveled through a described M*N grid cell, if so, then performs step S107; If not, then step S102 is returned;
Step S107, is organized as target raster data by described first object numerical value and the second target value, writes described target raster data.
Preferably, after described step S102, also comprise the steps:
Step S1021, if extract 9-K grid cell continuously from a described M*N grid cell, then supplements K eigenwert, wherein K > 0, K < 9.
Preferably, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells.
Preferably, described second target value is the 4 byte integer numbers that the value extracting front 4 grid cells in value according to described 9 continuous grid cells is merged into.
The embodiment of the present application also discloses the device of a kind of raster data write, comprising:
Original raster data acquisition module, for obtaining original raster data, described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, described M is row, and N is row;
Grid cell extraction module, for extracting the value of 9 continuous grid cells successively from a described M*N grid cell;
Grid cell numerical value judge module, for judging that the value of described 9 continuous grid cells is whether between 0 to 9 respectively; If so, then call first object numerical generation module, if not, then call the second target value generation module;
First object numerical generation module, for the value adopting first object numerical value to replace described 9 continuous grid cells; Described first object numerical value is the 4 byte integer numbers generated according to the value of described 9 continuous grid cells;
Second target value generation module, for extracting the value of front 4 grid cells in the value from described 9 continuous grid cells, adopts the second target value to replace the value of described 4 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells;
Ergodic judgement module, has traveled through a described M*N grid cell for judging whether, if so, then invocation target raster data writing module; If not, then grid cell extraction module is returned;
Target raster data writing module, for described first object numerical value and the second target value are organized as target raster data, writes described target raster data.
Preferably, described device also comprises:
Complementary module, if for extracting 9-K grid cell continuously from a described M*N grid cell, then supplement K eigenwert, wherein K > 0, K < 9.
Preferably, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells.
Preferably, described second target value is the 4 byte integer numbers that the value extracting front 4 grid cells in value according to described 9 continuous grid cells is merged into.
The embodiment of the present application also discloses a kind of method that raster data reads, and comprising:
Step S201, read target raster data, described target raster data comprises first object numerical value and the second target value;
Wherein, described first object numerical value is the 4 byte integer numbers generated according to the value of 9 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of 4 continuous grid cells;
Step S202, resolves the grid cell value in described target raster data successively, judges it is as first object numerical value or the second target value; If first object numerical value, then perform step S203, if the second target value, then perform step 204;
Step S203, is reduced into the value of 9 continuous grid cells from 4 byte integer numbers by described first object numerical value;
Step S204, is reduced into the value of 4 continuous grid cells from 4 byte integer numbers by described second target value;
Step S205, judges whether to have traveled through described target raster data, if so, then performs step S206; If not, then step S202 is returned;
Step S206, organizes the value of described grid cell according to the order of sequence, obtains original raster data, and described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprises M*N grid cell, and each grid cell has corresponding value; Wherein, described M is row, and N is row.
Preferably, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells; Described step S203 comprises:
By 4 byte integer numbers of the grid cell value in described target raster data, deducting 10 integer numbers, is the value of 9 continuous grid cells by result of calculation arranged in sequence.
Preferably, described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells, and described step S204 comprises:
By 4 byte integer numbers of the grid cell value in described target raster data, be extracted as the value of 4 continuous grid cells according to the order of sequence.
Preferably, described step S202 comprises:
Resolve the grid cell value in described target raster data successively, judge whether current grid cell value is greater than 10 integer numbers, be if so, then judged to be order first object numerical value, if not, be then judged to be the second target value.
The embodiment of the present application also discloses the device that a kind of raster data reads, and comprising:
Target raster data read module, for reading target raster data, described target raster data comprises first object numerical value and the second target value;
Wherein, described first object numerical value is the 4 byte integer numbers generated according to the value of 9 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of 4 continuous grid cells;
Target value judge module, for resolving the grid cell value in described target raster data successively, judges it is as first object numerical value or the second target value; If first object numerical value, then call first object numerical value recovery module, if the second target value, then call the second target value recovery module;
First object numerical value recovery module, for being reduced into the value of 9 continuous grid cells from 4 byte integer numbers by described first object numerical value;
Second target value recovery module, for being reduced into the value of 4 continuous grid cells from 4 byte integer numbers by described second target value;
Ergodic judgement module, having traveled through described target raster data for judging whether, if so, then having called original raster data acquisition module; If not, then judge module is returned;
Original raster data acquisition module, organize the value of described grid cell according to the order of sequence, obtain original raster data, described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprise M*N grid cell, each grid cell has corresponding value; Wherein, described M is row, and N is row.
Preferably, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells; Described first object numerical value recovery module comprises:
First calculating sub module, for the 4 byte integer numbers by the grid cell value in described target raster data, deducts 10 integer numbers;
Arrangement submodule, for by result of calculation arranged in sequence being the value of 9 continuous grid cells.
Preferably, described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells, and described second target value recovery module comprises:
Extract submodule according to the order of sequence, for the 4 byte integer numbers by the grid cell value in described target raster data, be extracted as the value of 4 continuous grid cells according to the order of sequence;
Preferably, described target value judge module comprises:
Judge submodule, for resolving the grid cell value in described target raster data successively, judging whether current grid cell value is greater than 10 integer numbers, is if so, then judged to be first object numerical value, if not, being then judged to be the second target value.
Compared with prior art, the application comprises following advantage:
The value of the application to grid cells all in raster data is all distributed in the raster data of the integer between 0 to 99, original raster data is extracted successively 9 grid cells, if get the Distribution value of grid cell between 0 to 9, then substitute with the integer number of 4 bytes, greatly can save storage space.If get grid cell value be not be distributed between 0 to 9, the value of front four grid cells of got grid cell is then substituted with the integer number of 4 bytes, the grid cell data of so original use 4 bytes store still use 4 bytes store, do not waste additional storage space.
In the application's preferred embodiment, 9 continuous print grid cells in original grid cell can be substituted with the integer number of 4 bytes, in this case, the raster data of original need 9 byte, can store by 4 bytes, like this, when carrying out raster data backup, information that can be same with less Resource Storage, takes full advantage of storage space.
In addition, due to the minimizing of storage space, the application can also reduce the data volume of file read-write, decreases the transmission volume of raster data simultaneously, improves the treatment effeciency of raster data.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the embodiment of the method for a kind of raster data write of the application;
Fig. 2 is the application's raster data transition diagram 1;
Fig. 3 is the application's raster data transition diagram 2;
Fig. 4 is the application whole nation topography and geomorphology raster data schematic diagram;
Fig. 5 is the process flow diagram of the embodiment of the method that a kind of raster data of the application reads;
Fig. 6 is the structured flowchart of the device embodiment of a kind of raster data write of the application;
Fig. 7 is the structured flowchart of the device embodiment that a kind of raster data of the application reads.
Embodiment
For enabling above-mentioned purpose, the feature and advantage of the application more become apparent, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
One of core idea of the application is, for the raster data of a class particular type, namely all grid cell values are all distributed in the raster data of the integer between 0 to 99, original raster data is extracted successively 9 grid cells, if get the Distribution value of grid cell between 0 to 9, then substitute with the integer number of 4 bytes, greatly can save storage space.If get grid cell value be not be distributed between 0 to 9, the value of front four grid cells of got grid cell is then substituted with the integer number of 4 bytes, the grid cell data of so original use 4 bytes store still use 4 bytes store, do not waste additional storage space.
With reference to Fig. 1, show the flow chart of steps of the embodiment of the method for a kind of raster data write of the application, the application is for the raster data of a class particular type, namely all grid cell values are all distributed in the raster data (such as describing 56 the ethnic distribution situation raster datas in the whole nation) of the integer between 0 to 99, and the present embodiment specifically can comprise the steps:
Step S101, obtains original raster data;
Wherein, described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprises M*N grid cell; Described M is row, and N is row.
Step S102, extracts the value of 9 continuous grid cells successively from a described M*N grid cell;
In specific implementation, for M*N grid cell of described original grid network data, can start anew, get 9 grid cells successively continuously.
Step S103, judges that the value of described 9 continuous grid cells is whether between 0 to 9 respectively; If so, then perform step S104, if not, then perform step S105;
Step S104, adopts first object numerical value to replace the value of described 9 continuous grid cells;
Wherein, described first object numerical value can be the 4 byte integer numbers generated according to the value of described 9 continuous grid cells.
In a preferred embodiment of the present application, described first object numerical value can be the 4 byte integer numbers that employing 10 integer numbers add the value gained of described 9 continuous grid cells.Such as, described 10 integer numbers can value be 1000000000, then the computing formula of described first object numerical value A can be:
A=1000000000+a1a2a3a4a5a6a7a8a9;
Wherein a1, a2, a3, a4, a5, a6, a7, a8, a9 are the value of continuous 9 grid cells respectively.
With reference to Fig. 2, when the value of 9 grid cells extracted continuously is successively 8,3,1,5,2,4,6,2,7, described first object numerical value is that employing 10 integer numbers 1000000000 are added with 831524627, and gained is 1831524627.In this case, originally need the data of 9 bytes of storage space, only need now the storage space of 4 bytes, when carrying out raster data backup, can storage resources be made full use of, greatly save storage space.
Step S105, extracts the value of front 4 grid cells from the value of described 9 continuous grid cells, adopts the second target value to replace the value of described 4 continuous grid cells;
Wherein, described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells.
In a preferred embodiment of the present application, the 4 byte integer numbers that described second target value can be merged into for the value extracting front 4 grid cells in the value according to described 9 continuous grid cells.
Application the present embodiment, if the value of these 9 grid cells is also not all in 0 to 9, first can get front 4 grid cells of these 9 grid cells, each grid cell is write as double figures, then form the integer number of 4 bytes in order, 5 of remainder grid cells are reformulated together with follow-up 4 grid cells new continuous 9 grid cells, 9 grid cells new to this, according to said method process again, until process M*N grid cell.
With reference to Fig. 3, when the value of 9 grid cells extracted continuously is successively 12,3,31,5,6,4,6,2,7, because the value of these 9 grid cells is also not all in 0 to 9, first can get front 4 grid cells 12,3,31,5 of these 9 grid cells, described second target value is that these 4 grid cells merge, and institute's total is nybble integer number 12033105.In this case, originally still used 4 bytes store by the grid cell data of 4 bytes store, do not waste additional storage space.
Step S106, judges whether to have traveled through a described M*N grid cell, if so, then performs step S107; If not, then step S102 is returned;
In specific implementation, if to whole raster data processing to last remaining less than 9 grid cells, then add to 9 grid cells with eigenwert.Namely in this case, the embodiment of the present application can also comprise the following steps:
If extract 9-K grid cell continuously from a described M*N grid cell, then supplement K eigenwert, wherein K > 0, K < 9.
Such as, described eigenwert can get 0 value, when extracting less than 9 grid cells 3,6,7,4,8, then can supplement 40 value grid cells, and 9 the continuous grid cells finally supplementing gained are 3,6,7,4,8,0,0,0,0.
Step S107, is organized as target raster data by described first object numerical value and the second target value, writes described target raster data.
According to said method, by traveling through whole original raster data, original raster data is re-assemblied according to the order of sequence, value for 9 continuous grid cells of meet the requirements (grid cell value is between 0 to 9) adopts 4 byte integer numbers (first object numerical value) to replace, for undesirable 9 continuous grid cells, extract the value of its front 4 continuous grid cells, the second target value is adopted to replace, and next round traversal will be put into by 5 continuous grid cells thereafter, thus a brand-new raster data (target raster data) can be obtained, 9 continuous grid cell values of being replaced by 4 byte integer numbers are comprised in the target raster data obtained.
Application the embodiment of the present application, store again after original raster data is assembled, storage space can be reduced, especially in original raster data, the value major part of grid cell is distributed between 0 to 9, and it is very concentrated to distribute, other range values be proportion very little time, then can reduce storage significantly and take up room.The ethnic distribution situation of such as nationwide population, Han nationality is represented with numerical value 0,1 represents Zhuang, and 2 represent the Manchu ..., in this case, the data of scope between 0 to 9 account for very high proportion, also very concentrated, effectively can utilize storage space to this kind of market demand the embodiment of the present application, save the storage space of raster data, improve the treatment effeciency of raster data.
With reference to Fig. 4, for the national topography and geomorphology raster data in actual items, various mountain region is represented respectively with the value of 0 to 9 in grid cell, the geomorphic type in Plain, represent the geomorphic type of other rarenesses with the value between 11 to 99 in other grid cells, the resolution of raster data is 30 meters, and pixel size is 161360*134724.In this case, according to common raster data method for organizing, the storage space then needed is about 20.25Gb, store if the method described in employing the application carries out assembling, then the storage space needed is about 10.7Gb, uses the storage resources of about original half can store same grid cell information, so not only save storage space, decrease the data volume of file read-write, decrease the transmission volume of raster data simultaneously, substantially increase performance and the Consumer's Experience sense of system.
It should be noted that, due to the maximum integer number representing 10 of the integer data type of 4 bytes on 32 machines, the integer number number be made up of 43 figure places cannot be represented, because 12 figure places have exceeded the denotable scope of integer data type, but the integer number of 42 figure place compositions can be represented, therefore the embodiment of the present application is only for the raster data of a class particular type, namely all grid cell values are all distributed in the raster data of the integer between 0 to 99.
With reference to Fig. 5, the flow chart of steps of the embodiment of the method that a kind of raster data showing the application reads, the present embodiment specifically can comprise the steps:
Step S201, read target raster data, described target raster data comprises first object numerical value and the second target value;
Wherein, described first object numerical value is the 4 byte integer numbers generated according to the value of 9 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of 4 continuous grid cells;
Step S202, resolves the grid cell value in described target raster data successively, judges it is as first object numerical value or the second target value; If first object numerical value, then perform step S203, if the second target value, then perform step S204;
In a preferred embodiment of the present application, described step S202 can comprise:
Resolve the grid cell value in described target raster data successively, judge whether current grid cell value is greater than 10 integer numbers, be if so, then judged to be order first object numerical value, if not, be then judged to be the second target value.
Step S203, is reduced into the value of 9 continuous grid cells from 4 byte integer numbers by described first object numerical value;
In a preferred embodiment of the present application, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells; Described step S203 can comprise:
By 4 byte integer numbers of the grid cell value in described target raster data, deducting 10 integer numbers, is the value of 9 continuous grid cells by result of calculation arranged in sequence.
Such as, described 10 integer numbers can value be 1000000000, when first object numerical value is 1026378109, first object numerical value are deducted 1000000000, result of calculation is 026378109, then the value of 9 the continuous grid cells reduced is 0,2,6,3,7,8,1,0,9.
Step S204, is reduced into the value of 4 continuous grid cells from 4 byte integer numbers by described second target value;
In a preferred embodiment of the present application, described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells, and described step S203 comprises:
By 4 byte integer numbers of the grid cell value in described target raster data, be extracted as the value of 4 continuous grid cells according to the order of sequence.
Such as, when described second target value value is 3456, then the value of 4 the continuous grid cells reduced is 0,0,34,56.Again such as, when described second target value value is 23453000, then the value of 4 the continuous grid cells reduced is 23,45,30,0.
Step S205, judges whether to have traveled through described target raster data, if so, then performs step S206; If not, then step S202 is returned;
Step S206, organizes the value of described grid cell according to the order of sequence, obtains original raster data, and described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprises M*N grid cell, and each grid cell has corresponding value; Wherein, described M is row, and N is row.
It should be noted that, for embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the application is not by the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and involved action and module might not be that the application is necessary.
With reference to Fig. 6, show the structured flowchart of the device embodiment of a kind of raster data write of the application, the present embodiment specifically can comprise as lower module:
Original raster data acquisition module S301, for obtaining original raster data, described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, described M is row, and N is row;
Grid cell extraction module S302, for extracting the value of 9 continuous grid cells successively from a described M*N grid cell;
Grid cell numerical value judge module S303, for judging that the value of described 9 continuous grid cells is whether between 0 to 9 respectively; If so, then call first object numerical generation module S304, if not, then call the second target value generation module S305;
First object numerical generation module S304, for the value adopting first object numerical value to replace described 9 continuous grid cells; Described first object numerical value is the 4 byte integer numbers generated according to the value of described 9 continuous grid cells;
In a preferred embodiment of the present application, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells.
Second target value generation module S305, for extracting the value of front 4 grid cells in the value from described 9 continuous grid cells, adopts the second target value to replace the value of described 4 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells;
In a preferred embodiment of the present application, described second target value is the 4 byte integer numbers that the value extracting front 4 grid cells in the value according to described 9 continuous grid cells is merged into.
Ergodic judgement module S306, has traveled through a described M*N grid cell for judging whether, if so, then invocation target raster data writing module; If not, then grid cell extraction module is called;
In a preferred embodiment of the present application, also comprise:
Complementary module, if for extracting 9-K grid cell continuously from a described M*N grid cell, then supplement K eigenwert, wherein K > 0, K < 9.
Target raster data writing module S307, for described first object numerical value and the second target value are organized as target raster data, writes described target raster data.
For the device embodiment shown in Fig. 6, due to the embodiment of the method basic simlarity shown in itself and Fig. 1, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
With reference to Fig. 7, the structured flowchart of the device embodiment that a kind of raster data showing the application reads, the present embodiment specifically can comprise as lower module:
Target raster data read module S401, for reading target raster data, described target raster data comprises first object numerical value and the second target value;
Wherein, described first object numerical value is the 4 byte integer numbers generated according to the value of 9 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of 4 continuous grid cells;
Target value judge module S402, for resolving the grid cell value in described target raster data successively, judges it is as first object numerical value or the second target value; If first object numerical value, then call first object numerical value recovery module S403, if the second target value, then call the second target value recovery module S404;
In a preferred embodiment of the present application, described target value judge module S402 comprises:
Judge submodule, for resolving the grid cell value in described target raster data successively, judging whether current grid cell value is greater than 10 integer numbers, being if so, then judged to be order first object numerical value, if not, being then judged to be the second target value.
First object numerical value recovery module S403, for being reduced into the value of 9 continuous grid cells from 4 byte integer numbers by described first object numerical value;
In a preferred embodiment of the present application, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells; Described first object numerical value recovery module S403 comprises:
First calculating sub module, for the 4 byte integer numbers by the grid cell value in described target raster data, deducts 10 integer numbers;
Arrangement submodule, for by result of calculation arranged in sequence being the value of 9 continuous grid cells.
Second target value recovery module S404, for being reduced into the value of 4 continuous grid cells from 4 byte integer numbers by described second target value;
In a preferred embodiment of the present application, described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells, and described second target value recovery module S404 comprises:
Extract submodule according to the order of sequence, for the 4 byte integer numbers by the grid cell value in described target raster data, be extracted as the value of 4 continuous grid cells according to the order of sequence;
Ergodic judgement module S405, has traveled through described target raster data for judging whether, if so, then calls original raster data acquisition module S406; If not, then judge module S402 is returned;
Original raster data acquisition module S406, organize the value of described grid cell according to the order of sequence, obtain original raster data, described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprise M*N grid cell, each grid cell has corresponding value; Wherein, described M is row, and N is row.
For the device embodiment shown in Fig. 7, due to the embodiment of the method basic simlarity shown in itself and Fig. 5, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.
Those skilled in the art should understand, the embodiment of the application can be provided as method, device or computer program.Therefore, the application can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the application can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The application describes with reference to according to the process flow diagram of the method for the embodiment of the present application, equipment (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although described the preferred embodiment of the application, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the application's scope.
Finally, also it should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
Above to method and the device of a kind of raster data write that the application provides, and a kind of method that reads of raster data and device, be described in detail, apply specific case herein to set forth the principle of the application and embodiment, the explanation of above embodiment is just for helping method and the core concept thereof of understanding the application; Meanwhile, for one of ordinary skill in the art, according to the thought of the application, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application.

Claims (16)

1. a method for raster data write, is characterized in that, comprising:
Step S101, obtains original raster data, and described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, described M is row, and N is row;
Step S102, extracts the value of 9 continuous grid cells successively from a described M*N grid cell;
Step S103, judges that the value of described 9 continuous grid cells is whether between 0 to 9 respectively; If so, then perform step S104, if not, then perform step S105;
Step S104, adopts first object numerical value to replace the value of described 9 continuous grid cells; Described first object numerical value is the 4 byte integer numbers generated according to the value of described 9 continuous grid cells; Then, step S106 is performed;
Step S105, extracts the value of front 4 grid cells from the value of described 9 continuous grid cells, adopts the second target value to replace the value of described 4 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells;
Step S106, judges whether to have traveled through a described M*N grid cell, if so, then performs step S107; If not, then step S102 is returned;
Step S107, is organized as target raster data by described first object numerical value and the second target value, writes described target raster data.
2. method according to claim 1, is characterized in that, after described step S102, also comprises the steps:
Step S1021, if extract 9-K grid cell continuously from a described M*N grid cell, then supplements K eigenwert, wherein K>0, K<9.
3. method according to claim 1 and 2, is characterized in that, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells.
4. method according to claim 3, is characterized in that, described second target value is the 4 byte integer numbers that the value extracting front 4 grid cells in the value according to described 9 continuous grid cells is merged into.
5. a device for raster data write, is characterized in that, comprising:
Original raster data acquisition module, for obtaining original raster data, described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, described M is row, and N is row;
Grid cell extraction module, for extracting the value of 9 continuous grid cells successively from a described M*N grid cell;
Grid cell numerical value judge module, for judging that the value of described 9 continuous grid cells is whether between 0 to 9 respectively; If so, then call first object numerical generation module, if not, then call the second target value generation module;
First object numerical generation module, for the value adopting first object numerical value to replace described 9 continuous grid cells; Described first object numerical value is the 4 byte integer numbers generated according to the value of described 9 continuous grid cells;
Second target value generation module, for extracting the value of front 4 grid cells in the value from described 9 continuous grid cells, adopts the second target value to replace the value of described 4 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells;
Ergodic judgement module, has traveled through a described M*N grid cell for judging whether, if so, then invocation target raster data writing module; If not, then grid cell extraction module is returned;
Target raster data writing module, for described first object numerical value and the second target value are organized as target raster data, writes described target raster data.
6. device according to claim 5, is characterized in that, also comprises:
Complementary module, if for extracting 9-K grid cell continuously from a described M*N grid cell, then supplement K eigenwert, wherein K>0, K<9.
7. the device according to claim 5 or 6, is characterized in that, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells.
8. device according to claim 7, is characterized in that, described second target value is the 4 byte integer numbers that the value extracting front 4 grid cells in the value according to described 9 continuous grid cells is merged into.
9. a method for raster data reading, is characterized in that, comprising:
Step S201, read target raster data, described target raster data comprises first object numerical value and the second target value;
Wherein, described first object numerical value is the 4 byte integer numbers generated according to the value of 9 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of 4 continuous grid cells;
Step S202, resolves the grid cell value in described target raster data successively, judges it is as first object numerical value or the second target value; If first object numerical value, then perform step S203, if the second target value, then perform step 204;
Step S203, is reduced into the value of 9 continuous grid cells from 4 byte integer numbers by described first object numerical value; Then, step S205 is performed;
Step S204, is reduced into the value of 4 continuous grid cells from 4 byte integer numbers by described second target value;
Step S205, judges whether to have traveled through described target raster data, if so, then performs step S206; If not, then step S202 is returned;
Step S206, organizes the value of described grid cell according to the order of sequence, obtains original raster data, and described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprises M*N grid cell, and each grid cell has corresponding value; Wherein, described M is row, and N is row.
10. method according to claim 9, is characterized in that, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells; Described step S203 comprises:
By 4 byte integer numbers of the grid cell value in described target raster data, deducting 10 integer numbers, is the value of 9 continuous grid cells by result of calculation arranged in sequence.
11. methods according to claim 9 or 10, it is characterized in that, described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells, and described step S204 comprises:
By 4 byte integer numbers of the grid cell value in described target raster data, be extracted as the value of 4 continuous grid cells according to the order of sequence.
12. methods according to claim 11, is characterized in that, described step S202 comprises:
Resolve the grid cell value in described target raster data successively, judge whether current grid cell value is greater than 10 integer numbers, be if so, then judged to be order first object numerical value, if not, be then judged to be the second target value.
The device that 13. 1 kinds of raster datas read, is characterized in that, comprising:
Target raster data read module, for reading target raster data, described target raster data comprises first object numerical value and the second target value;
Wherein, described first object numerical value is the 4 byte integer numbers generated according to the value of 9 continuous grid cells; Described second target value is the 4 byte integer numbers generated according to the value of 4 continuous grid cells;
Target value judge module, for resolving the grid cell value in described target raster data successively, judges it is as first object numerical value or the second target value; If first object numerical value, then call first object numerical value recovery module, if the second target value, then call the second target value recovery module;
First object numerical value recovery module, for being reduced into the value of 9 continuous grid cells from 4 byte integer numbers by described first object numerical value;
Second target value recovery module, for being reduced into the value of 4 continuous grid cells from 4 byte integer numbers by described second target value;
Ergodic judgement module, having traveled through described target raster data for judging whether, if so, then having called original raster data acquisition module; If not, then judge module is returned;
Original raster data acquisition module, organize the value of described grid cell according to the order of sequence, obtain original raster data, described original raster data is the raster data that all grid cell values are all distributed in the integer between 0 to 99, comprise M*N grid cell, each grid cell has corresponding value; Wherein, described M is row, and N is row.
14. devices according to claim 13, is characterized in that, described first object numerical value is the 4 byte integer numbers that 10 integer numbers add the value gained of described 9 continuous grid cells; Described first object numerical value recovery module comprises:
First calculating sub module, for the 4 byte integer numbers by the grid cell value in described target raster data, deducts 10 integer numbers;
Arrangement submodule, for by result of calculation arranged in sequence being the value of 9 continuous grid cells.
15. devices according to claim 13 or 14, it is characterized in that, described second target value is the 4 byte integer numbers generated according to the value of described 4 continuous grid cells, and described second target value recovery module comprises:
Extract submodule according to the order of sequence, for the 4 byte integer numbers by the grid cell value in described target raster data, be extracted as the value of 4 continuous grid cells according to the order of sequence.
16. devices according to claim 15, is characterized in that, described target value judge module comprises:
Judge submodule, for resolving the grid cell value in described target raster data successively, judging whether current grid cell value is greater than 10 integer numbers, is if so, then judged to be first object numerical value, if not, being then judged to be the second target value.
CN201210277886.5A 2012-08-06 2012-08-06 Method and device for writing raster data and method for reading raster data Active CN102841933B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210277886.5A CN102841933B (en) 2012-08-06 2012-08-06 Method and device for writing raster data and method for reading raster data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210277886.5A CN102841933B (en) 2012-08-06 2012-08-06 Method and device for writing raster data and method for reading raster data

Publications (2)

Publication Number Publication Date
CN102841933A CN102841933A (en) 2012-12-26
CN102841933B true CN102841933B (en) 2015-01-14

Family

ID=47369296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210277886.5A Active CN102841933B (en) 2012-08-06 2012-08-06 Method and device for writing raster data and method for reading raster data

Country Status (1)

Country Link
CN (1) CN102841933B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527929B (en) * 2020-10-20 2023-12-08 深圳银星智能集团股份有限公司 Grid map coding method and device and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5504591A (en) * 1994-04-25 1996-04-02 Microsoft Corporation System and method for compressing graphic images
CN102508853A (en) * 2011-09-28 2012-06-20 北京地拓科技发展有限公司 Method and system for filling raster data

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6836564B2 (en) * 2000-04-28 2004-12-28 Denso Corporation Image data compressing method and apparatus which compress image data separately by modifying color

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5504591A (en) * 1994-04-25 1996-04-02 Microsoft Corporation System and method for compressing graphic images
CN102508853A (en) * 2011-09-28 2012-06-20 北京地拓科技发展有限公司 Method and system for filling raster data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《基于2维形成的栅格数据快速动态压缩算法》;吴正升 等;《测绘科学技术学报》;20070615;全文 *
《浅谈栅格数据结构及其压缩编码方法》;马丽 等;《郑州工业高等专科学校学报》;20040930;全文 *

Also Published As

Publication number Publication date
CN102841933A (en) 2012-12-26

Similar Documents

Publication Publication Date Title
CN101699405B (en) Method and device for interaction between host program and plug-in and interaction between plug-ins
CN104732574B (en) The compression method and device of a kind of role play
CN102411616B (en) Method and system for storing data and data management method
CN104077446B (en) The method and system of two-dimentional electrical construction document are extracted from digital three-dimemsional model
CN106844288A (en) A kind of random string generation method and device
CN102867023B (en) Method for storing and reading grid data and device
CN106375360A (en) Method, device and system for updating graph data
CN105867944A (en) Web front-end terminal operating layer and implementing method thereof
CN106168959A (en) Page layout method and device
CN103049561B (en) A kind of data compression method, storage engines and storage system
CN109684517A (en) A kind of historical data storage method, reading/writing method, storage device and equipment
CN102841933B (en) Method and device for writing raster data and method for reading raster data
CN102799750B (en) Method for quickly generating common side and non-common sides of geometry surface triangle
CN112154413A (en) Configuration file generation method and device and storage medium
CN109658094B (en) Random walk, random walk method based on cluster, random walk device and equipment
CN110221778A (en) Processing method, system, storage medium and the electronic equipment of hotel&#39;s data
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium
CN103020071A (en) Data synchronization method and data synchronization device
CN102902629B (en) memory space mapping method and device
CN102446164A (en) Analytic method, device and operation system of report formula
CN112287032B (en) Block chain data storage method and device and block chain link points
CN105488047A (en) Metadata read-write method and device
CN104932982B (en) A kind of Compilation Method and relevant apparatus of message memory access
CN103124309B (en) Method and terminal for read-write control of mobile phone files
CN107515867A (en) The generation method and device that data storage, querying method and the device and a kind of rowKey of a kind of NoSQL databases combine entirely

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant