CN107402958B - Method for creating and accessing GKF three-dimensional spatial database - Google Patents

Method for creating and accessing GKF three-dimensional spatial database Download PDF

Info

Publication number
CN107402958B
CN107402958B CN201710437841.2A CN201710437841A CN107402958B CN 107402958 B CN107402958 B CN 107402958B CN 201710437841 A CN201710437841 A CN 201710437841A CN 107402958 B CN107402958 B CN 107402958B
Authority
CN
China
Prior art keywords
data
gkf
file
dimensional
tile
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
CN201710437841.2A
Other languages
Chinese (zh)
Other versions
CN107402958A (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.)
Chongqing Institute Of Surveying And Mapping Science And Technology Chongqing Map Compilation Center
Original Assignee
Chongqing Survey Institute
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 Chongqing Survey Institute filed Critical Chongqing Survey Institute
Priority to CN201710437841.2A priority Critical patent/CN107402958B/en
Publication of CN107402958A publication Critical patent/CN107402958A/en
Application granted granted Critical
Publication of CN107402958B publication Critical patent/CN107402958B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2237Vectors, bitmaps or matrices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a method for creating and accessing a GKF three-dimensional spatial database, belonging to the field of three-dimensional digital cities and three-dimensional geographic information systems. The invention provides a method for creating and accessing a GKF three-dimensional spatial database based on NoSQL thought and memory mapping technology, and improves the storage safety and the quick access efficiency of the three-dimensional model, the three-dimensional terrain and the oblique photography model data, aiming at the requirements of storage and quick access of the three-dimensional model, the three-dimensional terrain and the oblique photography model data. The invention considers the characteristics of massive data, binary fluidization, no need of transaction support for access and the like of the three-dimensional model, the three-dimensional terrain and the oblique photography model data, better conforms to the characteristics of the three-dimensional model, the three-dimensional terrain and the oblique photography model data than a three-dimensional space database stored based on a relational database, and has more compact storage space utilization, better safety and higher data access efficiency.

Description

