CN103886045B - Access method and device including local valid grid data - Google Patents

Access method and device including local valid grid data Download PDF

Info

Publication number
CN103886045B
CN103886045B CN201410088639.XA CN201410088639A CN103886045B CN 103886045 B CN103886045 B CN 103886045B CN 201410088639 A CN201410088639 A CN 201410088639A CN 103886045 B CN103886045 B CN 103886045B
Authority
CN
China
Prior art keywords
raster data
pixel
grid
data
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410088639.XA
Other languages
Chinese (zh)
Other versions
CN103886045A (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.)
SHANGHAI TAIYU INFORMATION TECHNOLOGY Co.,Ltd.
Original Assignee
Ludong University
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 Ludong University filed Critical Ludong University
Priority to CN201410088639.XA priority Critical patent/CN103886045B/en
Publication of CN103886045A publication Critical patent/CN103886045A/en
Application granted granted Critical
Publication of CN103886045B publication Critical patent/CN103886045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems

Abstract

The invention provides an access method and device including local valid grid data. The method comprises the steps that valid grid pixels and invalid grid pixels in the grid data are marked to generate marked grid data; the marked grid data are compressed to obtain compressed and marked grid data; pixel values of the valid grid pixels in the grid data are independently stored to obtain pixel value data strings of the valid grid pixels, and basic information of the grid data is recorded; when an application system needs to store the grid data, the compressed and marked grid data, the pixel value data strings of the valid grid pixels and the basic information of the grid data are used as storage objects to be written in files to be stored. According to the method and device, the storage amount of the grid data can be greatly reduced, and storage space can be saved; the processed grid data are transmitted, the transmission amount of the gird data can be greatly reduced, and network grid data transmission efficiency can be improved.

Description

A kind of access method comprising topically effective raster data and device
Technical field
The present invention relates to area of geographic information, more particularly to a kind of access method comprising topically effective raster data and Device.
Background technology
Raster data obtains widely in GIS (Geographic Information System, GIS-Geographic Information System) Application, in actual items, one of its important feature is that data volume is big, the transmission of the raster data between server and client Amount is often the key factor restricting gis application system performance.In raster data transmitting procedure, general way and current The method of main flow is all that all pixels value of the rectangular area with a certain pixel wide and a certain pixels tall composition passes for network Defeated data object.This method is less to total pixel number amount in rectangular area, and (such as pixel summation in rectangular area is less than 10000, every pixel data needs 4 bytes of storage space, then the total amount of data of transmission is less than 40Kb) in the case of, in most Gis It is acceptable in application;But, when application in need transmit rectangular area comprise pixel quantity larger when, such as The pixel region of 1024*1024, every pixel data needs 4 bytes of storage space, then total transmission data 4096Kb is just very Big, the impact to the performance of application system is just very big.
At present, to the transmission quantity how reducing raster data, improving system effectiveness has more research, but is concentrated mainly on Compression to data or the technique direction of coding, obtain minimum amount of storage and transmission quantity.
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.
Brief description
Fig. 1 is a kind of flow chart of the access method embodiment comprising topically effective raster data;
Fig. 2 is pixel value schematic diagram in the raster data rectangular area of Chinese soil classification embodiment;
Fig. 3 needs the pixel region of actual transmissions to illustrate for the raster data rectangular area of Chinese soil classification embodiment Figure;
Fig. 4 is the topically effective grid pixel collection labelling raster data schematic diagram of Chinese soil classification embodiment;
Fig. 5 is the topically effective grid pixel collection labelling raster data schematic diagram of Chinese soil classification embodiment;
The actual pixel value serial data of the topically effective grid pixel collection for Chinese soil classification embodiment for the Fig. 6;
Fig. 7 is a kind of structured flowchart of the access device embodiment comprising topically effective raster data;
Fig. 8 is a kind of read module example structure block diagram of access device comprising topically effective raster data.
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.

Claims (7)

