Vector environment model conversion, analysis and dynamic loading method based on highway engineering BIM + GIS system

By converting vector data in the BIM+GIS system into GeoJSON format and dynamically creating the best-performance rendering object, the problems of inconsistent data format, long loading time and low parsing efficiency are solved, and efficient vector data rendering and performance improvement are achieved.

CN119513951APending Publication Date: 2025-02-25CCCC SECOND HIGHWAY CONSULTANTS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411258641.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The data format of vector environment models in the existing BIM+GIS system is inconsistent, the loading time is too long, the parsing efficiency is low, and the rendering effect is single.

Method used

By importing the original vector data file into GIS software, converting it into a shp file, and then converting the shp file into a GeoJSON file using the GDAL open source library. Then, the GeoJSON file is uploaded through the front-end call to the web service, the server analyzes and feedbacks geometric type and quantity information, and the front-end dynamically creates the best-performance rendering object for rendering.

Benefits of technology

It realizes the unification of vector data formats, reduces loading time and parsing efficiency, improves rendering effect and performance, and is suitable for point, line and surface vector data of different data volumes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513951A_ABST
    Figure CN119513951A_ABST
Patent Text Reader

Abstract

The invention discloses a vector environment model conversion, analysis and dynamic loading method based on a road engineering BIM + GIS system. The method comprises the following steps: converting an original vector data file into an shp file through GIS software; the shp file is converted into a GeoJSON file through a GDAL open source library; a web service is called through the front end, a GeoJSON file is uploaded to a web server, and a server side analyzes the geometric characteristics of the GeoJSON file after receiving the GeoJSON file and sends an analysis result back to the front end; the front end classifies the vector data according to a GeoJSON file analysis result, sets attribute information of the vector data according to categories, and submits the attribute information to the server side for storage; vector data information is obtained on the basis of a WebGL platform, rendering of different effects on point, line, surface, multi-segment line and multi-surface vector data is achieved according to the type and attribute of the vector data, and the obtaining and loading efficiency of different types of vector data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of visualization of vector environment models in a BIM+GIS system, and in particular to a method for converting, parsing and dynamically loading vector environment models based on a highway engineering BIM+GIS system. Background Art

[0002] The highway engineering BIM+GIS application platform combines building information modeling and geographic information system technology. By creating a virtual three-dimensional model combined with geographic information, it integrates information from all aspects of design, construction and operation, and provides a comprehensive solution for highway design, construction, operation and maintenance. In the design and construction process of highway engineering, it is necessary to fully consider the impact on the surrounding environment, land planning, geology, environmental protection and other factors. The environmental model of the BIM+GIS platform combines relevant data such as terrain models, building models, water system models, vegetation models, and geological models with engineering models to comprehensively evaluate the impact of environmental factors in highway engineering construction. In the environmental model, vector data represents red lines, statutory plans, geology, nature reserves, water systems, administrative divisions, land planning, and farmland protection in the form of points, lines, and surfaces. These data are combined with engineering design to provide designers with a more comprehensive reference and design basis. Common vector data formats include GeoJSON, kml, czml and other formats. The current mainstream BIM+GIS platform is a B / S architecture. These data are loaded and visualized in the browser through the front-end system. Due to the cross-platform and compatibility of the browser, its performance is limited. In practical applications, vector data with too much volume often causes problems such as long front-end loading time and browser crashes. Excessive data formats also increase the complexity of the data conversion process.

[0003] Vector data has diverse requirements in BIM applications. The original vector files of point, line and surface rendering effects only define the shape of the vector. However, in different usage scenarios, the rendering effects of point, line and surface vector data are not only the display of the shape, but also need to set the effect, such as the color and size of the point, the width, line shape and color of the line, whether the surface is filled or stroked, etc. How to set, edit and save these rendering effects, how to obtain rendering properties when loading vector data, and rendering performance are all issues that the BIM+GIS application platform should consider. Summary of the invention

[0004] In view of the defects and shortcomings of the prior art, the purpose of the present invention is to provide a method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system, so as to solve the problems of inconsistent vector environment model data format, long loading time, low parsing efficiency, single rendering effect, etc.