Method for creating and accessing GKF three-dimensional spatial database
Technical Field
The invention belongs to the field of three-dimensional digital cities and three-dimensional geographic information systems, and particularly relates to a three-dimensional space database format and a creating and accessing method thereof.
Background
The three-dimensional digital city is based on computer technology, multimedia technology and large-scale storage technology, takes a broadband network as a link, and applies technologies such as remote sensing, a global positioning system, a geographic information system, remote sensing, simulation-virtualization and the like to carry out multi-resolution, multi-scale, multi-space-time and multi-variety three-dimensional description on the city, namely, all the past, present and future contents of the city are digitally and virtually realized on the network by using an information technology means.
The three-dimensional space data is three-dimensional expression of basic geographic information such as landforms, overground and underground artificial buildings and the like, reflects information such as three-dimensional space positions, geometric forms, textures, attributes and the like of an expressed object, mainly comprises three-dimensional landforms, three-dimensional models and oblique photography models, and the three-dimensional models are mainly divided into contents such as ground models, building models, road models, water system models, vegetation models, underground space facility models and other models.
The three-dimensional database is used for storing three-dimensional spatial data and mainly comprises a three-dimensional terrain database, a three-dimensional model database and an oblique photography model database. The three-dimensional terrain data, the three-dimensional model data and the oblique photography model data refer to three-dimensional space data manufactured by adopting three-dimensional terrain creating software, three-dimensional modeling software and oblique photography modeling software, can be opened and edited, can perform operations such as coordinate conversion, format conversion, layering, partitioning, slicing and the like, and stores operation results in a three-dimensional space database.
Three-dimensional spatial databases are typically stored as relational databases or files; the three-dimensional database creation generally comprises the steps of mode creation, warehousing inspection, warehousing, post-warehousing inspection and the like of a relational database; three-dimensional database access generally includes steps of relational database opening, three-dimensional scene construction, SQL query execution and result return.
For a three-dimensional terrain, generating three-dimensional terrain tiles of a multilevel pyramid structure by resampling DEM (digital elevation model) and DOM (document object model) data, wherein each three-dimensional terrain tile comprises elevation data and texture data, and the three-dimensional terrain tiles of the hierarchical pyramid structure meet the loading requirements of different scenes;
for a three-dimensional model, an LOD technology is usually supported, and model loading requirements of different scenes are adapted through models with different levels of detail. In 1976, Clark proposed the concept of LOD (Levels of Detail) model, which considers that when an object covers a small area of the screen, the object can be used to describe a thicker model, and a geometric level model for a visible surface judgment algorithm is provided to rapidly draw a complex scene.
For the oblique photography model, oblique photography modeling software automatically reconstructs oblique photography tiles with pyramid structures according to the space-three encryption results and oblique photography textures, each oblique photography tile comprises geometric data and texture data, and the oblique photography tiles with pyramid structures of the levels adapt to the loading requirements of different scenes;
NoSQL (not Only sql), which generally refers to a non-relational database, is a completely new database revolution, four major categories of NoSQL databases: (1) Key-Value storage databases are mainly implemented by using a hash table, in which a specific Key and a pointer point to specific data, and are mainly used for handling high access load of large amounts of data, and also used in some log systems, etc. Key points to Value Key Value pairs, usually realized by hash table, and data with high searching speed is unstructured and usually only regarded as character strings or binary data. The Key/value model has the advantages of simplicity and easy deployment for IT systems. But Key/value appears to be inefficient if the DBA only queries or updates the value. (2) The column storage database is generally used for dealing with mass data stored in a distributed manner. Keys still exist but they are characterized by pointing to multiple columns. The columns are arranged by a family of columns. (3) A document-type database, where the data model of the type is a versioned document, and the semi-structured document is stored in a particular format, such as JSON. A document-type database may be viewed as an upgraded version of a key-value database, allowing key values to be nested between them. And the document type database is more efficient than the key-value database in query. (4) A Graph (Graph) database is a flexible Graph model and can be extended to multiple servers. NoSQL databases do not have a Standard Query Language (SQL), and therefore, data models are required to perform database queries.
The NoSQL database works well under the following conditions: (1) the data model is simpler; (2) there is a need for more flexible IT systems; (3) the requirement on the performance of the database is high; (4) a high degree of data consistency is not required; (5) it is easier to map the context of complex values for a given key. (6) BASE: the NoSQL database guarantees BASE properties against the strict ACID properties of transactions. BASE is the final consistency and soft transaction.
The memory mapping file is a mapping from one file to one memory. Win32 provides a function (CreateFileMapping) that allows an application to map files to a process. Memory mapped files are somewhat similar to virtual memory in that a region of address space can be reserved by a memory mapped file, with physical storage committed to this region, the physical storage to which the memory file maps being from a file already on disk, and the file must first be mapped before the file can be operated upon. When the memory mapped file is used for processing the file stored on the disk, I/O operation on the file is not needed any more, so that the memory mapped file can play a very important role in processing the file with large data volume.
In summary, in the three-dimensional database, a large amount of three-dimensional data is stored, and each element has LOD nodes or pyramid leaf nodes with different precisions. Because hardware of a common computer is limited, the existing three-dimensional space database based on the relational database is slow in speed and low in efficiency, and therefore how to efficiently store and schedule three-dimensional space data becomes a more urgent problem.
Disclosure of Invention
In view of the above-mentioned drawbacks of the prior art, the present invention is directed to storage and fast access of data for three-dimensional models, three-dimensional terrain, and oblique photography models.
In order to achieve the purpose, the invention provides a method for creating and accessing a GKF three-dimensional spatial database.
1. A method for creating a GKF three-dimensional spatial database is characterized by comprising the following steps:
a1, analyzing the type of the created data set, and if the data set is a three-dimensional model data set, executing the step A2; if the three-dimensional terrain data set is available, executing step A3; if it is the oblique photography data set, execute step A4;
a2, creating a GKF three-dimensional spatial database of a three-dimensional model data set type, and sequentially executing A21-A25;
a21, storing the metadata of the three-dimensional model data set in a database, and sequentially executing A211-A215; (ii) a
A211, acquiring three-dimensional model data set information, wherein the three-dimensional model data set information comprises a version, a UUID, a name, an alias, a data making unit, a creation date, a metadata record number and a data record number;
a212, acquiring a scene layer list, wherein the scene layer list is a tuple list of < layer ID, parent layer ID and layer name >;
a213, obtaining three-dimensional model information, wherein the three-dimensional model information comprises a name, a central point position, a deflection and scaling value, a bounding box minimum point, a bounding box maximum point, a layer ID belonging to the bounding box and LOD data; the LOD data is a tuple list of < LOD level, minDistance, maxDenstance >;
and A214, creating 32-byte GKXHeader and writing the GKX file. The GKXHeader comprises 8 fields of a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, the compressed length of a GKX index file, the original length of the GKX index file and a reserved field; during creation, the GKF file identifier is filled to 0x4B4F4547, the GKF data set type is filled to GKF _ DATASET, and the value of the GKF _ DATASET is 0x 1;
a215, using an AES encryption algorithm to form three metadata records by using the 3 metadata obtained in the three steps A211-A213; the metadata record is written into a GKX file, and the encrypted data is written into a GKF file;
a22, warehousing the geometric data of the three-dimensional model, obtaining all model lists needing warehousing, and executing A221-A222 on each model;
a221, obtaining the name, rendering options, a vertex list, a vertex normal list, a first set of texture coordinates T0, a second set of texture coordinates T1, used texture names and the like of the model to form geometric data in a binary format, generating encrypted binary geometric data by using an XOR encryption algorithm, compressing and storing the encrypted binary geometric data by using a ZIP algorithm, and recording the original length before compression and the length after compression to form compressed and encrypted binary model data; the model rendering options comprise options of whether the model is transparent or not, whether the model contains illumination textures or not, whether the model is displayed on two sides or not, and water efficiency and glass material;
a222, creating a data record corresponding to the compressed and encrypted binary model data, writing the data record into a GKX file, and sequentially writing the compressed and encrypted binary model data into a GKF file;
a23, warehousing texture data of the three-dimensional model, obtaining all texture lists needing warehousing, and executing A231-A232 on each texture;
a231, acquiring the texture binary format data, generating encrypted binary texture data by using an XOR encryption algorithm, compressing and storing by using a ZIP algorithm, and recording an original length before compression and a length after compression to form compressed and encrypted binary texture data; the texture binary format is a DDS format and supports DXT1, DXT3 and DXT 5;
a232, creating a data record corresponding to the compressed and encrypted binary texture data, writing the data record into a GKX file, and sequentially writing the compressed and encrypted binary texture data into a GKF file;
and A24, storing the three-dimensional model attribute data.
Acquiring all element lists needing to be put in a warehouse, generating attribute data for each element, writing the attribute data record into a GKX file, and writing the attribute data into a GKF file;
a25 and GKX data are recorded and stored.
Compressing and storing metadata records and data records in the GKX file by using a ZIP algorithm, and updating the original length before compression and the length after compression;
a3, creating a GKF three-dimensional terrain database of the three-dimensional terrain data set, and sequentially executing A31-A33;
and A31, storing the three-dimensional terrain data set metadata. Sequentially executing A311-A313:
a311, acquiring three-dimensional terrain data set information, wherein the three-dimensional terrain data set information comprises a version, a UUID, a name, an alias, a data making unit, a creation date, a metadata record number, a data record number, a root tile name, a center point position, a deflection and scaling value, a bounding box minimum point and a bounding box maximum point;
and A312, creating 32-byte GKXHeader and writing the GKX file. The GKXHeader comprises 8 fields of a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, the compressed length of a GKX index file, the original length of the GKX index file and a reserved field; during creation, the GKF file identifier is filled to be 0x4B4F4547, the GKF data set type is filled to be GKF _ TILESET, and the value of the GKF _ TILESET is 0x 2;
a313, encrypting the data set information of the three-dimensional terrain data set obtained in the step A311 by using an AES encryption algorithm to form a metadata record; the metadata record is written into a GKX file, and the encrypted data is written into a GKF file;
a32, storing the three-dimensional terrain tile data, acquiring all three-dimensional terrain tile lists needing to be stored, and executing A321-A322 on each three-dimensional terrain tile;
a321, obtaining the name, LOD information, elevation data, texture data and the like of the three-dimensional terrain tile, forming three-dimensional terrain tile data in a binary format, generating encrypted binary three-dimensional terrain tile data by using an XOR encryption algorithm, compressing and storing by using a ZIP algorithm, recording the original length before compression and the length after compression, and forming compressed and encrypted binary three-dimensional terrain tile data;
a322, creating a data record corresponding to the compressed and encrypted binary three-dimensional terrain tile data, writing the data record into a GKX file, and sequentially writing the compressed and encrypted binary three-dimensional terrain tile data into a GKF file;
a33 and GKX data are recorded and stored.
Compressing and storing metadata records and data records in the GKX file by using a ZIP algorithm, and recording the original length before compression and the length after compression;
a4, creating a GKF oblique photography model database of the oblique photography model data set, and sequentially executing A41-A43;
a41, storing the metadata of the oblique photography model data set, and sequentially executing A411-A414:
a411, obtaining oblique photography model data set information, wherein the oblique photography model data set information comprises a version, a UUID, a name, an alias, a data making unit, a creation date, a metadata record number, a data record number, a central point position, a deflection and scaling value, a bounding box minimum point bounding box maximum point, an acquisition time, an acquisition platform, a modeling platform, an image ground resolution, a mapping scale, a flight height, an orthographic course overlapping degree, an orthographic collateral overlapping degree, an accuracy evaluation date, an accuracy evaluation point number, an error in an accuracy evaluation X direction, an error in an accuracy evaluation Y direction, an error in an accuracy evaluation elevation, an achievement pyramid level, an X direction resolution of an achievement finest layer model and a Y direction resolution of an achievement finest layer model;
a412, obtaining a root tile name list of the oblique photography model data set;
and A413, creating 32-byte GKXHeader and writing the GKX file. The GKXHeader comprises 8 fields of a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, the compressed length of a GKX index file, the original length of the GKX index file and a reserved field; during creation, the GKF file identifier is filled to be 0x4B4F4547, the GKF data set type is filled to be GKF _ OBLIQUETILLE, and the value of the GKF _ OBLIQUETILLE is 0x 3;
a414, encrypting the two pieces of metadata obtained in the steps A411 to A412 by using an AES encryption algorithm to form two pieces of metadata records; writing data records into a GKX file, and writing encrypted data into a GKF file;
a42, storing oblique photography tile data, acquiring all oblique photography tile lists needing to be stored, and executing A421-A422 on each oblique photography tile;
a421, obtaining the name, LOD information, geometric data, texture data and the like of the oblique photography tile, forming oblique photography tile data in a binary format, generating encrypted binary oblique photography tile data by using an XOR encryption algorithm, compressing and storing by using a ZIP algorithm, recording the original length before compression and the length after compression, and forming compressed and encrypted binary oblique photography tile data;
a422, creating data records corresponding to the compressed and encrypted binary oblique photography tile data, writing the data records into a GKX file, and sequentially writing the compressed and encrypted binary oblique photography tile data into a GKF file;
a43 and GKX data are recorded and stored.
Compressing and storing metadata records and data records in the GKX file by using a ZIP algorithm, and recording the original length before compression and the length after compression;
2. a GKF three-dimensional spatial database access method is characterized by comprising the following steps:
and B1, reading the GKX data recording file. Sequentially execute B211-B215;
b211, opening a corresponding GKX data recording file stream, and reading a GKXHeader structure, wherein the GKXHeader structure is shown as A314, A312 and A413;
b212, reading and decompressing the metadata record and the data record by using a ZIP algorithm, and storing the metadata record and the data record into a BUFFER;
b213, closing the GKX data recording file stream;
b214, reading the metadata record in the BUFFER;
b215, reading the data record in the BUFFER, and establishing a data name and a corresponding Map of the data record;
and B2, creating a memory mapping environment of the GKF file. Sequentially executing steps B221-B224;
b221, creating a handle of the GKF file in a read-only mode by using a createFile function;
b222, acquiring the size of the GKF file by using a GetFileSizeEx function;
b223, creating a memory mapping handle of the GKF file by using a CreateFileMapping function;
b224, with a 2GB block as a unit, creating a memory mapping pointer list of the GKF file by using a MapViewOfFile function; a GKF file with the size of L, wherein the number of corresponding memory mapping pointer list items is rounded up by (L/2 GB); recording as N; the first N-1 ones are 2GB, the last ones are L- (N-1) × 2 GB; the block number of each 2GB block is a subscript of the block in a memory mapping pointer list, and the subscript is from a 0 th block to an N-1 th block, wherein the subscript is N blocks;
b3, creating a three-dimensional scene and dynamically scheduling access;
analyzing the type of the data set corresponding to the GKF three-dimensional spatial database, and if the data set is a three-dimensional model data set, executing the step B31; if the three-dimensional terrain data set is available, executing step B32; if it is the oblique photography data set, go to step B33;
b31, creating a scene of the three-dimensional model data set and dynamically scheduling access, and sequentially executing steps B311-B314;
and B311, reading the metadata of the three-dimensional model data set. Reading and decrypting in the memory according to the 0 th memory mapping pointer to obtain three metadata of data set information, a scene layer list and three-dimensional model information of the three-dimensional model data set;
b312, constructing a grid index according to the three-dimensional model information metadata, and constructing a three-dimensional model tree according to a grid index structure;
b313, traversing the three-dimensional scene tree during rendering updating, triggering a model calling request according to the visual distance, the size of the model and the configured model visible distance, establishing a model calling request priority queue, sequentially performing I/O (input/output) scheduling according to the priority queue, reading and generating a three-dimensional geometric model, putting the three-dimensional geometric model into a rendering thread in an asynchronous mode, updating the scene in the next rendering frame cycle, combining scene geometric nodes below corresponding scene tree leaf nodes, updating the model state of the scene tree leaf nodes, and completing the dynamic scheduling of the geometric model;
b314, analyzing texture loading conditions in the traversing process of the three-dimensional scene tree, dynamically triggering texture calling requests, establishing texture calling request priority queues, sequentially performing I/O (input/output) scheduling according to the priority queues, reading and generating textures, adding and updating the textures into corresponding models, and completing dynamic scheduling of the textures;
b32, creating scenes of the three-dimensional terrain data set and dynamically scheduling access, and sequentially executing steps B321-B323;
b321, reading and decrypting in the memory according to the 0 th memory mapping pointer to obtain data set information of the three-dimensional terrain data set;
b322, constructing a three-dimensional terrain tile tree of a single node according to data set information of the three-dimensional terrain data set, the name of a root tile and a three-dimensional terrain pyramid index built in the tile;
b323, during rendering updating, traversing a three-dimensional terrain tile tree of a single node, triggering a three-dimensional terrain tile calling request according to the visual distance and LOD configuration of the three-dimensional terrain tiles, establishing a priority queue of the three-dimensional terrain tile calling request, sequentially performing I/O (input/output) scheduling according to the priority queue, reading and generating the three-dimensional terrain tiles, putting the three-dimensional terrain tiles into a rendering thread in an asynchronous mode, updating a scene in the next rendering frame cycle, and combining the three-dimensional terrain tiles under leaf nodes of the corresponding three-dimensional terrain tile tree to complete dynamic scheduling of the three-dimensional terrain tiles;
b33, creating a scene of the oblique photography data set and dynamically scheduling access, and sequentially executing steps B331-B333;
b331, reading and decrypting in the memory according to the 0 th memory mapping pointer to obtain data set information and a root tile list of the oblique photography data set;
b332, constructing a tilted photography tile tree of a plurality of nodes according to the data set information of the tilted photography data set, the root tile list and a tilted photography tile pyramid index built in the tile;
b333, traversing the oblique photography tile trees of a plurality of nodes during rendering updating, triggering an oblique photography tile calling request according to factors such as visual range and LOD configuration of the oblique photography tiles, establishing a priority queue of the oblique photography tile calling request, sequentially performing I/O (input/output) scheduling according to the priority queue, reading and generating the oblique photography tiles, putting the oblique photography tiles into a rendering thread in an asynchronous mode, updating scenes in the next rendering frame cycle, and combining the oblique photography tiles under corresponding leaf nodes of the oblique photography tile trees to complete dynamic scheduling of the oblique photography tiles.
B4, reading the GKF data file, and sequentially executing the steps B41-B42;
b41, acquiring the corresponding data record according to the data name of the dynamic call request through the data name established in the step B215 and the corresponding Map of the data record;
b42, judging the Block numbers Block1 and Block2 of the 2GB blocks corresponding to the head and the tail of the data; the formula is as follows:
Block1=record.dataOffset/2GB
Block2=(record.dataOffset+record.dataLen)/2GB
if Block1 is Block2, the data is in a data Block, a memory mapping pointer corresponding to a Block1 Block number is used, a data Block with an offset (record.dataoffset &0x7FFFFFFF) and a length of record.datalen is directly read, exclusive-or decryption is performed, analysis is performed according to the data type, corresponding geometric data, texture data, three-dimensional terrain tile data or oblique photography tile data are obtained, and the geometric data, the texture data, the three-dimensional terrain tile data or the oblique photography tile data are returned;
if Block1< Block2, the data is in two data blocks, using memory mapping pointers corresponding to the Block1 Block number and the Block2 Block number, directly reading a data Block with an offset of record.dataoffset &0x7FFFFFFF at the end of the Block1 Block number and a data Block with a length of Block2 × 2GB-record.dataoffset and an offset of the beginning of the Block2 Block number of 0 and a data Block with a length of (record.dataoffset + record.datalen-Block2 × 2GB), combining the two data blocks, performing exclusive or decryption, analyzing according to the data type, obtaining corresponding geometric data, texture data, three-dimensional terrain tile data or oblique photography tile data, and returning the geometric data, the texture data, the three-dimensional terrain tile data or the oblique photography tile data;
b5, when the model attribute needs to be inquired, finding out the corresponding element by the model name, inquiring the element attribute record according to the element, accessing the GKF data file according to the element attribute record, obtaining the model attribute and returning the element attribute record.
The invention has the beneficial effects that:
1. the invention provides a method for creating and accessing a GKF three-dimensional spatial database based on NoSQL thought and memory mapping technology, and aims at the storage and quick access requirements of three-dimensional model, three-dimensional terrain and oblique photography model data, and improves the storage safety and quick access efficiency of the three-dimensional model, three-dimensional terrain and oblique photography model data.
2. The invention considers the characteristics of massive data, binary fluidization, no need of transaction support for access and the like of the three-dimensional model, the three-dimensional terrain and the oblique photography model data, better conforms to the characteristics of the three-dimensional model, the three-dimensional terrain and the oblique photography model data than a three-dimensional space database stored based on a relational database, and has more compact storage space utilization, better safety and higher data access efficiency.
Drawings
FIG. 1 is a schematic diagram of the method for creating a GKF spatial database according to the invention.
FIG. 2 is a schematic diagram of the access method of the GKF spatial database of the invention.
Detailed Description
The invention is further illustrated by the following figures and examples:
embodiment 1, as shown in fig. 1, a method for creating a GKF three-dimensional spatial database is performed according to the following steps:
a1, analyzing the type of the created data set, and if the data set is a three-dimensional model data set, executing the step A2; if the three-dimensional terrain data set is available, executing step A3; if it is the oblique photography data set, execute step A4;
a2, creating a GKF three-dimensional spatial database of a three-dimensional model data set type, and sequentially executing A21-A25;
a21, storing the metadata of the three-dimensional model data set in a database, and sequentially executing A211-A215; (ii) a
A211, acquiring three-dimensional model data set information, wherein the three-dimensional model data set information comprises a version, a UUID, a name, an alias, a data making unit, a creation date, a metadata record number and a data record number;
a212, acquiring a scene layer list, wherein the scene layer list is a tuple list of < layer ID, parent layer ID and layer name >;
a213, obtaining three-dimensional model information, wherein the three-dimensional model information comprises a name, a central point position, a deflection and scaling value, a bounding box minimum point, a bounding box maximum point, a layer ID belonging to the bounding box and LOD data; the LOD data is a tuple list of < LOD level, minDistance, maxDenstance >;
and A214, creating 32-byte GKXHeader and writing the GKX file. The GKXHeader comprises 8 fields of a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, the compressed length of a GKX index file, the original length of the GKX index file and a reserved field; during creation, the GKF file identifier is filled to 0x4B4F4547, the GKF data set type is filled to GKF _ DATASET, and the value of the GKF _ DATASET is 0x 1;
a215, using an AES encryption algorithm to form three metadata records by using the 3 metadata obtained in the three steps A211-A213; the metadata record is written into a GKX file, and the encrypted data is written into a GKF file;
a22, warehousing the geometric data of the three-dimensional model, obtaining all model lists needing warehousing, and executing A221-A222 on each model;
a221, obtaining the name, rendering options, a vertex list, a vertex normal list, a first set of texture coordinates T0, a second set of texture coordinates T1, used texture names and the like of the model to form geometric data in a binary format, generating encrypted binary geometric data by using an XOR encryption algorithm, compressing and storing the encrypted binary geometric data by using a ZIP algorithm, and recording the original length before compression and the length after compression to form compressed and encrypted binary model data; the model rendering options comprise options of whether the model is transparent or not, whether the model contains illumination textures or not, whether the model is displayed on two sides or not, and water efficiency and glass material;
a222, creating a data record corresponding to the compressed and encrypted binary model data, writing the data record into a GKX file, and sequentially writing the compressed and encrypted binary model data into a GKF file;
a23, warehousing texture data of the three-dimensional model, obtaining all texture lists needing warehousing, and executing A231-A232 on each texture;
a231, acquiring the texture binary format data, generating encrypted binary texture data by using an XOR encryption algorithm, compressing and storing by using a ZIP algorithm, and recording an original length before compression and a length after compression to form compressed and encrypted binary texture data; the texture binary format is a DDS format and supports DXT1, DXT3 and DXT 5;
a232, creating a data record corresponding to the compressed and encrypted binary texture data, writing the data record into a GKX file, and sequentially writing the compressed and encrypted binary texture data into a GKF file;
and A24, storing the three-dimensional model attribute data.
Acquiring all element lists needing to be put in a warehouse, generating attribute data for each element, writing the attribute data record into a GKX file, and writing the attribute data into a GKF file;
a25 and GKX data are recorded and stored.
Compressing and storing metadata records and data records in the GKX file by using a ZIP algorithm, and updating the original length before compression and the length after compression;
a3, creating a GKF three-dimensional terrain database of the three-dimensional terrain data set, and sequentially executing A31-A33;
and A31, storing the three-dimensional terrain data set metadata. Sequentially executing A311-A313:
a311, acquiring three-dimensional terrain data set information, wherein the three-dimensional terrain data set information comprises a version, a UUID, a name, an alias, a data making unit, a creation date, a metadata record number, a data record number, a root tile name, a center point position, a deflection and scaling value, a bounding box minimum point and a bounding box maximum point;
and A312, creating 32-byte GKXHeader and writing the GKX file. The GKXHeader comprises 8 fields of a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, the compressed length of a GKX index file, the original length of the GKX index file and a reserved field; during creation, the GKF file identifier is filled to be 0x4B4F4547, the GKF data set type is filled to be GKF _ TILESET, and the value of the GKF _ TILESET is 0x 2;
a313, encrypting the data set information of the three-dimensional terrain data set obtained in the step A311 by using an AES encryption algorithm to form a metadata record; the metadata record is written into a GKX file, and the encrypted data is written into a GKF file;
a32, storing the three-dimensional terrain tile data, acquiring all three-dimensional terrain tile lists needing to be stored, and executing A321-A322 on each three-dimensional terrain tile;
a321, obtaining the name, LOD information, elevation data, texture data and the like of the three-dimensional terrain tile, forming three-dimensional terrain tile data in a binary format, generating encrypted binary three-dimensional terrain tile data by using an XOR encryption algorithm, compressing and storing by using a ZIP algorithm, recording the original length before compression and the length after compression, and forming compressed and encrypted binary three-dimensional terrain tile data;
a322, creating a data record corresponding to the compressed and encrypted binary three-dimensional terrain tile data, writing the data record into a GKX file, and sequentially writing the compressed and encrypted binary three-dimensional terrain tile data into a GKF file;
a33 and GKX data are recorded and stored.
Compressing and storing metadata records and data records in the GKX file by using a ZIP algorithm, and recording the original length before compression and the length after compression;
a4, creating a GKF oblique photography model database of the oblique photography model data set, and sequentially executing A41-A43;
a41, storing the metadata of the oblique photography model data set, and sequentially executing A411-A414:
a411, obtaining oblique photography model data set information, wherein the oblique photography model data set information comprises a version, a UUID, a name, an alias, a data making unit, a creation date, a metadata record number, a data record number, a central point position, a deflection and scaling value, a bounding box minimum point bounding box maximum point, an acquisition time, an acquisition platform, a modeling platform, an image ground resolution, a mapping scale, a flight height, an orthographic course overlapping degree, an orthographic collateral overlapping degree, an accuracy evaluation date, an accuracy evaluation point number, an error in an accuracy evaluation X direction, an error in an accuracy evaluation Y direction, an error in an accuracy evaluation elevation, an achievement pyramid level, an X direction resolution of an achievement finest layer model and a Y direction resolution of an achievement finest layer model;
a412, obtaining a root tile name list of the oblique photography model data set;
and A413, creating 32-byte GKXHeader and writing the GKX file. The GKXHeader comprises 8 fields of a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, the compressed length of a GKX index file, the original length of the GKX index file and a reserved field; during creation, the GKF file identifier is filled to be 0x4B4F4547, the GKF data set type is filled to be GKF _ OBLIQUETILLE, and the value of the GKF _ OBLIQUETILLE is 0x 3;
a414, encrypting the two pieces of metadata obtained in the steps A411 to A412 by using an AES encryption algorithm to form two pieces of metadata records; writing data records into a GKX file, and writing encrypted data into a GKF file;
a42, storing oblique photography tile data, acquiring all oblique photography tile lists needing to be stored, and executing A421-A422 on each oblique photography tile;
a421, obtaining the name, LOD information, geometric data, texture data and the like of the oblique photography tile, forming oblique photography tile data in a binary format, generating encrypted binary oblique photography tile data by using an XOR encryption algorithm, compressing and storing by using a ZIP algorithm, recording the original length before compression and the length after compression, and forming compressed and encrypted binary oblique photography tile data;
a422, creating data records corresponding to the compressed and encrypted binary oblique photography tile data, writing the data records into a GKX file, and sequentially writing the compressed and encrypted binary oblique photography tile data into a GKF file;
a43 and GKX data are recorded and stored.
Compressing and storing metadata records and data records in the GKX file by using a ZIP algorithm, and recording the original length before compression and the length after compression;
embodiment 2, as shown in fig. 2, a method for accessing a GKF three-dimensional spatial database is performed according to the following steps:
and B1, reading the GKX data recording file. Sequentially execute B211-B215;
b211, opening a corresponding GKX data recording file stream, and reading a GKXHeader structure, wherein the GKXHeader structure is shown as A314, A312 and A413;
b212, reading and decompressing the metadata record and the data record by using a ZIP algorithm, and storing the metadata record and the data record into a BUFFER;
b213, closing the GKX data recording file stream;
b214, reading the metadata record in the BUFFER;
b215, reading the data record in the BUFFER, and establishing a data name and a corresponding Map of the data record;
and B2, creating a memory mapping environment of the GKF file. Sequentially executing steps B221-B224;
b221, creating a handle of the GKF file in a read-only mode by using a createFile function;
b222, acquiring the size of the GKF file by using a GetFileSizeEx function;
b223, creating a memory mapping handle of the GKF file by using a CreateFileMapping function;
b224, with a 2GB block as a unit, creating a memory mapping pointer list of the GKF file by using a MapViewOfFile function; the number of corresponding memory mapping pointer list items of a GKF file with the size of L is rounded up (L/2GB), and the number is marked as N; the first N-1 ones are 2GB, the last ones are L- (N-1) × 2 GB; the block number of each 2GB block is a subscript of the block in a memory mapping pointer list, and the subscript is from a 0 th block to an N-1 th block, wherein the subscript is N blocks;
b3, creating a three-dimensional scene and dynamically scheduling access;
analyzing the type of the data set corresponding to the GKF three-dimensional spatial database, and if the data set is a three-dimensional model data set, executing the step B31; if the three-dimensional terrain data set is available, executing step B32; if it is the oblique photography data set, go to step B33;
b31, creating a scene of the three-dimensional model data set and dynamically scheduling access, and sequentially executing steps B311-B314;
and B311, reading the metadata of the three-dimensional model data set. Reading and decrypting in the memory according to the 0 th memory mapping pointer to obtain three metadata of data set information, a scene layer list and three-dimensional model information of the three-dimensional model data set;
b312, constructing a grid index according to the three-dimensional model information metadata, and constructing a three-dimensional model tree according to a grid index structure;
b313, traversing the three-dimensional scene tree during rendering updating, triggering a model calling request according to the visual distance, the size of the model and the configured model visible distance, establishing a model calling request priority queue, sequentially performing I/O (input/output) scheduling according to the priority queue, reading and generating a three-dimensional geometric model, putting the three-dimensional geometric model into a rendering thread in an asynchronous mode, updating the scene in the next rendering frame cycle, combining scene geometric nodes below corresponding scene tree leaf nodes, updating the model state of the scene tree leaf nodes, and completing the dynamic scheduling of the geometric model;
b314, analyzing texture loading conditions in the traversing process of the three-dimensional scene tree, dynamically triggering texture calling requests, establishing texture calling request priority queues, sequentially performing I/O (input/output) scheduling according to the priority queues, reading and generating textures, adding and updating the textures into corresponding models, and completing dynamic scheduling of the textures;
b32, creating scenes of the three-dimensional terrain data set and dynamically scheduling access, and sequentially executing steps B321-B323;
b321, reading and decrypting in the memory according to the 0 th memory mapping pointer to obtain data set information of the three-dimensional terrain data set;
b322, constructing a three-dimensional terrain tile tree of a single node according to data set information of the three-dimensional terrain data set, the name of a root tile and a three-dimensional terrain pyramid index built in the tile;
b323, during rendering updating, traversing a three-dimensional terrain tile tree of a single node, triggering a three-dimensional terrain tile calling request according to the visual distance and LOD configuration of the three-dimensional terrain tiles, establishing a priority queue of the three-dimensional terrain tile calling request, sequentially performing I/O (input/output) scheduling according to the priority queue, reading and generating the three-dimensional terrain tiles, putting the three-dimensional terrain tiles into a rendering thread in an asynchronous mode, updating a scene in the next rendering frame cycle, and combining the three-dimensional terrain tiles under leaf nodes of the corresponding three-dimensional terrain tile tree to complete dynamic scheduling of the three-dimensional terrain tiles;
b33, creating a scene of the oblique photography data set and dynamically scheduling access, and sequentially executing steps B331-B333;
b331, reading and decrypting in the memory according to the 0 th memory mapping pointer to obtain data set information and a root tile list of the oblique photography data set;
b332, constructing a tilted photography tile tree of a plurality of nodes according to the data set information of the tilted photography data set, the root tile list and a tilted photography tile pyramid index built in the tile;
b333, traversing the oblique photography tile trees of a plurality of nodes during rendering updating, triggering an oblique photography tile calling request according to factors such as visual range and LOD configuration of the oblique photography tiles, establishing a priority queue of the oblique photography tile calling request, sequentially performing I/O (input/output) scheduling according to the priority queue, reading and generating the oblique photography tiles, putting the oblique photography tiles into a rendering thread in an asynchronous mode, updating scenes in the next rendering frame cycle, and combining the oblique photography tiles under corresponding leaf nodes of the oblique photography tile trees to complete dynamic scheduling of the oblique photography tiles.
B4, reading the GKF data file, and sequentially executing the steps B41-B42;
b41, acquiring the corresponding data record according to the data name of the dynamic call request through the data name established in the step B215 and the corresponding Map of the data record;
b42, judging the Block numbers Block1 and Block2 of the 2GB blocks corresponding to the head and the tail of the data; the formula is as follows:
Block1=record.dataOffset/2GB
Block2=(record.dataOffset+record.dataLen)/2GB
if Block1 is Block2, the data is in a data Block, a memory mapping pointer corresponding to a Block1 Block number is used, a data Block with an offset (record.dataoffset &0x7FFFFFFF) and a length of record.datalen is directly read, exclusive-or decryption is performed, analysis is performed according to the data type, corresponding geometric data, texture data, three-dimensional terrain tile data or oblique photography tile data are obtained, and the geometric data, the texture data, the three-dimensional terrain tile data or the oblique photography tile data are returned;
if Block1< Block2, the data is in two data blocks, using memory mapping pointers corresponding to the Block1 Block number and the Block2 Block number, directly reading a data Block with an offset of record.dataoffset &0x7FFFFFFF at the end of the Block1 Block number and a data Block with a length of Block2 × 2GB-record.dataoffset and an offset of the beginning of the Block2 Block number of 0 and a data Block with a length of (record.dataoffset + record.datalen-Block2 × 2GB), combining the two data blocks, performing exclusive or decryption, analyzing according to the data type, obtaining corresponding geometric data, texture data, three-dimensional terrain tile data or oblique photography tile data, and returning the geometric data, the texture data, the three-dimensional terrain tile data or the oblique photography tile data;
b5, when the model attribute needs to be inquired, finding out the corresponding element by the model name, inquiring the element attribute record according to the element, accessing the GKF data file according to the element attribute record, obtaining the model attribute and returning the element attribute record.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concepts. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (2)

