Content of the invention
The present invention provides a kind of access method comprising topically effective raster data and device in GIS application, the mesh of solution
Mark problem be from raster data, distribution is had randomness, quantity has the invalid grid pixel collection of randomness and locally has
Effect grid pixel collection differentiation is processed, and can greatly reduce the amount of storage of raster data, saves memory space;By the grid after processing
Data is transmitted, and can greatly reduce the transmission quantity of grid number, improves network raster data efficiency of transmission.
For solving above-mentioned technical problem, the invention provides a kind of access method comprising topically effective raster data,
Effective grid pixel and invalid grid pixel is comprised, the value of invalid grid pixel produces for data in raster data
The designated value of business;
Effective grid pixel in raster data and invalid grid pixel are marked, generate labelling raster data;Right
Labelling raster data is compressed, and obtains compact token raster data;
The pixel value of the effective grid pixel in raster data is individually stored in certain sequence, is abandoned invalid grid
The process of pixel portion data, obtains the pixel value serial data of effective grid pixel;
The essential information of record raster data, essential information includes pixel wide, pixels tall, the taking of invalid grid pixel
Value and pixel data type;
When application system needs raster data is stored, by described compact token raster data, effective grid picture
The pixel value serial data of element, the essential information of raster data, as storage object, write file and are stored;
When application system need to read the raster data of storage, first read the essential information of the raster data in file, and
According to the essential information of raster data, distribute the two-dimensional matrix memory space correspondingly sized with described raster data, further according to pressure
The pixel value serial data of contracting labelling raster data and effective grid pixel is processed to two-dimensional matrix, obtains the grid number restoring
According to.
Process to raster data, is all based on all pixels in raster data at present, then to these pixel datas,
How research is compressed, coding etc., obtains minimum amount of storage and transmission quantity;This law is bright be first distinguish from raster data useful
Information, abandon useless information, so just largely can reduce data volume, certainly can continue to connect after application this method
The process carrying out data compression aspect.
On the basis of a kind of above-mentioned access method technical scheme comprising topically effective raster data, the present invention is acceptable
Do following improvement.
Further, described effective grid pixel in raster data and invalid grid pixel are marked, generate labelling
Raster data;Labelling raster data is compressed, the step obtaining compact token raster data includes:
Whether the value judging each pixel in described raster data successively is the value of invalid grid pixel;
If it is, this grid pixel is invalid grid pixel, use 0 labelling;
If it is not, then this grid pixel is effective grid pixel, use 1 labelling;
Record the labelling of all pixels in described raster data in certain sequence, form labelling raster data;
Described labelling raster data is accounted for 1bi t memory space according to every pixel redistributed;
Labelling raster data after described redistributing is started continuous 32 according to from the initial number of labelling raster data
For one group, and the every group 32 i.e. flag data of 4 bytes is taken the mode that its decimal integer value is stored to compress, obtain
Compact token raster data.
The beneficial effect of technique scheme is:The label information processing method that the present invention adopts, it is possible to achieve no matter no
The distribution of effect grid pixel how, and quantity how, the duplicate target of compression efficiency, can meet the grid in actual production
Data often has a case that the no data value of a large amount of dispersibility.
Further, the described essential information according to raster data, distributes the Two-Dimensional Moment correspondingly sized with described raster data
Battle array memory space, further according to compact token raster data and effective grid pixel pixel value serial data to two-dimensional matrix at
Reason, the step obtaining the raster data of recovery includes:
According to the essential information of described raster data, distribute the two-dimensional matrix storage correspondingly sized with described raster data empty
Between;Each grid initializing this two-dimensional matrix is " untreated state ";
Decompress described compact token raster data, described labelling raster data is given described two-dimensional matrix, described
Invalid grid pixel and the position of topically effective grid pixel is marked in two-dimensional matrix;
The relevant position of the invalid grid pixel of described two-dimensional matrix is inserted the value of invalid grid pixel, and by grid
State is set to " processed state ";
Again the pixel value serial data of described effective grid pixel is inserted in certain sequence " untreated in described two-dimensional matrix
The grid of state ", obtains the raster data restoring in receiving terminal.
The invention also discloses a kind of access device comprising topically effective raster data, including:
Raster data module, for storing original raster data, comprises to comprise in raster data in described raster data
Effectively grid pixel and invalid grid pixel, the value of invalid grid pixel is the designated value of data manufacturer;
The mark module of the topically effective set of pixels of raster data, for by the effective grid pixel in described raster data and
Invalid grid pixel is marked, and generates labelling raster data;Described labelling raster data is compressed, obtains compact token
Raster data;
The actual pixel value module of topically effective set of pixels, for by the picture of the effective grid pixel in described raster data
Plain value is individually stored in certain sequence, abandons the process of invalid grid pixel partial data, obtains effective grid pixel
Pixel value serial data;
The basic information module of raster data, for recording the essential information of described raster data, essential information includes picture
Plain width, pixels tall, the value of invalid grid pixel and pixel data type;
Memory module, for when application system needs raster data is stored, by described compact token grid number
According to, the essential information of the pixel value serial data of effective grid pixel, raster data as storage object, write file and deposited
Storage;
Read module, for when application system needs the raster data reading storage, first reading the grid number in file
According to essential information, and the essential information according to raster data, distribute the two-dimensional matrix correspondingly sized with described raster data and deposit
Storage space, the pixel value serial data further according to compact token raster data and effective grid pixel is processed to two-dimensional matrix,
Obtain the raster data restoring.
On the basis of a kind of above-mentioned access device comprising topically effective raster data, the present invention can also do following changing
Enter.
Further, the mark module of the topically effective set of pixels of described raster data includes:
Topically effective pixel judges judge module, for judge each pixel in described raster data successively value whether
Value for invalid grid pixel;If it is, calling invalid grid pixel judge mark module, if it is not, then calling office
Portion's effective grid pixel judge mark module;
Invalid grid pixel mark module, the value for determining described raster data pixel is taking of invalid grid pixel
Value, and by described grid 0 labelling;
Topically effective grid pixel mark module, the value for determining described raster data pixel is effective grid picture
Element, and by described grid 1 labelling;
Labelling raster data generation module, for recording the labelling of all pixels in described raster data in certain sequence,
Form labelling raster data;
Labelling raster data compression module, enters for described labelling raster data is accounted for 1bit memory space according to every pixel
Row is redistributed;It is one group according to starting continuous 32 from the initial number of described labelling raster data, and every group 32 are 4
The flag data of byte takes the mode that its decimal integer value is stored to compress, and obtains compact token raster data.
Further, described read module includes:
Memory allocation module, for the pixel wide in the essential information according to described raster data, pixels tall,
The value of invalid grid pixel and pixel data type, distribute the two-dimensional matrix storage correspondingly sized with described raster data empty
Between, each grid initializing described two-dimensional matrix is " untreated state ";
Decompression compact token raster data module, for decompressing described compact token raster data, by labelling raster data
Give described two-dimensional matrix, described two-dimensional matrix marks the position of invalid grid pixel and topically effective grid pixel;
Invalid grid pixel fills module, for inserting no the relevant position of the invalid grid pixel of described two-dimensional matrix
The value of effect grid pixel, and grid state is set to " processed state ";
Topically effective grid pixel fills module, necessarily suitable for pressing the pixel value serial data of described effective grid pixel
Sequence inserts the grid of " untreated state " in two-dimensional matrix, obtains the raster data restoring in receiving terminal.
The invention also discloses a kind of transmission method comprising topically effective raster data,
Server is carried out to raster data using a kind of access method comprising topically effective raster data of the present invention
Process, the essential information of the compact token obtaining raster data, the pixel value serial data of effective grid pixel, raster data is made
For connection object, it is transmitted, send client to, the pixel to compact token raster data, effective grid pixel for the client
Value Data string, the essential information of raster data are stored accordingly and are read.
The present invention is labeled as cost by additional records effective grid pixel collection, exchanges for grid topically effective in raster data
Lattice set of pixels is storage or connection object, thus saving substantial amounts of memory space or transmission volume;The present invention is not involved with
Excessively complicated calculating is processed, and therefore can ensure that the efficiency of real time data processing in actual items application;This method is base
In one of aspect of the structure organization of raster data, have no effect on the last handling process to data, for example, by institute of the present invention
State method, after obtaining effective grid pixel collection label information and the actual pixel value serial data of topically effective grid pixel collection, all
The last handling processes such as data compression, coding can be carried out again, reduce data storage and transmission quantity further.
Specific embodiment
Below in conjunction with accompanying drawing, the principle of the present invention and feature are described, example is served only for explaining the present invention, and
Non- for limiting the scope of the present invention.
Inventor, according to the experience in actual items, finds the raster data of transmission in application system, usually contains portion
Point engineering noise pixel data, " invalid " pixel data here, refer to not know the definite pixel of these pixels in actual applications
Value, these inactive pixels are mainly derived from following several situation:
A, in data production process, remote sensing satellite may be subject to cloud layer and atmospheric dust etc. impact, lead to part grid
Pixel does not get numerical value, and general data manufacturer is marked as no data value.The no data value pixel distribution of this part
There is randomness, quantity also has randomness.
B, in actual application, partial pixel value need to be labeled as no data value by data manufacturer.For example, on the make
During state's vegetation coverage raster data, to waters such as the rivers and lakes in Chinese scope, due to there is no the implication of vegetation, need by
These pixel values are labeled as no data value.The no data value pixel of this part is different with applicable cases, and it is distributed and quantity variance
Larger, there is certain randomness.
Grid pixel outside c, specific region is labeled as no data value by data manufacturer.As issued Chinese soil classification grid
During lattice data, to the pixel outside national boundaries Chinese in grid rectangular area, generally individually it is labeled as no data value.This kind of no data value
General distribution is concentrated and quantity is more.
In actual applications, the invalid grid pixel collection of raster data can be by situation a, and b, c's is any one or more common
With generation.Comprise in these raster datas to be distributed have randomness, quantity there is invalid grid pixel collection and the office of randomness
(for operable grid, all pixels outside invalid grid pixel collection are topically effective grid to portion's effective grid pixel collection
Lattice pixel).
The know-why of the present invention is to the topically effective grid pixel collection in raster data, and point three parts are entered row information and deposited
Storage:One is the label information of topically effective set of pixels, is valid pixel to distinguish which pixel in rectangular area, which is invalid
Pixel;Two is the actual pixels value information of the topically effective set of pixels by particular order arrangement;Three is the basic letter of raster data
Breath.This three partial information is transmitted respectively, carries out dissection process by corresponding method during reception, retrieve rectangular area
Raster data.
The topically effective set of pixels label information processing method adopting in the present invention, it is possible to achieve no matter invalid grid pixel
Distribution how, quantity is how, the duplicate target of compression efficiency, and the raster data that can meet in actual production often has
There is the situation of the no data value of a large amount of dispersibility.
Fig. 1 is a kind of flow chart of the access method embodiment comprising topically effective raster data, with reference to diagram 1, this
A kind of bright access method embodiment comprising topically effective raster data, specifically includes:
Step one, comprises effective grid pixel and invalid grid pixel in raster data, the value of invalid grid pixel is
The designated value of data manufacturer;Effective grid pixel in raster data and invalid grid pixel are marked, generate labelling
Raster data;Labelling raster data is compressed, obtains compact token raster data;
Understand the application for convenience of technical staff, now explained for embodiment with Chinese soil classification raster data processing
State.Fig. 2 is pixel value schematic diagram in the raster data rectangular area of Chinese soil classification embodiment, as shown in Fig. 2 representing China
It is known that raster data is R in the raster data of land classification, the rectangular area A of this raster data is to be W pixel by width,
It is highly H pixel composition, total pixel N=W*H, the data storage of each grid pixel needs m byte, needs altogether to store
Space is Q=N*m byte.In N number of pixel of this raster data, include invalid grid pixel.Wherein, whether judge certain pixel
It is to be distinguished with the value of this pixel for invalid grid pixel.In actual raster data, be according to the pixel data of grid
Type accordingly to specify a certain numerical value to represent " invalid grid pixel ".For example, represent in the raster data of Chinese soil classification, I
State has 46 kinds of land types, so store the land classification number of each pixel, classification number with the byte data type of 1 byte
From the beginning of 1, get 46;Represent that this pixel is invalid grid pixel with numerical value 0;The rectangular area pixel number of this raster data is such as
Shown in Fig. 2.As can be seen from Figure 2, pixel value is that 0 grid pixel is invalid grid pixel, they or lose interest in area for application
Domain, or be " no data value " pixel.Wherein, in the raster data rectangular area of this Chinese soil classification, application is concerned about in other words
The pixel region needing actual transmissions such as illustrates Fig. 3, and Fig. 3 needs for the raster data rectangular area of Chinese soil classification embodiment
The pixel region schematic diagram of actual transmissions;
As shown in figure 3, in figure 3, the pixel value of the subregion beyond national boundaries in rectangular area is 0 in Fig. 2, belongs to
Invalid grid pixel;And in Fig. 3 state boundary, also having the value of fraction grid pixel to be 0 pixel value in fig. 2, this partial pixel is
There is " no data value " pixel, certainly fall within invalid grid pixel.So, in fig. 2, according to grid pixel value, we are just
Can determine which is effective grid pixel, which is invalid grid pixel.
It should be noted that different raster datas, according to the data type of pixel value, determine the number of invalid grid pixel
Value, value have no mandatory provision (this typically all by raster data manufacture department determination, sell data when have phase
The explanation answered).In the case of being normally applied, the integer more than 0 being 1 byte for pixel data type, can use 0 or 255 to make
For invalid grid pixel value;The integer more than 0 being 4 bytes for pixel data type, can use 0 or 9999999.9999 (one
Plurality, remaining effective grid pixel value all can not possibly have this value, and can distinguish is not normal grid pixel) be used as
Invalid grid pixel value;
Summary, the known conditions of the present invention is namely based on the raster data in given Fig. 2, its rectangular area Zhong Bao
Containing invalid grid pixel, and the value of invalid grid pixel has determined.For convenience of describing, in Chinese soil classification embodiment
In all assume that invalid grid pixel value be 0.Topically effective grid pixel collection is the grid that all pixels value in Fig. 2 is not 0
Collection of pixels, we change the mode all transmitted Fig. 2 grid pixel data at present, only to this topically effective grid pixel collection
Stored or transmitted.
Described in step one, the effective grid pixel in raster data and invalid grid pixel are marked, generate labelling grid
Lattice data;Labelling raster data is compressed, obtains compact token raster data, the realization of embodiment of classifying in Chinese soil
In, specifically include:
To in the raster data rectangular area in given Fig. 2, to topically effective grid pixel, value is disposed as 1;Right
Invalid grid pixel, value is disposed as 0.So, obtained a new raster data R2.Now R2 raster data pixel width
W, high H are all with known raster data R. raster data R2 as shown in figure 4, Fig. 4 is topically effective for Chinese soil classification embodiment
Grid pixel collection labelling raster data schematic diagram.(note:Raster data R2 now is intermediate calculation results, is not need
Write file is stored!)
To raster data R2, account for 1bit memory space by every pixel and carry out redistributing pixel size and calculated for pixel values.
To the raster data R2 in Fig. 4, it has H row, W row pixel.Assume that the raster data after distribution is R3, its number of lines of pixels is still H
OK, but columns is the positive integer not less than W/32, be designated as C. raster data be R3 pixel data type be 4 bytes integer.
Any row r (1 to raster data R3<=r<=H, line number starts to count from 1), the value of its first pixel is x, x
Binary form be shown with 32bit position, from left to right, the 1st be Fig. 3 in r row the 1st train value (0 or 1), the 2nd be scheme
2nd train value (0 or 1) of r row ..., by that analogy in 3, the 32nd the 32nd train value (0 or 1) being r row in Fig. 3, this
Sample, the binary representation of x determines that, and such as 11100000111100111100000111100111, then x value is ten
The 3774071271 of system;To second pixel y, the binary form of y is shown with 32bit position, and from left to right, the 1st is in Fig. 3
33rd train value (0 or 1) of r row, the 2nd the 34th train value (0 or 1) ..., by that analogy being r row in Fig. 3, the 32nd
It is the 64th train value (0 or 1) of r row in Fig. 3, so, the numerical value of y just can determine that (with decimal representation);In the same manner, right
Jth (1<=j<=C) individual pixel value z, the binary form of z is shown with 32bi t position, from left to right, is taken respectively from r row in Fig. 3
(j-1) * 32+1 train value ..., jth * 32 train value.If pixel wide W of Fig. 3<C*32, then need to last string pixel
The right side binary digit of value takes 0 to supply.
Process as stated above and obtain topically effective grid pixel collection labelling raster data R 3, as shown in Figure 4:
Here, raster data R 3 width is C pixel, and highly for H pixel, every pixel data storage class is that 4 bytes are whole
Number, needs C*H*4 bytes of storage space altogether.This raster data R 3 is written in file or other media in stored or
Pending network transmission in internal memory.
Step 2, the pixel value of the effective grid pixel in raster data is individually stored in certain sequence, abandons
The process of invalid grid pixel partial data, obtains the pixel value serial data of effective grid pixel;
Processing it is already possible to determine the effective grid pixel in raster data R and invalid grid pixel through step one
, then, at this time only need to individually effective raster data is stored or transmitted with just permissible, the invalid grid pixel of discarding
The process of partial data, in the realization that Chinese soil classifies embodiment, specific as follows:
To pixel in the rectangular area of raster data R in Fig. 2, from top to bottom, from left to right, individual element is judged,
If its pixel value is invalid grid pixel value (above it is stated that the invalid grid pixel value of each raster data is all
Know numerical value, can be 0 or other specific numerical value), then ignore this pixel value;If valid pixel value, then should
Pixel value is recorded in order.It is, arranging to all effective grid pixel in order, obtain a string numerical value.Right
Raster data in Fig. 2, its topically effective grid pixel collection obtains series of values as shown in Figure 6, Fig. 6 after processing in order
Actual pixel value serial data for the topically effective grid pixel collection of Chinese soil classification embodiment;Each numerical value that Fig. 6 illustrates
Data type identical with known raster data R holding, each numerical value needs m bytes of storage space.By this specific order of number
According to string write stored medium file or internal memory, for storage or network transmission.
Step 3, the essential information of record raster data, essential information includes pixel wide W, pixels tall H, invalid grid
Value v of lattice pixel and pixel data type.
Step 4, when application system stores to raster data, by described compact token raster data, effective grid
The pixel value serial data of pixel, the essential information of raster data, as storage object, write file and are stored;
In the realization that Chinese soil classifies embodiment, specifically include:
When needing known raster data R is stored, by the effective grid pixel collection obtaining in above-mentioned steps one
Labelling raster data R 3 writes file R_Tag.fi le;Meanwhile, by the actual pixels of the effective grid pixel collection in step 2
Value Data string writes file R_data.fi le, and the essential information of the raster data in step 3 is stored in file R_
info.fi le.
Step 5, when application system reads the raster data of storage, first reads the basic letter of the raster data in file
Breath, and the essential information according to raster data, distribute the two-dimensional matrix memory space correspondingly sized with described raster data, then root
Pixel value serial data according to compact token raster data and effective grid pixel is processed to two-dimensional matrix, obtains the grid restoring
Lattice data.
In the realization that Chinese soil classifies embodiment, specifically include:
Application system first reads the essential information file R_info.fi le of raster data, obtains the rectangle region of raster data
Domain pixel wide W, height H and pixel data type and invalid grid pixel value v, thus clearly distribute corresponding two in internal memory
Dimension matrix D [W] [H] (corresponding two-dimensional grid), each grid initializing this matrix is " untreated " state;Read file R_ again
Tag.fi le, by the inverse process in step 2, will parse labelling raster data R 3, to invalid grid corresponding in two-dimensional matrix D
The grid of lattice pixel is assigned to value v, and this grid state is set to " processed " state;Read file R_data.fi le again,
It is sequentially read out serial data a1, a2 ..., an, to two-dimensional matrix D from left to right, from top to bottom, being assigned to the 1st state respectively is
The grid of " untreated ", the 2nd state is the grid of " untreated " ..., n-th state is the grid of " untreated ". so far,
H row W row grid in this two-dimensional matrix D all obtains assignment, that is, correspond to rectangular grid data R.
When needing to carry out network transmission to known raster data R, by the effective grid picture obtaining in above-mentioned steps one
Element collection labelling raster data R 3 write internal memory;Meanwhile, by the actual pixel value number of the effective grid pixel collection obtaining in step 2
According to string write internal memory, carry out network data transmission respectively, in addition, it is necessary to the essential information of this raster data, including pixel wide,
Pixels tall, invalid grid pixel value and pixel data type, by the essential information of the raster data obtaining in step 3 simultaneously
Carry out network transmission.In network reciever, the method same with the storage of above-mentioned file, reading carries out dissection process, just can get
Raster data in similar Fig. 1.
Performance evaluation to raster data processing method of the present invention application in Chinese soil classifies embodiment is as follows:
The present invention is labeled as cost by additional records effective grid pixel collection, exchanges for office in raster data rectangular area
Portion's effective grid pixel collection is storage or connection object, thus saving substantial amounts of memory space or transmission volume.Shown in Fig. 2
Raster data rectangular area in, actual items application in be only concerned Fig. 3 signal state boundary within (containing) effective grid picture
Element is that is to say, that the invalid raster data outside state boundary almost accounts for the half of rectangular area pixel.Assume the grid in Fig. 2
Data volume is Q byte.When using the present method, the actual pixel value serial data of topically effective grid pixel collection is only commonsense method
Required half data volume, as Q/2 byte;And increase record topically effective grid pixel collection labelling raster data amount S,
When the every pixel of the grid in Fig. 2 is 1 byte, S=Q/8;When the every pixel of the grid in Fig. 2 is 2 byte, S=Q/16;Work as figure
When the every pixel of grid in 2 is 4 byte, S=Q/32;Due to increasing the raster data essential information amount very little of storage, take not
To the memory space of 1Kb, it is negligible;In the case of least favorable (S=Q/8), altogether need 5Q/8 byte, save
37.5% data volume;Under vantage (S=Q/32), altogether need 17Q/32 byte, save 46.8% data volume;Can
See, this method can save substantial amounts of storage and transmission quantity, invalid grid pixel is more, and efficiency is more obvious.
Raster data processing method of the present invention is not involved with excessively complicated calculating and processes, therefore in actual items
The efficiency of real time data processing is can ensure that in application.
Raster data processing method described in this method is one of aspect of the structure organization based on raster data, not
The last handling process to data for the impact.For example, by the method for the invention, obtain effectively in Chinese soil classification embodiment
After the actual pixel value serial data of grid pixel collection label information and topically effective grid pixel collection, all can carry out data pressure again
The last handling processes such as contracting, coding, reduce data storage and transmission quantity further.
Label information processing method employed in the present invention, no matter being the distribution pursuing invalid grid pixel, number
Amount how, the duplicate target of compression efficiency, therefore, to be stored using 1 using to the labelling of every pixel, continuous 32 pictures
Element needs a 32 i.e. integer of 4 bytes to record.So so that it may meet random distribution and the quantity of invalid grid pixel
Problem.Therefore, it is possible to the raster data meeting in actual production often has a case that the no data value of a large amount of dispersibility.
It is best understood from raster data processing method described herein for convenience of technical staff, another enforcement is provided below
Example.
DEM(Digi tal Elevation Model:Digital elevation model) raster data is most basic fundamental geological
Data, in actual items, needs the DEM raster data in the range of storage and transmission regional, the resolution of this raster data
Rate requires as 1 kilometer. by mapping part producing and wide 4841 pixels of DEM raster data issued, high 4032 pixels constitute
Rectangular area, the data type of each grid pixel is the floating type numerical value of 4 bytes.When this DEM raster data is issued, at this
In rectangular area and the extraneous grid pixel of state boundary, all it is entered as -999999.9999, it is meant that this partial pixel
Belong to invalid grid pixel (because the actual earth's surface elevation in the whole world does not have -999999.9999 meters of this situations, to can use
This value is belonging to inactive pixels representing this pixel.But unavailable 0 comes as invalid grid pixel value, because actual earth's surface elevation
Be have 0 meter it is impossible to distinguishing this pixel is 0 meter of elevation or inactive pixels).
In the project, if being carried out with the Tif raster data file format applying wide Arcgis software in GIS industry
Storage, then the memory space needing is Q=4841*4032*4 byte, about 74M data volume.Supplementary notes:Tif raster data literary composition
Part form is the Typical Representative not differentiating between effective grid pixel and invalid grid pixel, to all pixels value, using unified side
Formula is stored, and this is also the method that all kinds of raster data storages adopt at present.
By the method for the invention, obtain topically effective grid pixel collection labelling raster data DEM_R2 in step 2, should
A width of 4841 pixels of raster data, a height of 4032 pixels, wherein, grid pixel value is 1 effective grid pixel totally 9173889
Individual, account for the 47%. of total rectangular area pixel and then according to redistributing pixel size and calculated for pixel values in step 2, obtain
Topically effective grid pixel collection labelling raster data DEM_R3 (similar with Fig. 4), a width of 152 pixels of this raster data, a height of
4032 pixels, every pixel is stored with the integer of 4 bytes, and so, being additionally required the effective grid pixel collection label information of storage needs altogether
Want E=152*4032*4 byte, about 2.4M data volume;According to step 3, obtain the topically effective grid of this DEM raster data
The actual pixel value string (serial data is similar with Fig. 5) of set of pixels, has 9173889 numerical value, and each numerical value is 4 bytes
Float type, then need F=9173889*4 byte, about 35M data volume altogether;In addition in addition it is also necessary to store the basic of DEM raster data
Information, including the pixel wide value of this DEM raster data, pixels tall value, invalid grid pixel value and every pixel data type
For float type.It is less than 1Kb, negligible calculation because these essential informations take memory space;Then, this method stores this DEM
Raster data needs E+F=37.4M altogether, compares Tif raster data file format and saves nearly half data volume.
When network transmission is carried out to this DEM raster data, identical with storage method principle above and process, except for the difference that
Write internal memory, rather than write file.
In actual items, application this method result proves, the amount of storage of raster data and transmission volume obtain greatly
Reduction, significant contribution is made to the performance of system.
Fig. 7 is a kind of structured flowchart of the access device embodiment comprising topically effective raster data, as shown in fig. 7, this
Invention also discloses a kind of access device embodiment comprising topically effective raster data, including:
Raster data module, for storing original raster data, comprises to comprise in raster data in described raster data
Effectively grid pixel and invalid grid pixel, the value of invalid grid pixel is the designated value of data manufacturer;
The mark module of the topically effective set of pixels of raster data, for by the effective grid pixel in described raster data and
Invalid grid pixel is marked, and generates labelling raster data;Described labelling raster data is compressed, obtains compact token
Raster data;
The mark module of the topically effective set of pixels of raster data includes:
Topically effective pixel judges judge module, for judge each pixel in described raster data successively value whether
Value for invalid grid pixel;If it is, calling invalid grid pixel judge mark module, if it is not, then calling office
Portion's effective grid pixel judge mark module;
Invalid grid pixel mark module, the value for determining described raster data pixel is taking of invalid grid pixel
Value, and by described grid 0 labelling;
Topically effective grid pixel mark module, the value for determining described raster data pixel is effective grid picture
Element, and by described grid 1 labelling;
Labelling raster data generation module, for recording the labelling of all pixels in described raster data in certain sequence,
Form labelling raster data;
Labelling raster data compression module, enters for described labelling raster data is accounted for 1bit memory space according to every pixel
Row is redistributed;It is one group according to starting continuous 32 from the initial number of described labelling raster data, and every group 32 are 4
The flag data of byte takes the mode that its decimal integer value is stored to compress, and obtains compact token raster data.
The actual pixel value module of topically effective set of pixels, for by the picture of the effective grid pixel in described raster data
Plain value is individually stored in certain sequence, abandons the process of invalid grid pixel partial data, obtains effective grid pixel
Pixel value serial data;
The basic information module of raster data, for recording the essential information of described raster data, essential information includes picture
Plain width, pixels tall, the value of invalid grid pixel and pixel data type;
Memory module, for when application system needs raster data is stored, by described compact token grid number
According to, the essential information of the pixel value serial data of effective grid pixel, raster data as storage object, write file and deposited
Storage;
Read module, for when application system needs the raster data reading storage, first reading the grid number in file
According to essential information, and the essential information according to raster data, distribute the two-dimensional matrix correspondingly sized with described raster data and deposit
Storage space, the pixel value serial data further according to compact token raster data and effective grid pixel is processed to two-dimensional matrix,
Obtain the raster data restoring.
Fig. 8 is a kind of read module example structure block diagram of access device comprising topically effective raster data, such as Fig. 8
Shown, read module includes:
Memory allocation module, for the pixel wide in the essential information according to described raster data, pixels tall,
The value of invalid grid pixel and pixel data type, distribute the two-dimensional matrix storage correspondingly sized with described raster data empty
Between, each grid initializing described two-dimensional matrix is " untreated state ";
Decompression compact token raster data module, for decompressing described compact token raster data, by labelling raster data
Give described two-dimensional matrix, described two-dimensional matrix marks the position of invalid grid pixel and topically effective grid pixel;
Invalid grid pixel fills module, for inserting no the relevant position of the invalid grid pixel of described two-dimensional matrix
The value of effect grid pixel, and grid state is set to " processed state ";
Topically effective grid pixel fills module, necessarily suitable for pressing the pixel value serial data of described effective grid pixel
Sequence inserts the grid of " untreated state " in two-dimensional matrix, obtains the raster data restoring in receiving terminal.
The above implementation steps and method only have expressed one embodiment of the present invention, and description is more concrete and detailed
Carefully, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.On the premise of without departing from inventional idea of the present invention,
The deformation made and improve the protection domain that should broadly fall into patent of the present invention.