[0005] In order to achieve the above object, the present invention adopts the following technical measures:

[0006] A method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system comprises the following steps:

[0007] S1. Import the original vector data file into the GIS software. If the coordinate system is a standard coordinate system, import it directly. If the coordinate system is a custom coordinate system, create a reference plane and an ellipsoid. The ellipsoid calculates the minor axis radius and flattening according to the major axis radius and inverse flattening in the coordinate system file. After the creation is completed, re-import the coordinate system file and export the original vector data file to a shp file for saving;

[0008] S2. Convert the shp file to GeoJSON file through the GDAL open source library. You need to load the gdal open source library in the development environment and initialize it. After opening and reading the shp file, load the GeoJSON driver, traverse each layer in the shp file to obtain feature information, and then traverse each feature information in the layer to obtain geometric data. After performing coordinate conversion on the geometric data, create a new layer and write the geometric features after coordinate conversion. After all layers are traversed, export them to GeoJSON files.

[0009] S3, the front-end calls the web service and uploads the GeoJSON file to the web server. After receiving the GeoJSON file, the server interface starts to analyze it, and obtains its geometry type by analyzing the structure of the GeoJSON file. It also calculates the geometry quantity and point quantity based on different geometry types, and feeds this information back to the front-end.

[0010] S4. The front end classifies the vector data according to the results of GeoJSON file parsing, sets the attribute information of the vector data by category, and submits it to the server for storage. The specific steps include:

[0011] S41. If the geometry type is point, dynamically generate: pixel size, point color, display, text annotation and other attribute setting interfaces;

[0012] S42. If the geometry type is line, dynamically generate: line width, line shape, color, ground contact, layer order, visible distance, monomerization, text annotation and other attribute setting interfaces;

[0013] S43. If the geometry type is a surface, dynamically generate: fill material, color, visible distance, stroke, ground contact, monomerization, text annotation and other attribute setting interfaces;

[0014] S44, after the user sets the above attributes, clicks the Save button to upload the GeoJSON file to the Web server and saves it. After the server API receives the vector data information such as the category, geometry number, point number, and attributes of the vector data, it saves it in the database, where the vector attribute field is in JSON format;

[0015] S5. When rendering vector data, the WebGL-based front-end platform downloads the corresponding GeoJSON file from the Web server and obtains the vector data information. According to the geometric type, geometric quantity and point quantity of the vector data, it dynamically creates a rendering object with the best performance. The specific steps include:

[0016] S51. If the geometry type is point and the number of points is less than 1,000, dynamically create a PointEntity object;

[0017] S52. If the geometry type is point and the number of points is less than 100,000, dynamically create a PointPrimitive object;

[0018] S53, if the geometry type is point and the number of points is greater than 100,000, dynamically create a PointCombine object;

[0019] S54. If the geometry type is line and the number of geometries is less than 1 thousand, dynamically create a PolylineEntity object;

[0020] S55. If the geometry type is line and the number of geometries is less than 100,000, dynamically create a PolylinePrimitive object;

[0021] S56. If the geometry type is line and the number of geometries is greater than 100,000, dynamically create a PolylineCombine object;

[0022] S57. If the geometry type is face and the number of geometries is less than 1 thousand, dynamically create a PolygonEntity object;

[0023] S58. If the geometry type is face and the number of geometries is less than 100,000, dynamically create a PolygonPrimitive object;

[0024] S59. If the geometry type is face and the number of geometries is greater than 100,000, dynamically create a PolygonCombine object;

[0025] After dynamically creating the rendering object, the user preset effect is rendered according to the vector attribute information.

[0026] Compared with the prior art, the advantages and beneficial effects of the present invention are:

[0027] 1. Unify the format of vector files of the highway engineering BIM+GIS application platform. The current mainstream vector data formats include GeoJSON, kml, czml, etc. The parsing rules of each format are different. Unifying the BIM platform vector file format into GeoJSON and using unified rules for parsing and loading will help reduce the complexity of software design.