1. A method for creating a GKF three-dimensional spatial database is characterized by comprising the following steps:
a1, analyzing the type of the created data set, and if the data set is a three-dimensional model data set, executing the step A2; if the three-dimensional terrain data set is available, executing step A3; if it is the oblique photography data set, execute step A4;
a2, creating a GKF three-dimensional spatial database of a three-dimensional model data set type, and sequentially executing A21-A25;
a21, storing the metadata of the three-dimensional model data set in a database, and sequentially executing A211-A215;
a211, acquiring three-dimensional model data set information, wherein the three-dimensional model data set information comprises a version, a UUID, a name, an alias, a data making unit, a creation date, a metadata record number and a data record number;
a212, acquiring a scene layer list, wherein the scene layer list is a tuple list of < layer ID, parent layer ID and layer name >;
a213, obtaining three-dimensional model information, wherein the three-dimensional model information comprises a name, a central point position, a deflection and scaling value, a bounding box minimum point, a bounding box maximum point, a layer ID belonging to the bounding box and LOD data; the LOD data is a tuple list of < LOD level, minDistance, maxDenstance >;
a214, creating 32-byte GKXHeader, and writing the GKX file into the GKX file; the GKXHeader comprises 8 fields of a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, the compressed length of a GKX index file, the original length of the GKX index file and a reserved field; during creation, the GKF file identifier is filled to 0x4B4F4547, the GKF data set type is filled to GKF _ DATASET, and the value of the GKF _ DATASET is 0x 1;
a215, using an AES encryption algorithm to form three metadata records by using the 3 metadata obtained in the three steps A211-A213; the metadata record is written into a GKX file, and the encrypted data is written into a GKF file;
a22, warehousing the geometric data of the three-dimensional model, obtaining all model lists needing warehousing, and executing A221-A222 on each model;
a221, obtaining the name, rendering options, a vertex list, a vertex normal list, a first set of texture coordinates T0, a second set of texture coordinates T1 and used texture names of the model to form geometric data in a binary format, generating encrypted binary geometric data by using an XOR encryption algorithm, compressing and storing the encrypted binary geometric data by using a ZIP algorithm, and recording the original length before compression and the length after compression to form compressed and encrypted binary model data; the rendering options comprise options of whether the display is transparent or not, whether the display contains illumination textures or not, whether the display is double-sided or not, water efficiency and glass material;
a222, creating a data record corresponding to the compressed and encrypted binary model data, writing the data record into a GKX file, and sequentially writing the compressed and encrypted binary model data into a GKF file;
a23, warehousing texture data of the three-dimensional model, obtaining all texture lists needing warehousing, and executing A231-A232 on each texture;
a231, acquiring the texture binary format data, generating encrypted binary texture data by using an XOR encryption algorithm, compressing and storing by using a ZIP algorithm, and recording an original length before compression and a length after compression to form compressed and encrypted binary texture data; the texture binary format is a DDS format and supports DXT1, DXT3 and DXT 5;
a232, creating a data record corresponding to the compressed and encrypted binary texture data, writing the data record into a GKX file, and sequentially writing the compressed and encrypted binary texture data into a GKF file;
a24, storing attribute data of the three-dimensional model;
acquiring all element lists needing to be put in a warehouse, generating attribute data for each element, writing the attribute data record into a GKX file, and writing the attribute data into a GKF file;
a25, and GKX data are recorded and stored;
compressing and storing metadata records and data records in the GKX file by using a ZIP algorithm, and updating the original length before compression and the length after compression;
a3, creating a GKF three-dimensional terrain database of the three-dimensional terrain data set, and sequentially executing A31-A33;
a31, storing the metadata of the three-dimensional terrain data set; sequentially executing A311-A313:
a311, acquiring three-dimensional terrain data set information, wherein the three-dimensional terrain data set information comprises a version, a UUID, a name, an alias, a data making unit, a creation date, a metadata record number, a data record number, a root tile name, a center point position, a deflection and scaling value, a bounding box minimum point and a bounding box maximum point;
a312, creating 32-byte GKXHeader, and writing the GKX file into the GKX file; the GKXHeader comprises 8 fields of a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, the compressed length of a GKX index file, the original length of the GKX index file and a reserved field; during creation, the GKF file identifier is filled to be 0x4B4F4547, the GKF data set type is filled to be GKF _ TILESET, and the value of the GKF _ TILESET is 0x 2;
a313, encrypting the data set information of the three-dimensional terrain data set obtained in the step A311 by using an AES encryption algorithm to form a metadata record; the metadata record is written into a GKX file, and the encrypted data is written into a GKF file;
a32, storing the three-dimensional terrain tile data, acquiring all three-dimensional terrain tile lists needing to be stored, and executing A321-A322 on each three-dimensional terrain tile;
a321, obtaining the name, LOD information, elevation data and texture data of the three-dimensional terrain tile, forming three-dimensional terrain tile data in a binary format, generating encrypted binary three-dimensional terrain tile data by using an XOR encryption algorithm, compressing and storing by using a ZIP algorithm, recording the original length before compression and the length after compression, and forming compressed and encrypted binary three-dimensional terrain tile data;
a322, creating a data record corresponding to the compressed and encrypted binary three-dimensional terrain tile data, writing the data record into a GKX file, and sequentially writing the compressed and encrypted binary three-dimensional terrain tile data into a GKF file;
a33, and GKX data are recorded and stored;
compressing and storing metadata records and data records in the GKX file by using a ZIP algorithm, and recording the original length before compression and the length after compression;
a4, creating a GKF oblique photography model database of the oblique photography model data set, and sequentially executing A41-A43;
a41, storing the metadata of the oblique photography model data set, and sequentially executing A411-A414:
a411, obtaining oblique photography model data set information, wherein the oblique photography model data set information comprises a version, a UUID, a name, an alias, a data making unit, a creation date, a metadata record number, a data record number, a central point position, a deflection and scaling value, a bounding box minimum point bounding box maximum point, an acquisition time, an acquisition platform, a modeling platform, an image ground resolution, a mapping scale, a flight height, an orthographic course overlapping degree, an orthographic collateral overlapping degree, an accuracy evaluation date, an accuracy evaluation point number, an error in an accuracy evaluation X direction, an error in an accuracy evaluation Y direction, an error in an accuracy evaluation elevation, an achievement pyramid level, an X direction resolution of an achievement finest layer model and a Y direction resolution of an achievement finest layer model;
a412, obtaining a root tile name list of the oblique photography model data set;
a413, creating 32-byte GKXHeader, and writing the GKX file into the GKX file; the GKXHeader comprises 8 fields of a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, the compressed length of a GKX index file, the original length of the GKX index file and a reserved field; during creation, the GKF file identifier is filled to be 0x4B4F4547, the GKF data set type is filled to be GKF _ OBLIQUETILLE, and the value of the GKF _ OBLIQUETILLE is 0x 3;
a414, encrypting the two pieces of metadata obtained in the steps A411 to A412 by using an AES encryption algorithm to form two pieces of metadata records; writing data records into a GKX file, and writing encrypted data into a GKF file;
a42, storing oblique photography tile data, acquiring all oblique photography tile lists needing to be stored, and executing A421-A422 on each oblique photography tile;
a421, obtaining the name, LOD information, geometric data and texture data of the oblique photography tile, forming oblique photography tile data in a binary format, generating encrypted binary oblique photography tile data by using an XOR encryption algorithm, compressing and storing by using a ZIP algorithm, recording the original length before compression and the length after compression, and forming compressed and encrypted binary oblique photography tile data;
a422, creating data records corresponding to the compressed and encrypted binary oblique photography tile data, writing the data records into a GKX file, and sequentially writing the compressed and encrypted binary oblique photography tile data into a GKF file;
a43, and GKX data are recorded and stored;
and compressing and storing the metadata records and the data records in the GKX file by using a ZIP algorithm, and recording the original length before compression and the length after compression.
2. A GKF three-dimensional spatial database access method is characterized by comprising the following steps:
b1, reading the GKX data record file, and executing B211-B215 in sequence;
b211, opening a corresponding GKX data record file stream, and reading a GKXHeader structure, wherein the GKXHeader structure is 32 bytes and comprises 8 fields including a GKF file identifier, a GKF version, a GKF data set type, a GKF metadata record number, a GKF data record number, a compressed length of a GKX index file, an original length of a GKX index file and a reserved field;
b212, reading and decompressing the metadata record and the data record by using a ZIP algorithm, and storing the metadata record and the data record into a BUFFER;
b213, closing the GKX data recording file stream;
b214, reading the metadata record in the BUFFER;
b215, reading the data record in the BUFFER, and establishing a data name and a corresponding Map of the data record;
b2, creating a memory mapping environment of the GKF file, and sequentially executing the steps B221-B224;
b221, creating a handle of the GKF file in a read-only mode by using a createFile function;
b222, acquiring the size of the GKF file by using a GetFileSizeEx function;
b223, creating a memory mapping handle of the GKF file by using a CreateFileMapping function;
b224, with a 2GB block as a unit, creating a memory mapping pointer list of the GKF file by using a MapViewOfFile function; the number of corresponding memory mapping pointer list items is L/2GB, and the number is marked as N; the first N-1 ones are 2GB, the last ones are L- (N-1) × 2 GB; the block number of each 2GB block is a subscript of the block in a memory mapping pointer list, and the subscript is from a 0 th block to an N-1 th block, wherein the subscript is N blocks;
b3, creating a three-dimensional scene and dynamically scheduling access;
analyzing the type of the data set corresponding to the GKF three-dimensional spatial database, and if the data set is a three-dimensional model data set, executing the step B31; if the three-dimensional terrain data set is available, executing step B32; if it is the oblique photography data set, go to step B33;
b31, creating a scene of the three-dimensional model data set and dynamically scheduling access, and sequentially executing steps B311-B314;
b311, reading metadata of the three-dimensional model data set, reading and decrypting the metadata in the memory according to the 0 th memory mapping pointer, and obtaining three pieces of metadata of data set information, a scene layer list and three pieces of three-dimensional model information of the three-dimensional model data set;
b312, constructing a grid index according to the three-dimensional model information metadata, and constructing a three-dimensional model tree according to a grid index structure;
b313, traversing the three-dimensional scene tree during rendering updating, triggering a model calling request according to the visual distance, the size of the model and the configured model visible distance, establishing a model calling request priority queue, sequentially performing I/O (input/output) scheduling according to the priority queue, reading and generating a three-dimensional geometric model, putting the three-dimensional geometric model into a rendering thread in an asynchronous mode, updating the scene in the next rendering frame cycle, combining scene geometric nodes below corresponding scene tree leaf nodes, updating the model state of the scene tree leaf nodes, and completing the dynamic scheduling of the geometric model;
b314, analyzing texture loading conditions in the traversing process of the three-dimensional scene tree, dynamically triggering texture calling requests, establishing texture calling request priority queues, sequentially performing I/O (input/output) scheduling according to the priority queues, reading and generating textures, adding and updating the textures into corresponding models, and completing dynamic scheduling of the textures;
b32, creating scenes of the three-dimensional terrain data set and dynamically scheduling access, and sequentially executing steps B321-B323;
b321, reading and decrypting in the memory according to the 0 th memory mapping pointer to obtain data set information of the three-dimensional terrain data set;
b322, constructing a three-dimensional terrain tile tree of a single node according to data set information of the three-dimensional terrain data set, the name of a root tile and a three-dimensional terrain pyramid index built in the tile;
b323, during rendering updating, traversing a three-dimensional terrain tile tree of a single node, triggering a three-dimensional terrain tile calling request according to the visual distance and LOD configuration of the three-dimensional terrain tiles, establishing a priority queue of the three-dimensional terrain tile calling request, sequentially performing I/O (input/output) scheduling according to the priority queue, reading and generating the three-dimensional terrain tiles, putting the three-dimensional terrain tiles into a rendering thread in an asynchronous mode, updating a scene in the next rendering frame cycle, and combining the three-dimensional terrain tiles under leaf nodes of the corresponding three-dimensional terrain tile tree to complete dynamic scheduling of the three-dimensional terrain tiles;
b33, creating a scene of the oblique photography data set and dynamically scheduling access, and sequentially executing steps B331-B333;
b331, reading and decrypting in the memory according to the 0 th memory mapping pointer to obtain data set information and a root tile list of the oblique photography data set;
b332, constructing a tilted photography tile tree of a plurality of nodes according to the data set information of the tilted photography data set, the root tile list and a tilted photography tile pyramid index built in the tile;
b333, traversing the oblique photography tile trees of a plurality of nodes during rendering updating, triggering an oblique photography tile calling request according to visual range and LOD configuration factors of the oblique photography tiles, establishing a priority queue of the oblique photography tile calling request, sequentially performing I/O (input/output) scheduling according to the priority queue, reading and generating the oblique photography tiles, putting the oblique photography tiles into a rendering thread in an asynchronous mode, updating a scene in the next rendering frame cycle, and combining the oblique photography tiles under corresponding leaf nodes of the oblique photography tile trees to complete dynamic scheduling of the oblique photography tiles;
b4, reading the GKF data file, and sequentially executing the steps B41-B42;
b41, acquiring the corresponding data record according to the data name of the dynamic call request through the data name established in the step B215 and the corresponding Map of the data record;
b42, judging the Block numbers Block1 and Block2 of the 2GB blocks corresponding to the head and the tail of the data; the formula is as follows:
Block1=record.dataOffset/2GB
Block2=(record.dataOffset+record.dataLen)/2GB
if Block1 is Block2, the data is in a data Block, a memory mapping pointer corresponding to a Block1 Block number is used, a data Block with an offset of record.dataoffset &0x7FFFFFFF and a length of record.datalen is directly read, exclusive or decryption is performed, analysis is performed according to the data type, corresponding geometric data, texture data, three-dimensional terrain tile data or oblique photography tile data are obtained, and the geometric data, the texture data, the three-dimensional terrain tile data or the oblique photography tile data are returned;
if Block1< Block2, the data is in two data blocks, using memory mapping pointers corresponding to Block1 Block numbers and Block2 Block numbers, directly reading data blocks with offset of the tail of Block1 Block numbers being record.dataoffset &0x7FFFFFFF, data blocks with length of Block2 × 2GB-record.dataoffset and data blocks with length of the head of Block2 Block numbers being 0, data blocks with length of record.dataoffset + record.datalen-Block2 × 2GB, combining the front and rear data blocks, performing exclusive or decryption and analyzing according to data types to obtain corresponding geometric data, texture data, three-dimensional terrain tile data or oblique photography tile data, and returning the geometric data, the texture data, the three-dimensional terrain tile data or oblique photography tile data;
b5, when the model attribute needs to be inquired, finding out the corresponding element by the model name, inquiring the element attribute record according to the element, accessing the GKF data file according to the element attribute record, obtaining the model attribute and returning the element attribute record.
CN201710437841.2A 2017-06-12 2017-06-12 Method for creating and accessing GKF three-dimensional spatial database Active CN107402958B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710437841.2A CN107402958B (en) 2017-06-12 2017-06-12 Method for creating and accessing GKF three-dimensional spatial database

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710437841.2A CN107402958B (en) 2017-06-12 2017-06-12 Method for creating and accessing GKF three-dimensional spatial database