1. a kind of access method comprising topically effective raster data it is characterised in that:
Effective grid pixel and invalid grid pixel is comprised, the value of invalid grid pixel is data manufacturer's in raster data Designated value;
Effective grid pixel in raster data and invalid grid pixel are marked, generate labelling raster data;To 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 obtained effective grid pixel Pixel value serial data;
Record raster data essential information, essential information include pixel wide, pixels tall, the value of invalid grid pixel and Pixel data type;
When application system needs raster data is stored, by described compact token raster data, effective grid pixel Pixel value serial data, 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, distributes the two-dimensional matrix memory space correspondingly sized with described raster data, further according to compression mark The pixel value serial data of note raster data and effective grid pixel is processed to two-dimensional matrix, obtains the raster data restoring.
2. according to claim 1 a kind of access method comprising topically effective raster data it is characterised in that described by grid Effective grid pixel in lattice data and invalid grid pixel are marked, and generate labelling raster data;To labelling raster data It 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 1bit memory space according to every pixel redistributed;
Labelling raster data after described redistributing is started continuous 32 for one according to from the initial number of labelling raster data 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 compression Labelling raster data.
3. according to claim 1 a kind of access method comprising topically effective raster data it is characterised in that
The described essential information according to raster data, distributes the two-dimensional matrix memory space correspondingly sized with described raster data, Pixel value serial data further according to compact token raster data and effective grid pixel is processed to two-dimensional matrix, is restored The step of raster data include:
According to the essential information of described raster data, distribute the two-dimensional matrix memory space correspondingly sized with described raster data; 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, in described two dimension Invalid grid pixel and the position of topically effective grid pixel is marked in 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 It is set to " processed state ";
Again the pixel value serial data of described effective grid pixel is inserted " untreated shape in described two-dimensional matrix in certain sequence The grid of state ", obtains the raster data restoring in receiving terminal.
4. a kind of access device comprising topically effective raster data is it is characterised in that include:
Raster data module, for storing original raster data, includes effective grid pixel and nothing in described raster data Effect 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 grid Data;
The actual pixel value module of topically effective set of pixels, for by the pixel value of the effective grid pixel in described raster data Individually stored in certain sequence, abandon the process of invalid grid pixel partial data, obtain the pixel of effective grid pixel Value Data string;
The basic information module of raster data, for recording the essential information of described raster data, essential information includes pixel width Degree, 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 raster data, having The pixel value serial data of effect grid pixel, the essential information of raster data, as storage object, write file and are stored;
Read module, for when application system needs the raster data reading storage, first reading the raster data in file Essential information, and the essential information according to raster data, distribute the two-dimensional matrix storage correspondingly sized with described raster data empty Between, the pixel value serial data further according to compact token raster data and effective grid pixel is processed to two-dimensional matrix, obtains The raster data restoring.
5. according to claim 4 a kind of access device comprising topically effective raster data it is characterised in that
The mark module of the topically effective set of pixels of described raster data includes:
Topically effective pixel judges judge module, and whether the value for judging each pixel in described raster data successively is no The value of effect grid pixel;If it is, calling invalid grid pixel judge mark module, if it is not, then calling local to have Effect grid pixel judge mark module;
Invalid grid pixel mark module, the value for determining described raster data pixel is the value of invalid grid pixel, And by described grid 0 labelling;
Topically effective grid pixel mark module, the value for determining described raster data pixel is effective grid pixel, 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, forms Labelling raster data;
Labelling raster data compression module, carries out weight for described labelling raster data is accounted for 1bit memory space according to every pixel New distribution;It is one group according to starting continuous 32 from the initial number of described labelling raster data, and every group 32 is 4 bytes Flag data take the mode that its decimal integer value is stored to compress, obtain compact token raster data.
6. according to claim 4 a kind of access device comprising topically effective raster data it is characterised in that
Described read module includes:
Memory allocation module, for the pixel wide in the essential information according to described raster data, pixels tall, invalid The value of grid pixel and pixel data type, distribute the two-dimensional matrix memory space correspondingly sized with described raster data, just Each grid of the described two-dimensional matrix of beginningization is " untreated state ";
Decompression compact token raster data module, for decompressing described compact token raster data, labelling raster data is given Described two-dimensional matrix, marks the position of invalid grid pixel and topically effective grid pixel in described two-dimensional matrix;
Invalid grid pixel fills module, for the relevant position of the invalid grid pixel of described two-dimensional matrix is inserted invalid grid The value of lattice pixel, and grid state is set to " processed state ";
Topically effective grid pixel fills module, for filling out the pixel value serial data of described effective grid pixel in certain sequence Enter the grid of " untreated state " in two-dimensional matrix, obtain the raster data restoring in receiving terminal.
7. a kind of transmission method comprising topically effective raster data is it is characterised in that server adopts in claims 1 to 3 Any one access method comprising topically effective raster data raster data is processed, by the compact token obtaining grid Data, the pixel value serial data of effective grid pixel, the essential information of raster data, as connection object, are transmitted, transmission To client, client to compact token raster data, the pixel value serial data of effective grid pixel, raster data basic letter Breath is stored accordingly and is read.
CN201410088639.XA 2014-03-12 2014-03-12 Access method and device including local valid grid data Active CN103886045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410088639.XA CN103886045B (en) 2014-03-12 2014-03-12 Access method and device including local valid grid data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410088639.XA CN103886045B (en) 2014-03-12 2014-03-12 Access method and device including local valid grid data