[0028] 2. Add vector data analysis function to analyze vector data feature information. Through the geometric type information of vector data, dynamically load the vector attribute setting menu to facilitate users to set the rendering effect. In the highway engineering BIM+GIS application platform based on Cesium, the rendering of point, line and surface vector data of different data volumes is realized through Combine, Primitive and Entity objects. In terms of performance limit, Combine>Primitive>Entity. The data volume limit supported by Entity object is within 1,000, the data volume limit supported by Primitive object is within 10,000, and the data volume limit supported by Combine object is within hundreds of thousands. In actual application, if a rendering object that does not meet the performance limit is used, for example, the data volume of a certain vector data is hundreds of thousands, and it is rendered with Entity object, it will have a great impact on performance. By analyzing the vector data, the geometric quantity and point quantity of the vector data are calculated, which is used as the condition for creating a vector rendering object. Using a rendering object that matches its performance to render vector data will effectively improve the efficiency of the highway engineering BIM+GIS application platform.

[0029] 3. The feature information and rendering attribute information of vector data are stored in the database. Users can set them once and use them repeatedly, which improves work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0031] Figure 1 A flowchart of a method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system provided by the present invention;

[0032] Figure 2 Analyze the structural characteristics of GeoJSON;

[0033] Figure 3 Provides interface for setting attributes of point vector data and rendering effect diagram;

[0034] Figure 4Provides interface for setting attributes of line vector data and rendering effect diagram;

[0035] Figure 5 Provides the interface for setting attributes of surface vector data and rendering effects. DETAILED DESCRIPTION

[0036] The outstanding features of the present invention are further illustrated by the following examples, which are intended only to illustrate the present invention but not to limit the present invention.

[0037] Depend on Figure 1 As shown, the present invention provides a method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system. The method mainly undergoes the following steps during implementation:

[0038] Import the dwg format vector data file into the Global Mapper software, select "Load File" in the projection interface to load the prj coordinate system file. If the loading fails, it means that a custom ellipsoid is used in the coordinate system file. At this time, you need to create a datum and an ellipsoid. After the creation is completed, the coordinate system file can be loaded. Select Projection in the configuration menu of the Global Mapper software, Add Datum, enter the datum name and select Add Ellipsoid, enter the ellipsoid name, open the prj file, find the SPHEROID field, for example: SPHEROID ["Name", Major Semi-Axis, Inverse Flattening], the major semi-axis of the ellipsoid = major semi-axis, flattening = 1 ÷ inverse flattening, minor semi-axis = major semi-axis - major semi-axis × flattening, click "OK" after entering this information, re-select the name of the datum just created in the projection interface, and then re-select "Load File" to load the prj coordinate system file.

[0039] Select "File", "Export", "Export Vector / Radar Format", select "Shapefile", select "Export Points" or "Export Lines" or "Export Areas", and export the dwg format vector data into shp files of points, lines, and surfaces.

[0040] To convert the shp file to GeoJSON file through the GDAL open source library, you need to download the GDAL library that matches the Microsoft Visual Studio version on the GDAL official website. The processing flow in the code includes:

[0041] The first step is to register and initialize the GDAL and OSR libraries, set the supported Chinese paths and file encoding formats, and read the specified shp file;

[0042] The second step is to load the GeoJSON driver, obtain the layer information from the opened shp file data source, traverse each layer, obtain the spatial reference information of the layer, and create a spatial coordinate conversion object according to the target spatial reference;

[0043] The third step is to obtain the feature information of each layer, traverse each feature, obtain the Geometry information, and use the spatial coordinate conversion object to convert the coordinates of each Geometry. If the target coordinate system is wgs84, swap the XY coordinates. Since the vector data is displayed in a three-dimensional platform and has elevation information, the coordinate system needs to be set to 3D, that is, XYZ;