Publications (2)

Publication Number Publication Date
CN107402958A CN107402958A (en) 2017-11-28
CN107402958B true CN107402958B (en) 2020-09-15

Family

ID=60405223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710437841.2A Active CN107402958B (en) 2017-06-12 2017-06-12 Method for creating and accessing GKF three-dimensional spatial database

Country Status (1)

Country Link
CN (1) CN107402958B (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446492A (en) * 2018-03-20 2018-08-24 深圳市建设综合勘察设计院有限公司 BIM is calculated in the method for different software Internal conversion, reservoir and terminal
CN108769228A (en) * 2018-06-05 2018-11-06 北京知道创宇信息技术有限公司 3D scenario buildings method and device
CN109189725B (en) * 2018-07-23 2020-09-18 广州都市圈网络科技有限公司 Regular building oriented OBJ file lossless compression method
CN109299548B (en) * 2018-09-28 2023-09-01 中航安贞(浙江)信息科技有限公司 Network-oriented building information model data publishing and visualizing method
CN109783465B (en) * 2018-12-25 2023-09-08 吉林动画学院 Mass three-dimensional model integration system under cloud computing framework
CN110321443B (en) * 2019-06-27 2021-08-10 埃洛克航空科技(北京)有限公司 Three-dimensional live-action model database construction method and device and data service system
CN110634184B (en) * 2019-09-11 2023-01-17 西安恒歌数码科技有限责任公司 Loading method of mass oblique photography data
CN110706341B (en) * 2019-09-17 2021-03-30 广州市城市规划勘测设计研究院 High-performance rendering method and device of city information model and storage medium
CN110618993B (en) * 2019-09-17 2022-07-08 金蝶软件(中国)有限公司 Data organization structure, data acquisition method, device and readable storage medium
CN111080760B (en) * 2019-12-19 2023-09-22 北京飞渡科技有限公司 Oblique photogrammetry data optimization method and system
CN111159326B (en) * 2020-01-02 2023-05-09 中国航空工业集团公司西安航空计算技术研究所 Airborne digital map local data increment updating method and device
CN110969691B (en) * 2020-02-28 2020-06-23 中科星图股份有限公司 WebGL-based photographic data scheduling method and system
CN111325848B (en) * 2020-03-02 2022-04-15 中国电建集团昆明勘测设计研究院有限公司 Automatic batch deletion method for suspended matters of OSGB inclined model
CN111583404B (en) * 2020-05-08 2021-08-31 广西壮族自治区自然资源遥感院 Massive oblique photography three-dimensional model data scheduling method and system
CN111815495B (en) * 2020-06-09 2022-02-22 广东国地规划科技股份有限公司 CIM platform decision method, system, equipment and storage medium based on mixed reality
CN112364118B (en) * 2020-11-25 2021-06-22 北京京航计算通讯研究所 System and method for treating urban sewage surrounding environment model
CN114168530A (en) * 2021-12-10 2022-03-11 深圳市毕美科技有限公司 Three-dimensional data storage method, device, equipment and storage medium
CN115409906B (en) * 2022-11-02 2023-03-24 中国测绘科学研究院 Large-scale oblique photography model lightweight method and device
CN117522949A (en) * 2023-12-20 2024-02-06 深圳市奇航疆域技术有限公司 Method and system for carrying out height monitoring on three-dimensional model based on osgb data

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101872446A (en) * 2010-06-09 2010-10-27 中国科学院深圳先进技术研究院 Fire fighting emergence treating method based on three-dimensional digital city
CN103927781A (en) * 2014-05-06 2014-07-16 苏州中科图新网络科技有限公司 Vision correlation model progressive rendering method on three-dimensional scene
CN105205135A (en) * 2015-09-15 2015-12-30 天津大学 3D (three-dimensional) model retrieving method based on topic model and retrieving device thereof
WO2016088553A1 (en) * 2014-12-01 2016-06-09 株式会社日立製作所 3d model creation assistance system and method
CN105718480A (en) * 2014-12-05 2016-06-29 星际空间(天津)科技发展有限公司 Method for scheduling massive three-dimensional data on basis of geographic information
CN105957149A (en) * 2016-05-31 2016-09-21 浙江科澜信息技术有限公司 Urban three-dimensional model data preprocessing method suitable for high-efficiency rendering
CN106126529A (en) * 2016-06-14 2016-11-16 东南大学 A kind of three-dimensional space data storage method of Embedded
CN106683198A (en) * 2015-11-10 2017-05-17 星际空间(天津)科技发展有限公司 3D automatic modeling and scheduling rendering method for integrated pipe network

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101872446A (en) * 2010-06-09 2010-10-27 中国科学院深圳先进技术研究院 Fire fighting emergence treating method based on three-dimensional digital city
CN103927781A (en) * 2014-05-06 2014-07-16 苏州中科图新网络科技有限公司 Vision correlation model progressive rendering method on three-dimensional scene
WO2016088553A1 (en) * 2014-12-01 2016-06-09 株式会社日立製作所 3d model creation assistance system and method
CN105718480A (en) * 2014-12-05 2016-06-29 星际空间(天津)科技发展有限公司 Method for scheduling massive three-dimensional data on basis of geographic information
CN105205135A (en) * 2015-09-15 2015-12-30 天津大学 3D (three-dimensional) model retrieving method based on topic model and retrieving device thereof
CN106683198A (en) * 2015-11-10 2017-05-17 星际空间(天津)科技发展有限公司 3D automatic modeling and scheduling rendering method for integrated pipe network
CN105957149A (en) * 2016-05-31 2016-09-21 浙江科澜信息技术有限公司 Urban three-dimensional model data preprocessing method suitable for high-efficiency rendering
CN106126529A (en) * 2016-06-14 2016-11-16 东南大学 A kind of three-dimensional space data storage method of Embedded

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
三维城市模型数据划分及分布式存储方法;李朝奎 等;《地球信息科学》;20151231;第17卷(第12期);全文 *
基于 MongoDB 的海量空间数据存储和并行;张恩 等;《地理空间信息》;20140228;第12卷(第1期);全文 *
海量三维数据高效组织及集成研究;陈良超 等;《重庆工程师论文集》;20140531;全文 *
面向规划管理的重庆都市区三维模型数据库建设;王昌翰;《测绘通报》;20141231(第2期);全文 *

Also Published As

Publication number Publication date
CN107402958A (en) 2017-11-28

Similar Documents

Publication Publication Date Title
CN107402958B (en) Method for creating and accessing GKF three-dimensional spatial database
US20230084389A1 (en) System and method for providing bottom-up aggregation in a multidimensional database environment
US20200272613A1 (en) Database table format conversion based on user data access patterns in a networked computing environment
Lv et al. BIM big data storage in WebVRGIS
Van Oosterom et al. Massive point cloud data management: Design, implementation and execution of a point cloud benchmark
US20190079959A1 (en) System and method for slowing changing dimension and metadata versioning in a multidimensional database environment
CN105701104B (en) Three-dimensional data engine system based on geographic information
CN111427847B (en) Indexing and querying method and system for user-defined metadata
JPH10505440A (en) Programming language-computer-based information access method and apparatus enabling SQL-based manipulation of concrete data files
CN106682110B (en) Image file storage and management system and method based on Hash grid index
CN103902623A (en) Method and system for accessing files on a storage system
CN103902698A (en) Data storage system and data storage method
CN104008209B (en) Reading-writing method for MongoDB cluster geographic data stored with GeoJSON format structuring method
CN105095247A (en) Symbolic data analysis method and system
CN104021210B (en) Geographic data reading and writing method of MongoDB cluster of geographic data stored in GeoJSON-format semi-structured mode
CN101520801A (en) Method for storing space geometric objects to database
Chang et al. T2: A customizable parallel database for multi-dimensional data
Boehm et al. NoSQL for storage and retrieval of large LiDAR data collections
Zhong et al. A novel method to manage very large raster data on distributed key-value storage system
US10409799B2 (en) Supporting updatable repeated values over variable schema
CN108920684B (en) Scientific and technological resource space data editing method and system
Ferreira et al. An efficient external memory algorithm for terrain viewshed computation
CN113886505B (en) Management system for realizing dynamic modeling based on search engine and relational database
Werner et al. AtlasHDF: an efficient big data framework for GeoAI
Grabczewski et al. 3D MURALE: multimedia database system architecture

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240306

Address after: 401120 No. 6, Qingzhu East Road, Dazhulin, Yubei District, Chongqing

Patentee after: Chongqing Institute of Surveying and Mapping Science and Technology (Chongqing Map Compilation Center)

Country or region after: China

Address before: 400020 Jiangbei District, Chongqing electric measuring Village No. 231

Patentee before: CHONGQING SURVEY INSTITUTE

Country or region before: China

TR01 Transfer of patent right