Publications (2)

Publication Number Publication Date
CN103886045A CN103886045A (en) 2014-06-25
CN103886045B true CN103886045B (en) 2017-02-15

Family

ID=50954937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410088639.XA Active CN103886045B (en) 2014-03-12 2014-03-12 Access method and device including local valid grid data

Country Status (1)

Country Link
CN (1) CN103886045B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI829098B (en) 2015-01-02 2024-01-11 美商梅拉洛伊卡公司 Bacterial compositions
CN107977427B (en) * 2017-11-28 2021-08-24 鲁东大学 Storage and reading method of classified raster data
CN110505218B (en) * 2019-08-07 2021-11-16 中国电子科技集团公司第二十八研究所 Grid data self-adaptive compression transmission method based on JSON and computer storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7880750B2 (en) * 2005-01-06 2011-02-01 Zenographics, Inc. Digital image processing with inherent compression
CN102708109B (en) * 2012-01-12 2014-05-14 北京地拓科技发展有限公司 Raster data reading method and device and raster data writing method and device
CN102937962B (en) * 2012-09-17 2016-08-03 北京地拓科技发展有限公司 The raster data write comprising no data and the method and device read

Also Published As

Publication number Publication date
CN103886045A (en) 2014-06-25

Similar Documents

Publication Publication Date Title
US9877031B2 (en) System and method for multi-resolution raster data processing
CN103886045B (en) Access method and device including local valid grid data
CN102411616A (en) Method and system for storing data and data management method
CN105989129A (en) Real-time data statistic method and device
CN103761229B (en) Data processing method and device
CN103678657B (en) Method for storing and reading altitude data of terrain
CN102110281B (en) Method for embedding and extracting watermarks by adopting difference expansion aiming at shape point map layer data
CN110659651B (en) Tampering positioning reversible image watermarking method based on SIFT
CN108255864A (en) Photomap service issuing method based on distributed storage and Distributed Calculation
CN110533572A (en) A kind of watermark embedding method, system and relevant apparatus
CN107301194A (en) The compression storage of tile type grating map and dissemination method
CN105354291B (en) A kind of raster data index and querying method
CN104794677A (en) Vector map watermark method based on space geometric features
CN101346745A (en) Data compression method and apparatus, data restoration method and apparatus, and program therefor
CN112069141A (en) Special compression method for meteorological forecast lattice point data
CN106127668A (en) GPS and the guard method in IOS end digitized video of the BEI-DOU position system space time information
CN101957839A (en) Map file format
CN109754358B (en) Image watermarking method and system based on significance detection and contourlet transformation
CN102508853B (en) Method and system for filling raster data
CN102103600B (en) Map building method and map system
CN104778212B (en) Map datum generation method and device, map datum read method and device
CN110019636A (en) A kind of storage mode of GIS tile map
CN109886134A (en) The extra large land information index coding method of high-resolution global digital elevation model image
CN105023235B (en) A kind of electronic chart water mark method based on spatial redundancy relationship
CN102867023A (en) Method for storing and reading grid data and device

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210319

Address after: 518110 Longfa road 428 Huayuan street B24 Huayuan street b23b Longhua Street Longyuan community Longhua Street Longhua District Shenzhen City Guangdong Province

Patentee after: Shenzhen Morning Intellectual Property Operations Co.,Ltd.

Address before: 264001 Hongqi Middle Road, Zhifu District, Yantai, Shandong 186

Patentee before: LUDONG University

Effective date of registration: 20210319

Address after: 201100 room 509, building 2, No. 508, Chundong Road, Minhang District, Shanghai

Patentee after: SHANGHAI TAIYU INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 518110 Longfa road 428 Huayuan street B24 Huayuan street b23b Longhua Street Longyuan community Longhua Street Longhua District Shenzhen City Guangdong Province

Patentee before: Shenzhen Morning Intellectual Property Operations Co.,Ltd.