[0044] The fourth step is to obtain the feature's geometry type information, create a GeoJSON layer object through the GeoJSON driver object with the layer name, spatial coordinate conversion object, and feature geometry type information, obtain field information through the layer object, write the layer field information in the GeoJSON layer object, and finally write the feature information into the GeoJSON layer object. Repeat the above steps to traverse each layer, and finally convert the specified shp file into a GeoJSON format file.

[0045] The front-end calls the web service and uploads the GeoJSON file to the web server. After receiving the GeoJSON file, the server starts to analyze it. The GeoJSON file structure is as follows: Figure 2 As shown, there are six geometry types: point, line, surface, multi-point, multi-line, and multi-surface. Multi-point is a combination of multiple points, multi-line is a combination of multiple lines, and multi-surface is a combination of multiple surfaces. After receiving the uploaded GeoJSON file, the server API interface reads the byte stream in UTF8 encoding, parses the byte stream through the Newtonsoft library, and then parses the features field to obtain feature information, traverses each parsed feature field, parses the geometry type geometry type and the geometry coordinates set geometry coordinates field, and calculates the GeoJSON geometry quantity and point quantity information based on the geometry type and geometry coordinate set. The specific methods include:

[0046] If the feature's geometry type is point, then the number of geometries = the number of geometries + 1, and the number of points = the number of points + 1;

[0047] If the geometry type of the feature is multipoint, then the number of geometries = the number of geometries + the length of the geometry coordinate set, and the number of points = the number of points + the length of the geometry coordinate set;

[0048] If the geometry type of the feature is line, then the number of geometries = the number of geometries + 1, and the number of points = the number of points + the length of the geometry coordinate set;

[0049] If the geometry type of the feature is multiline or polygon, the number of geometries = the number of geometries + the length of the geometry coordinate set, and the number of points = the number of points + the sum of the lengths of all coordinate geometry coordinate sets in the geometry coordinate set;

[0050] If the geometry type of the feature is multiple polygons, the number of geometries = the number of geometries + the length of the geometry coordinate set, and the number of points = the number of points + the sum of the lengths of all coordinate sets in all groups in the geometry coordinate set. After calculating this information, the server returns it to the front end through the response body.

[0051] The front end classifies the vector data according to the results of GeoJSON file parsing, sets the attribute information of the vector data by category, and submits it to the server for storage. The specific steps include:

[0052] like Figure 3 As shown in the figure, the point marked is only used to indicate the coordinate point of the place name. In general, the point itself is configured not to be displayed, but the place name information is displayed in the form of text annotation. Of course, the point can also be configured to be displayed. If the geometry type is point, the following attribute setting interfaces are dynamically generated: pixel size, point color, display, text annotation, etc.

[0053] like Figure 4 As shown, if the geometry type is line, the following attribute setting interfaces are dynamically generated: line width, line shape, color, ground contact, layer order, visible distance, monomerization, text annotation, etc.

[0054] like Figure 5 As shown, if the geometry type is a surface, dynamically generate: fill material, color, visible distance, stroke, ground, monomer, text annotation and other attribute setting interfaces;

[0055] After setting the above properties, the user clicks the Save button to upload the GeoJSON file to the web server and save it. After the server API receives the vector data category, geometry number, point number, and attributes, it saves it in the database, where the vector attribute field is in JSON format.

[0056] When rendering vector data, the WebGL-based front-end platform downloads the corresponding GeoJSON file from the Web server and obtains the vector data information. As shown in Table 1, the rendering object has different performances depending on the amount of data. In order to improve the performance of the highway engineering BIM+GIS application platform, the following strategies are adopted to dynamically create rendering objects:

[0057] When the number of geometric elements in vector data is less than 1,000, the front end of the highway engineering BIM+GIS application platform uses Entity objects for rendering;

[0058] When the number of geometric elements in vector data is less than 100,000, the front end of the highway engineering BIM+GIS application platform uses Primitive objects for rendering;

[0059] When the number of geometric elements in vector data is greater than 100,000, the front end of the highway engineering BIM+GIS application platform uses CombinePrimitive objects for rendering.

[0060] Table 1 Comparison of characteristics of vector data objects

[0061]

[0062]

