CN102841933A - 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
CN102841933A
CN102841933A CN2012102778865A CN201210277886A CN102841933A CN 102841933 A CN102841933 A CN 102841933A CN 2012102778865 A CN2012102778865 A CN 2012102778865A CN 201210277886 A CN201210277886 A CN 201210277886A CN 102841933 A CN102841933 A CN 102841933A
Authority
CN
China
Prior art keywords
value
raster data
target
target value
grid cell
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.)
Granted
Application number
CN2012102778865A
Other languages
Chinese (zh)
Other versions
CN102841933B (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

Images

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

Method that method that raster data writes and device, raster data read and device
Technical field
The application relates to raster data Treatment Technology field, 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 based on the data structure of Raster Data Model, is meant spatial is slit into well-regulated grid, is called grid cell, on each grid cell, provides a kind of data organization form that the corresponding property value is represented geographical entity.During generalized information system is used in modern times, a large amount of use raster datas, especially magnanimity raster data, to using the storage space of system, performance requirement, network broadband etc. have all proposed a lot of challenges.
Suppose that raster data is made up of the capable N of a M row grid cell, each grid cell is stored is 0 to 99 round values.If use commonsense method, each grid cell is stored with 1 byte, then needs M*N byte, and required storage space is very big, this storage, performance to system, and the transfer efficiency of network all requires very high.
Therefore, the technical matters that those skilled in the art press for solution is how to save the storage space of raster data, improves the treatment effeciency of raster data.
Summary of the invention
The application's technical matters to be solved provides method and the device that a kind of raster data writes, and 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 address the above problem, the application discloses the method that a kind of raster data writes, and comprising:
Step S101 obtains original raster data, and said original raster data is the raster data that all grid cell values all are distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, said M is row, and N is row;
Step S102 extracts the value of 9 continuous grid cells successively from a said M*N grid cell;
Step S103, whether the value of judging said 9 continuous grid cells respectively is between 0 to 9; If, execution in step S104 then, if not, execution in step S105 then;
Step S104 adopts first target value to replace the value of said 9 continuous grid cells; Said first target value is 4 byte integers according to the value generation of said 9 continuous grid cells;
Step S105, the value of preceding 4 grid cells of extraction adopts second target value to replace the value of said 4 continuous grid cells from the value of said 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of said 4 continuous grid cells;
Step S106 judges whether to have traveled through a said M*N grid cell, if, execution in step S107 then; If not, then return step S102;
Step S107 is organized as the target raster data with said first target value and second target value, writes said target raster data.
Preferably, after said step S102, also comprise the steps:
Step S1021, if from a said M*N grid cell, extract 9-K grid cell continuously, then additional K eigenwert, K>0 wherein, K<9.
Preferably, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell.
Preferably, the 4 byte integers of said second target value for being merged into according to the value of extracting preceding 4 grid cells in the value of said 9 continuous grid cells.
The application embodiment also discloses the device that a kind of raster data writes, and comprising:
Original raster data acquisition module is used to obtain original raster data, and said original raster data is the raster data that all grid cell values all are distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, said M is row, and N is row;
The grid cell extraction module is used for extracting successively from a said M*N grid cell value of 9 continuous grid cells;
Grid cell numerical value judge module, whether the value that is used for judging respectively said 9 continuous grid cells is between 0 to 9; If, then call the first target value generation module, if not, then call the second target value generation module;
The first target value generation module is used to adopt first target value to replace the value of said 9 continuous grid cells; Said first target value is 4 byte integers according to the value generation of said 9 continuous grid cells;
The second target value generation module is used for adopting second target value to replace the value of said 4 continuous grid cells from the value of preceding 4 grid cells of value extraction of said 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of said 4 continuous grid cells;
The traversal judge module is used to judge whether to have traveled through a said M*N grid cell, if, invocation target raster data writing module then; If not, then return the grid cell extraction module;
Target raster data writing module is used for said first target value and second target value are organized as the target raster data, writes said target raster data.
Preferably, said device also comprises:
Complementary module is used for if extract 9-K grid cell continuously from a said M*N grid cell, then additional K eigenwert, K>0 wherein, K<9.
Preferably, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell.
Preferably, the 4 byte integers of said second target value for being merged into according to the value of extracting preceding 4 grid cells in the value of said 9 continuous grid cells.
The application embodiment also discloses the method that a kind of raster data reads, and comprising:
Step S201 reads the target raster data, comprises first target value and second target value in the said target raster data;
Wherein, said first target value is 4 byte integers according to the value generation of 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of 4 continuous grid cells;
Step S202 resolves the grid cell value in the said target raster data successively, and judgement is to be first target value or second target value; If first target value, execution in step S203 then, if second target value, then execution in step 204;
Step S203 is reduced into said first target value value of 9 continuous grid cells from 4 byte integers;
Step S204 is reduced into said second target value value of 4 continuous grid cells from 4 byte integers;
Step S205 judges whether to have traveled through said target raster data, if, execution in step S206 then; If not, then return step S202;
Step S206 organizes the value of said grid cell according to the order of sequence, obtains original raster data, and said original raster data comprises M*N grid cell for all grid cell values all are distributed in the raster data of the integer between 0 to 99, and each grid cell has the value of correspondence; Wherein, said M is row, and N is row.
Preferably, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell; Said step S203 comprises:
With 4 byte integers of the grid cell value in the said target raster data, deduct 10 integers, result of calculation is arranged as according to the order of sequence the value of 9 continuous grid cells.
Preferably, said second target value is that said step S204 comprises according to 4 byte integers of the value generation of said 4 continuous grid cells:
With 4 byte integers of the grid cell value in the said target raster data, be extracted as the value of 4 continuous grid cells according to the order of sequence.
Preferably, said step S202 comprises:
Resolve the grid cell value in the said target raster data successively, whether judge current grid cell value greater than 10 integers, if, then be judged to be order first target value, if not, then be judged to be second target value.
The application embodiment also discloses the device that a kind of raster data reads, and comprising:
Target raster data read module is used to read the target raster data, comprises first target value and second target value in the said target raster data;
Wherein, said first target value is 4 byte integers according to the value generation of 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of 4 continuous grid cells;
The target value judge module is used for resolving successively the grid cell value of said target raster data, and judgement is to be first target value or second target value; If first target value is then called the first target value recovery module, if second target value is then called the second target value recovery module;
The first target value recovery module is used for said first target value is reduced into from 4 byte integers the value of 9 continuous grid cells;
The second target value recovery module is used for said second target value is reduced into from 4 byte integers the value of 4 continuous grid cells;
The traversal judge module is used to judge whether to have traveled through said target raster data, if then call original raster data acquisition module; If not, then return judge module;
Original raster data acquisition module; Organize the value of said grid cell according to the order of sequence, obtain original raster data, said original raster data all is distributed in the raster data of the integer between 0 to 99 for all grid cell values; Comprise M*N grid cell, each grid cell has corresponding value; Wherein, said M is row, and N is row.
Preferably, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell; The said first target value recovery module comprises:
First calculating sub module is used for 4 byte integers with the grid cell value of said target raster data, deducts 10 integers;
Arrange submodule, be used for result of calculation is arranged as according to the order of sequence the value of 9 continuous grid cells.
Preferably, said second target value is that the said second target value recovery module comprises according to 4 byte integers of the value generation of said 4 continuous grid cells:
Extract submodule according to the order of sequence, be used for 4 byte integers, be extracted as the value of 4 continuous grid cells according to the order of sequence the grid cell value of said target raster data;
Preferably, said target value judge module comprises:
Judge submodule, be used for resolving successively the grid cell value of said target raster data, whether judge current grid cell value greater than 10 integers, if, then be judged to be first target value, if not, then be judged to be second target value.
Compared with prior art, the application comprises following advantage:
The application is distributed in the raster data of the integer between 0 to 99 to the value of all grid cells in the raster data; Original raster data is extracted 9 grid cells successively; If the value of the grid cell of getting is distributed between 0 to 9; Then the integers with one 4 byte substitutes, and can save storage space greatly.If the value of the grid cell of getting is not to be distributed between 0 to 9; Then substitute the value of preceding four grid cells of the grid cell of getting with the integers of one 4 byte; The grid cell data of so original usefulness 4 bytes store are still used 4 bytes store, do not waste additional storage space.
In preferred embodiment of the application, can use the integers of one 4 byte to substitute 9 continuous grid cells in the original grid cell, in this case; Originally needed the raster data of 9 bytes; Can store with 4 bytes, like this, when carrying out the raster data backup; Can store same information with less resources, make full use of storage space.
In addition, because the minimizing of storage space, the application can also reduce the data volume of file read-write, has also reduced the transmission volume of raster data simultaneously, improves the treatment effeciency of raster data.
Description of drawings
Fig. 1 is the process flow diagram of the method embodiment that writes of a kind of raster data of the application;
Fig. 2 is the application's raster data conversion synoptic diagram 1;
Fig. 3 is the application's raster data conversion synoptic diagram 2;
Fig. 4 is the application whole nation topography and geomorphology raster data synoptic diagram;
Fig. 5 is the process flow diagram of the method embodiment that reads of a kind of raster data of the application;
Fig. 6 is the structured flowchart of the device embodiment that writes of a kind of raster data of the application;
Fig. 7 is the structured flowchart of the device embodiment that reads of a kind of raster data of the application.
Embodiment
For above-mentioned purpose, the feature and advantage that make the application can be more obviously understandable, the application is done further detailed explanation below in conjunction with accompanying drawing and embodiment.
One of core idea of the application is; Raster data to one type of particular type; Promptly all grid cell values all are distributed in the raster data of the integer between 0 to 99, and original raster data is extracted 9 grid cells successively, if the value of the grid cell of getting is distributed between 0 to 9; Then the integers with one 4 byte substitutes, and can save storage space greatly.If the value of the grid cell of getting is not to be distributed between 0 to 9; Then substitute the value of preceding four grid cells of the grid cell of getting with the integers of one 4 byte; The grid cell data of so original usefulness 4 bytes store are still used 4 bytes store, do not waste additional storage space.
With reference to Fig. 1; Show the flow chart of steps of the method embodiment that a kind of raster data of the application writes; The application is to the raster data of one type of particular type; Promptly all grid cell values all are distributed in the raster data (such as describing 56 the national distribution situation raster datas in the whole nation) of the integer between 0 to 99, and present embodiment specifically can comprise the steps:
Step S101 obtains original raster data;
Wherein, said original raster data is the raster data that all grid cell values all are distributed in the integer between 0 to 99, comprises M*N grid cell; Said M is row, and N is row.
Step S102 extracts the value of 9 continuous grid cells successively from a said M*N grid cell;
In concrete the realization, can start anew to M*N grid cell of said original grid network data, get 9 grid cells successively continuously.
Step S103, whether the value of judging said 9 continuous grid cells respectively is between 0 to 9; If, execution in step S104 then, if not, execution in step S105 then;
Step S104 adopts first target value to replace the value of said 9 continuous grid cells;
Wherein, said first target value can be the 4 byte integers that generate according to the value of said 9 continuous grid cells.
In a kind of preferred embodiment of the application, said first target value can add 4 byte integers of the value gained of the above 9 continuous grid cell for adopting 10 integers.For example, said 10 integers can value be 1000000000, the computing formula of the then said first target value A can for:
A=1000000000+a1a2a3a4a5a6a7a8a9;
Wherein a1, a2, a3, a4, a5, a6, a7, a8, a9 are respectively the values of continuous 9 grid cells.
With reference to Fig. 2, when the value of 9 grid cells that extract continuously successively is 8,3,1,5,2,4,6,2,7, said first target value is for adopting 10 integers 1000000000 and 831524627 additions, and gained is 1831524627.In this case, originally need the data of 9 bytes of storage space, and only needed 4 bytes of memory spaces to get final product now, when carrying out the raster data backup, can make full use of storage resources, saved storage space greatly.
Step S105, the value of preceding 4 grid cells of extraction adopts second target value to replace the value of said 4 continuous grid cells from the value of said 9 continuous grid cells;
Wherein, said second target value is 4 byte integers according to the value generation of said 4 continuous grid cells.
In a kind of preferred embodiment of the application, said second target value can be the 4 byte integers that are merged into according to the value of extracting preceding 4 grid cells in the value of said 9 continuous grid cells.
Use present embodiment, if the value of these 9 grid cells and not all 0 in 9 can be got preceding 4 grid cells of these 9 grid cells earlier; Each grid cell is all write as double figures; The integers of forming one 4 byte is then in order reformulated new continuous 9 grid cells with 5 grid cells and 4 follow-up grid cells of remainder, together to these 9 new grid cells; According to said method handle again, up to handling M*N grid cell.
With reference to Fig. 3; When the value of 9 grid cells that extract continuously successively is 12,3,31,5,6,4,6,2,7; Since the value of these 9 grid cells and not all 0 in 9; Can get preceding 4 grid cells 12,3,31,5 of these 9 grid cells earlier, said second target value is that these 4 grid cells merge, and institute's total is a nybble integers 12033105.In this case, originally still used 4 bytes store, do not waste additional storage space with the grid cell data of 4 bytes store.
Step S106 judges whether to have traveled through a said M*N grid cell, if, execution in step S107 then; If not, then return step S102;
In concrete the realization,, then add to 9 grid cells with eigenwert if whole raster data is handled remaining to the end 9 grid cells of less than.Promptly in this case, the application embodiment can also may further comprise the steps:
If from a said M*N grid cell, extract 9-K grid cell continuously, then additional K eigenwert, K>0 wherein, K<9.
For example, said eigenwert can be got 0 value, when extracting 9 grid cells of less than 3,6,7,4,8, then can replenish 40 value grid cells, and 9 continuous grid cells that replenish gained at last are 3,6,7,4,8,0,0,0,0.
Step S107 is organized as the target raster data with said first target value and second target value, writes said target raster data.
According to said method; Through traveling through whole original raster data, original raster data is re-assemblied according to the order of sequence, adopt 4 byte integers (first target value) to replace to the value of 9 continuous grid cells of meet the requirements (the grid cell value is between 0 to 9); To undesirable 9 continuous grid cells; Extract the value of its preceding 4 continuous grid cells, adopt second target value to replace, and 5 continuous grid cells are put into the next round traversal thereafter; Thereby can obtain a brand-new raster data (target raster data), comprise 9 continuous grid cell values in the resulting target raster data by the replacement of 4 byte integers.
Use the application embodiment; Store again after original raster data assembled, can reduce storage space, especially in the original raster data; The value major part of grid cell is distributed between 0 to 9; And it is very concentrated to distribute, and other range values are proportion when very little, then can reduce storage significantly and taking up room.Such as the national distribution situation of nationwide population, represent Han nationality with numerical value 0,1 represents Zhuang; 2 represent the Manchu ..., in this case; The data of scope between 0 to 9 account for very high proportion, and are also very concentrated, this type data are used the application embodiment can effectively utilize storage space; Save the storage space of raster data, improve the treatment effeciency of raster data.
With reference to Fig. 4; National topography and geomorphology raster data with in the actual items is an example; Value with 0 to 9 in the grid cell is represented various mountain regions respectively, and the geomorphic type in Plain is represented other rare geomorphic types 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, if adopt common raster data method for organizing, the storage space that then needs is about 20.25Gb; If adopt the described method of the application to assemble storage, the storage space that then needs is about 10.7Gb, uses original approximately half the storage resources can store same grid cell information; So not only saved storage space; Reduce the data volume of file read-write, also reduced the transmission volume of raster data simultaneously, the performance and the user experience sense that have improved system greatly.
Need to prove; Because the integer data type maximum of 4 bytes can be represented 10 integers on 32 machines; The integers number formed by 43 figure places can't be represented,, but the integers that 42 figure places are formed can be represented because 12 figure places have surpassed the denotable scope of integer data type; So only to the raster data of one type of particular type, promptly all grid cell values all are distributed in the raster data of the integer between 0 to 99 to the application embodiment.
With reference to Fig. 5, show the flow chart of steps of the method embodiment that a kind of raster data of the application reads, present embodiment specifically can comprise the steps:
Step S201 reads the target raster data, comprises first target value and second target value in the said target raster data;
Wherein, said first target value is 4 byte integers according to the value generation of 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of 4 continuous grid cells;
Step S202 resolves the grid cell value in the said target raster data successively, and judgement is to be first target value or second target value; If first target value, if execution in step S203 then is second target value, then execution in step S204;
In a kind of preferred embodiment of the application, said step S202 can comprise:
Resolve the grid cell value in the said target raster data successively, whether judge current grid cell value greater than 10 integers, if, then be judged to be order first target value, if not, then be judged to be second target value.
Step S203 is reduced into said first target value value of 9 continuous grid cells from 4 byte integers;
In a kind of preferred embodiment of the application, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell; Said step S203 can comprise:
With 4 byte integers of the grid cell value in the said target raster data, deduct 10 integers, result of calculation is arranged as according to the order of sequence the value of 9 continuous grid cells.
For example; Said 10 integers can value be 1000000000, when first target value is 1026378109, first target value are deducted 1000000000; Result of calculation is 026378109, and then the value of 9 continuous grid cells of reduction is 0,2,6,3,7,8,1,0,9.
Step S204 is reduced into said second target value value of 4 continuous grid cells from 4 byte integers;
In a kind of preferred embodiment of the application, said second target value is that said step S203 comprises according to 4 byte integers of the value generation of said 4 continuous grid cells:
With 4 byte integers of the grid cell value in the said target raster data, be extracted as the value of 4 continuous grid cells according to the order of sequence.
For example, when the said second target value value is 3456, then the value of 4 continuous grid cells of reduction is 0,0,34,56.Again for example, when the said second target value value is 23453000, then the value of 4 continuous grid cells of reduction is 23,45,30,0.
Step S205 judges whether to have traveled through said target raster data, if, execution in step S206 then; If not, then return step S202;
Step S206 organizes the value of said grid cell according to the order of sequence, obtains original raster data, and said original raster data comprises M*N grid cell for all grid cell values all are distributed in the raster data of the integer between 0 to 99, and each grid cell has the value of correspondence; Wherein, said M is row, and N is row.
Need to prove; For method embodiment, for simple description, so it all is expressed as a series of combination of actions; But those skilled in the art should know; The application does not receive 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 the instructions all belongs to preferred embodiment, and related action and module might not be that the application is necessary.
With reference to Fig. 6, show the structured flowchart of the device embodiment that a kind of raster data of the application writes, present embodiment specifically can comprise like lower module:
Original raster data acquisition module S301 is used to obtain original raster data, and said original raster data is the raster data that all grid cell values all are distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, said M is row, and N is row;
Grid cell extraction module S302 is used for extracting successively from a said M*N grid cell value of 9 continuous grid cells;
Grid cell numerical value judge module S303, whether the value that is used for judging respectively said 9 continuous grid cells is between 0 to 9; If, then call the first target value generation module S304, if not, then call the second target value generation module S305;
The first target value generation module S304 is used to adopt first target value to replace the value of said 9 continuous grid cells; Said first target value is 4 byte integers according to the value generation of said 9 continuous grid cells;
In a kind of preferred embodiment of the application, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell.
The second target value generation module S305 is used for adopting second target value to replace the value of said 4 continuous grid cells from the value of preceding 4 grid cells of value extraction of said 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of said 4 continuous grid cells;
In a kind of preferred embodiment of the application, the 4 byte integers of said second target value for being merged into according to the value of extracting preceding 4 grid cells in the value of said 9 continuous grid cells.
Traversal judge module S306 is used to judge whether to have traveled through a said M*N grid cell, if, invocation target raster data writing module then; If not, then call the grid cell extraction module;
In a kind of preferred embodiment of the application, also comprise:
Complementary module is used for if extract 9-K grid cell continuously from a said M*N grid cell, then additional K eigenwert, K>0 wherein, K<9.
Target raster data writing module S307 is used for said first target value and second target value are organized as the target raster data, writes said target raster data.
For device embodiment shown in Figure 6, because it is similar basically with method embodiment shown in Figure 1, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
With reference to Fig. 7, show the structured flowchart of the device embodiment that a kind of raster data of the application reads, present embodiment specifically can comprise like lower module:
Target raster data read module S401 is used to read the target raster data, comprises first target value and second target value in the said target raster data;
Wherein, said first target value is 4 byte integers according to the value generation of 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of 4 continuous grid cells;
Target value judge module S402 is used for resolving successively the grid cell value of said target raster data, and judgement is to be first target value or second target value; If first target value is then called the first target value recovery module S403, if second target value is then called the second target value recovery module S404;
In a kind of preferred embodiment of the application, said target value judge module S402 comprises:
Judge submodule, be used for resolving successively the grid cell value of said target raster data, whether judge current grid cell value greater than 10 integers, if, then be judged to be order first target value, if not, then be judged to be second target value.
The first target value recovery module S403 is used for said first target value is reduced into from 4 byte integers the value of 9 continuous grid cells;
In a kind of preferred embodiment of the application, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell; The said first target value recovery module S403 comprises:
First calculating sub module is used for 4 byte integers with the grid cell value of said target raster data, deducts 10 integers;
Arrange submodule, be used for result of calculation is arranged as according to the order of sequence the value of 9 continuous grid cells.
The second target value recovery module S404 is used for said second target value is reduced into from 4 byte integers the value of 4 continuous grid cells;
In a kind of preferred embodiment of the application, said second target value is that the said second target value recovery module S404 comprises according to 4 byte integers of the value generation of said 4 continuous grid cells:
Extract submodule according to the order of sequence, be used for 4 byte integers, be extracted as the value of 4 continuous grid cells according to the order of sequence the grid cell value of said target raster data;
Traversal judge module S405 is used to judge whether to have traveled through said target raster data, if then call original raster data acquisition module S406; If not, then return judge module S402;
Original raster data acquisition module S406; Organize the value of said grid cell according to the order of sequence, obtain original raster data, said original raster data all is distributed in the raster data of the integer between 0 to 99 for all grid cell values; Comprise M*N grid cell, each grid cell has corresponding value; Wherein, said M is row, and N is row.
For device embodiment shown in Figure 7, because it is similar basically with method embodiment shown in Figure 5, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.
Those skilled in the art should understand that the application's embodiment can be provided as method, device or computer program.Therefore, the application can adopt the form of the embodiment of complete hardware embodiment, complete software implementation example or combination software and hardware aspect.And the application can be employed in the form that one or more computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) that wherein include computer usable program code go up the computer program of implementing.
The application is that reference is described according to the process flow diagram and/or the block scheme of method, equipment (system) and the computer program of the application embodiment.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or the block scheme and/or square frame and process flow diagram and/or the block scheme and/or the combination of square frame.Can provide these computer program instructions to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, make the instruction of carrying out through the processor of computing machine or other programmable data processing device produce to be used for the device of the function that is implemented in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame appointments.
These computer program instructions also can be stored in ability vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work; Make the instruction that is stored in this computer-readable memory produce the manufacture that comprises command device, this command device is implemented in the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame.
These computer program instructions also can be loaded on computing machine or other programmable data processing device; Make on computing machine or other programmable devices and to carry out the sequence of operations step producing computer implemented processing, thereby the instruction of on computing machine or other programmable devices, carrying out is provided for being implemented in the step of the function of appointment in flow process of process flow diagram or a plurality of flow process and/or square frame of block scheme or a plurality of square frame.
Although described the application's preferred embodiment, in a single day those skilled in the art get the basic inventive concept could of cicada, then can make other change and modification to these embodiment.So accompanying claims is intended to be interpreted as all changes and the modification that comprises preferred embodiment and fall into the application's scope.
At last; Also need to prove; In this article; Relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint relation or the order that has any this reality between these entities or the operation.And; Term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability; Thereby make and comprise that process, method, article or the equipment of a series of key elements not only comprise those key elements; But also comprise other key elements of clearly not listing, or also be included as this process, method, article or equipment intrinsic key element.Under the situation that do not having much more more restrictions, the key element that limits by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises said key element and also have other identical element.
More than method and device that a kind of raster data that the application provided is write; And a kind of raster data method and the device that read; Carried out detailed introduction; Used concrete example among this paper the application's principle and embodiment are set forth, the explanation of above embodiment just is used to help to understand the application's method and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to the application's thought, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as the restriction to the application.

Claims (16)

1. the method that raster data writes is characterized in that, comprising:
Step S101 obtains original raster data, and said original raster data is the raster data that all grid cell values all are distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, said M is row, and N is row;
Step S102 extracts the value of 9 continuous grid cells successively from a said M*N grid cell;
Step S103, whether the value of judging said 9 continuous grid cells respectively is between 0 to 9; If, execution in step S104 then, if not, execution in step S105 then;
Step S104 adopts first target value to replace the value of said 9 continuous grid cells; Said first target value is 4 byte integers according to the value generation of said 9 continuous grid cells;
Step S105, the value of preceding 4 grid cells of extraction adopts second target value to replace the value of said 4 continuous grid cells from the value of said 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of said 4 continuous grid cells;
Step S106 judges whether to have traveled through a said M*N grid cell, if then execution in step S 107; If not, then return step S102;
Step S107 is organized as the target raster data with said first target value and second target value, writes said target raster data.
2. method according to claim 1 is characterized in that, after said step S102, also comprises the steps:
Step S1021, if from a said M*N grid cell, extract 9-K grid cell continuously, then additional K eigenwert, K>0 wherein, K<9.
3. method according to claim 1 and 2 is characterized in that, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell.
4. method according to claim 3 is characterized in that, the 4 byte integers of said second target value for being merged into according to the value of extracting preceding 4 grid cells in the value of said 9 continuous grid cells.
5. the device that raster data writes is characterized in that, comprising:
Original raster data acquisition module is used to obtain original raster data, and said original raster data is the raster data that all grid cell values all are distributed in the integer between 0 to 99, comprises M*N grid cell; Wherein, said M is row, and N is row;
The grid cell extraction module is used for extracting successively from a said M*N grid cell value of 9 continuous grid cells;
Grid cell numerical value judge module, whether the value that is used for judging respectively said 9 continuous grid cells is between 0 to 9; If, then call the first target value generation module, if not, then call the second target value generation module;
The first target value generation module is used to adopt first target value to replace the value of said 9 continuous grid cells; Said first target value is 4 byte integers according to the value generation of said 9 continuous grid cells;
The second target value generation module is used for adopting second target value to replace the value of said 4 continuous grid cells from the value of preceding 4 grid cells of value extraction of said 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of said 4 continuous grid cells;
The traversal judge module is used to judge whether to have traveled through a said M*N grid cell, if, invocation target raster data writing module then; If not, then return the grid cell extraction module;
Target raster data writing module is used for said first target value and second target value are organized as the target raster data, writes said target raster data.
6. device according to claim 5 is characterized in that, also comprises:
Complementary module is used for if extract 9-K grid cell continuously from a said M*N grid cell, then additional K eigenwert, K>0 wherein, K<9.
7. according to claim 5 or 6 described devices, it is characterized in that said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell.
8. device according to claim 7 is characterized in that, the 4 byte integers of said second target value for being merged into according to the value of extracting preceding 4 grid cells in the value of said 9 continuous grid cells.
9. the method that raster data reads is characterized in that, comprising:
Step S201 reads the target raster data, comprises first target value and second target value in the said target raster data;
Wherein, said first target value is 4 byte integers according to the value generation of 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of 4 continuous grid cells;
Step S202 resolves the grid cell value in the said target raster data successively, and judgement is to be first target value or second target value; If first target value, execution in step S203 then, if second target value, then execution in step 204;
Step S203 is reduced into said first target value value of 9 continuous grid cells from 4 byte integers;
Step S204 is reduced into said second target value value of 4 continuous grid cells from 4 byte integers;
Step S205 judges whether to have traveled through said target raster data, if, execution in step S206 then; If not, then return step S202;
Step S206 organizes the value of said grid cell according to the order of sequence, obtains original raster data, and said original raster data comprises M*N grid cell for all grid cell values all are distributed in the raster data of the integer between 0 to 99, and each grid cell has the value of correspondence; Wherein, said M is row, and N is row.
10. method according to claim 9 is characterized in that, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell; Said step S203 comprises:
With 4 byte integers of the grid cell value in the said target raster data, deduct 10 integers, result of calculation is arranged as according to the order of sequence the value of 9 continuous grid cells.
11., it is characterized in that said second target value is that said step S204 comprises according to 4 byte integers of the value generation of said 4 continuous grid cells according to claim 9 or 10 described methods:
With 4 byte integers of the grid cell value in the said target raster data, be extracted as the value of 4 continuous grid cells according to the order of sequence.
12. method according to claim 11 is characterized in that, said step S202 comprises:
Resolve the grid cell value in the said target raster data successively, whether judge current grid cell value greater than 10 integers, if, then be judged to be order first target value, if not, then be judged to be second target value.
13. the device that raster data reads is characterized in that, comprising:
Target raster data read module is used to read the target raster data, comprises first target value and second target value in the said target raster data;
Wherein, said first target value is 4 byte integers according to the value generation of 9 continuous grid cells; Said second target value is 4 byte integers according to the value generation of 4 continuous grid cells;
The target value judge module is used for resolving successively the grid cell value of said target raster data, and judgement is to be first target value or second target value; If first target value is then called the first target value recovery module, if second target value is then called the second target value recovery module;
The first target value recovery module is used for said first target value is reduced into from 4 byte integers the value of 9 continuous grid cells;
The second target value recovery module is used for said second target value is reduced into from 4 byte integers the value of 4 continuous grid cells;
The traversal judge module is used to judge whether to have traveled through said target raster data, if then call original raster data acquisition module; If not, then return judge module;
Original raster data acquisition module; Organize the value of said grid cell according to the order of sequence, obtain original raster data, said original raster data all is distributed in the raster data of the integer between 0 to 99 for all grid cell values; Comprise M*N grid cell, each grid cell has corresponding value; Wherein, said M is row, and N is row.
14. device according to claim 13 is characterized in that, said first target value is the 4 byte integers that 10 integers add the value gained of the above 9 continuous grid cell; The said first target value recovery module comprises:
First calculating sub module is used for 4 byte integers with the grid cell value of said target raster data, deducts 10 integers;
Arrange submodule, be used for result of calculation is arranged as according to the order of sequence the value of 9 continuous grid cells.
15., it is characterized in that said second target value is that the said second target value recovery module comprises according to 4 byte integers of the value generation of said 4 continuous grid cells according to claim 13 or 14 described devices:
Extract submodule according to the order of sequence, be used for 4 byte integers, be extracted as the value of 4 continuous grid cells according to the order of sequence the grid cell value of said target raster data.
16. device according to claim 15 is characterized in that, said target value judge module comprises:
Judge submodule, be used for resolving successively the grid cell value of said target raster data, whether judge current grid cell value greater than 10 integers, if, then be judged to be first target value, if not, then be judged to be 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 true CN102841933A (en) 2012-12-26
CN102841933B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112527929A (en) * 2020-10-20 2021-03-19 深圳市银星智能科技股份有限公司 Grid map coding method and device and electronic equipment

Citations (3)

* 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
US20010036308A1 (en) * 2000-04-28 2001-11-01 Osamu Katayama Image data compressing method and apparatus which compress image data separately by modifying color
CN102508853A (en) * 2011-09-28 2012-06-20 北京地拓科技发展有限公司 Method and system for filling raster data

Patent Citations (3)

* 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
US20010036308A1 (en) * 2000-04-28 2001-11-01 Osamu Katayama Image data compressing method and apparatus which compress image data separately by modifying color
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维形成的栅格数据快速动态压缩算法》", 《测绘科学技术学报》, 15 June 2007 (2007-06-15) *
马丽 等: "《浅谈栅格数据结构及其压缩编码方法》", 《郑州工业高等专科学校学报》, 30 September 2004 (2004-09-30) *

Cited By (2)

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

Also Published As

Publication number Publication date
CN102841933B (en) 2015-01-14

Similar Documents

Publication Publication Date Title
CN107688999B (en) Block chain-based parallel transaction execution method
CN110471795A (en) Block chain state data reconstruction method and device, electronic equipment
CN104077446B (en) The method and system of two-dimentional electrical construction document are extracted from digital three-dimemsional model
CN100595758C (en) Storing method and system of playing map and obtaining method and system of playing map
CN102662639A (en) Mapreduce-based multi-GPU (Graphic Processing Unit) cooperative computing method
CN104216961A (en) Method and device for data processing
CN102880709A (en) Data warehouse management system and data warehouse management method
CN105264488B (en) For using array to merging the method and system of ordered list
CN101840430A (en) Intelligent card database multi-list operation method and device
CN102591787B (en) The data processing method of JAVA card and device
CN103294799B (en) A kind of data parallel batch imports the method and system of read-only inquiry system
CN102521312A (en) Storage method of file index, and file system
CN102982147B (en) A kind of method and apparatus improving data message integration efficiency
CN106844288A (en) A kind of random string generation method and device
CN102867023B (en) Method for storing and reading grid data and device
CN114444274A (en) Method, medium and device for reconstructing original structure grid from non-structure grid
CN101079897B (en) A concurrent storage system construction method for convenient expansion of storage node quantity
CN110362298B (en) Browser-based target object drawing method and device and browser
CN109684517A (en) A kind of historical data storage method, reading/writing method, storage device and equipment
CN103106313A (en) Method for sequentially reconstructing rolled pieces
CN101770367A (en) Compressing method and compressing device of .NET file
CN102841933A (en) Method and device for writing raster data and method for reading raster data
CN102446164A (en) Analytic method, device and operation system of report formula
CN113741411B (en) Generation method and system of global variable point product file of distributed control system
CN112860412B (en) Service data processing method and device, electronic equipment and storage medium

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