[0063] The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described in the present invention. Although the present invention has been described in detail with reference to the above embodiments, the present invention is not limited to the above specific implementation methods. Therefore, any modification or equivalent replacement of the present invention; and all technical solutions and improvements thereof that do not depart from the spirit and scope of the invention are included in the scope of the claims of the present invention.

Claims

1. A method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system, characterized in that: The following steps are involved: S1. Convert the original vector data file into a shp file through GIS software; S2. Convert the shp file to GeoJSON file through the GDAL open source library; S3, calling the web service through the front end, uploading the GeoJSON file to the web server. After receiving the GeoJSON file, the server parses its geometric features and sends the parsed results back to the front end; S4. The front end classifies the vector data according to the results of GeoJSON file parsing, sets the attribute information of the vector data by category, and submits it to the server for storage; S5. The WebGL-based front-end platform obtains vector data information, and dynamically creates a rendering object with the best performance according to the geometric type, geometric quantity and point quantity of the vector data. After dynamically creating the rendering object, it renders the user-preset effect according to the vector attribute information.

2. The method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system according to claim 1 is characterized in that: In step S1, the original vector data file is imported into the GIS software. If the coordinate system is a standard coordinate system, it is directly imported; if the coordinate system is a custom coordinate system, a reference plane and an ellipsoid are created. The minor axis radius and the flattening of the ellipsoid are calculated according to the major axis radius and the inverse flattening in the coordinate system file. After the creation is completed, the coordinate system file is re-imported, and the original vector data file is exported as a shp file for storage.

3. The method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system according to claim 1 is characterized in that: In step S2, the shp file is converted into a GeoJSON file through the GDAL open source library. It is necessary to load the gdal open source library in the development environment and initialize it. After opening and reading the shp file, the GeoJSON driver is loaded, each layer in the shp file is traversed to obtain feature information, and then each feature information in the layer is traversed to obtain geometric data. After the coordinates of the geometric data are converted, a new layer is created and the geometric features after the coordinate conversion are written. When all layers are traversed, they are exported as GeoJSON files.

4. The method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system according to claim 1 is characterized in that: In step S3, the number of geometries and the number of points are calculated according to different geometry types, and the geometry types include points, lines, surfaces, multiple points, multiple lines, and multiple surfaces.

5. The method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system according to claim 1 is characterized in that: The step S4 further comprises: S41. If the geometry type is point, dynamically generate: pixel size, point color, display or not, text annotation attribute setting interface; S42. If the geometry type is line, dynamically generate: line width, line shape, color, ground contact, layer order, visible distance, monomerization, text annotation attribute setting interface; S43. If the geometry type is a surface, dynamically generate: fill material, color, visible distance, stroke, ground contact, monomerization, text annotation attribute setting interface; S44. After the user sets the above properties, click the Save button to upload the GeoJSON file to the web server and save it. After the server API receives the category, geometry number, point number and attribute vector data information of the vector data, it saves it in the database, where the vector attribute field is in json format.

6. The method for converting, parsing and dynamically loading a vector environment model based on a highway engineering BIM+GIS system according to claim 1 is characterized in that: The step S5 further comprises: S51. If the geometry type is point and the number of points is less than 1,000, dynamically create a PointEntity object; S52. If the geometry type is point and the number of points is less than 100,000, dynamically create a PointPrimitive object; S53, if the geometry type is point and the number of points is greater than 100,000, dynamically create a PointCombine object; S54. If the geometry type is line and the number of geometries is less than 1 thousand, dynamically create a PolylineEntity object; S55. If the geometry type is line and the number of geometries is less than 100,000, dynamically create a PolylinePrimitive object; S56. If the geometry type is line and the number of geometries is greater than 100,000, dynamically create a PolylineCombine object; S57. If the geometry type is face and the number of geometries is less than 1 thousand, dynamically create a PolygonEntity object; S58. If the geometry type is face and the number of geometries is less than 100,000, dynamically create a PolygonPrimitive object; S59. If the geometry type is face and the number of geometries is greater than 100,000, dynamically create a PolygonCombine object.