RESEARCH AND IMPLEMENTATION OF 3D CITY BATCH RAPID MODELLING METHOD

For the current 3D city modelling, the use of computer programs for batch modelling of non-fine models can only ensure the building height information, and cannot effectively use the attribute information of 2D data; and the manual modelling method for the road ancillary facilities has the disadvantages of modelling and placement of streetlamps, low efficiency, and inaccurate positions, a 3D modelling method based on parametric modelling technology and 3DMax modelling technology to realize batch modelling of non-fine buildings and urban streetlamps was proposed. Firstly, the spatial and attribute information of two-dimensional surveying data is used as basic data; then, through the geometric functions provided by CityEngine, combined with the characteristics of the main building and roof structure of the village in the city, the functions of generating the building structure is constructed, and the batch-based automatic modelling is compiled. The program uses the bottom attribute information to control the structure and texture of the model. . The external model was introduced through geometric function, use the attribute information and the adjacent angle of the road centerline to control the style, size and direction of the streetlamp, realize the batch automatic construction at the streetlamp coordinate point. Finally, the Python language bulk export model plug-in and a MaxScript script bulk import model plugin are compiled to improve work efficiency and model compatibility. Through experiments and performance analysis, it is shown that the method can guarantee the rapid establishment of 3D models of buildings and streetlamps, and the structure and texture are vivid. It is well compatible with 3DMax and can be directly modified and format converted. * Corresponding author


INTRODUCTION
Three-dimensional (3D) GIS breaks through the monotonous performance of two-dimensional spatial information and provides more effective decision support for all walks of life (Zhu, 2014). The three-dimensional modelling constructs a three-dimensional model based on the three-dimensional spatial information of the research object, and uses a related modelling software or a programming language to generate a threedimensional graphic display of the model (Bi et al., 2015). In the construction of digital 3D cities, many excellent GIS software companies have provided various solutions based on 3D management systems to better provide customers with assistance in decision making; they have also successively launched their own 3D software, 3D platforms such as SuperMap, Skyline or CityMaker; 3D modelling software such as AutoCAD, 3DMax, SketchUp or CityEngine. There are still a lot of 3D data modelling using 3DMax software (Lou et al., 2013;Tan et al., 2015), and then converting the 3D scene into a corresponding format to import different 3D platforms. With the development of urbanization, there is a widespread phenomenon of "having a village in the city and a city in the village". Due to the characteristics of simple structure, high similarity, and heavy work load, the modelling structure of village building in the city is very simple. Therefore, an efficient computer program modelling method has been proposed for non-detailed models in order to compensate for the lack of a large number of interactions in 3DMax modelling. Zhang and others(2015) proposed DLG batch modelling based on AutoCAD, using building boundaries and building height to generate building models, and seamlessly integrated with 3DMax. However, apart from being highly realistic, the structure and texture of the building are randomly generated and the roof structure is simple. Wang and others (2016) used Microsoft's DirectX3D component to create a plug-in batch production model, which improved the modelling efficiency but could not achieve the modelling of the concave and convex roof. In the modelling of road ancillary facilities, Sun(2013), Zhang and others(2016) used vehicle-borne laser radar point cloud data to carry out three-dimensional reconstruction of roads and ancillary facilities. The accuracy of the three-dimensional data is high, but the processing process is complicated, requires a lot of manual interaction, and the amount of data is huge. , Lü et al.(2013), Chen et al.(2013) and Xie et al.(2016) used the characteristics of the CityEngine parametric modelling to introduce an external streetlamp model on the centerline of the road for batch modelling. However, the position of the builtin streetlamp model is not at the actual streetlamp coordinate point, which results in inaccurate streetlamp position. This article aims at the shortcomings of batch modelling of above-mentioned computer program building and the deficiency of using 3DMax plug-in batch modelling in actual work. And the use of vehicle-borne laser radar point cloud data to carry out three-dimensional reconstruction of road ancillary facilities, the processing process is complex, many manual interactions, large data, and the actual work using 3DMax manual lamp modelling and placement, low efficiency, inaccurate position and other shortcomings; A batch 3D modelling method based on parametric modelling technology combined with 3DMax technology is proposed. A batch modelling program is developed to establish the relationship between the bottom floor attribute information and the model's structure, texture, etc., so as to control the size, structure, and texture of the model with attribute information. Through the modelling program, 3DMax is introduced to establish the streetlamp model, and the size, style, and orientation of the streetlamp are controlled by using the attribute information and the neighboring angle with the centerline of the road. Finally, the model is derived and imported into the plug-in to seamlessly integrate the 3D model with 3DMax, providing practical, low-cost, and high-efficiency solutions for large-scale urban rapid batch 3D modelling in urban management.

3D CITY BATCH RAPID MODELLING PROCESS
The overall process of 3D city batch rapid modelling is shown in Figure 1. (1) Create a library of texture and streetlamp models; (2) Get the geometric information and attribute information of the modelled object; (3) Modelled with a parameterized modelling program, and paste textures; (4) Batch export and import 3D models with prepared plug-ins; Eventually, scene integration and format conversion were performed in 3DMax, and the scenes are eventually applied to the SuperMap 8c or Skyline 3D platform.

REALIZATION OF 3D CITY BATCH MODELLING
There are many complex models of urban geometric objects. This article only takes the modelling of buildings and streetlamps as an example for research and implementation.

Establish Model and Texture Library
3.1.1 Build roof model and texture library: This experiment is aimed at 20 urban village communities in Xin'an Sub-district and Xixiang Sub-district in Bao'an District, Shenzhen. Statistical analysis, generalization and organization of building structures and textures, and the establishment of model libraries and texture libraries are shown in Figure 2. The structure of the village in the city is relatively simple. There are eight main types: parapet roof structure, stepped roof structure, single-pitch roof structure, double-break roof structure, fourpitch roof structure, pyramid roof structure, half-slope roof structure, and Xieshan roof structure. And the combination of the parapet and other types of buildings has a room-to-room structure. The geometry operation function and geometry property function in CityEngine are called to construct the function that generates the building roof. Different roof structures are set with different codes. Among them, the style of the room on the house is shown in Figure 3, and the codes set are 1 to 8 in order (the principle of the roof structure is the same as the room on the house and the code is also set to1 to 8 in order).

Preprocessing of Geometric and Attribute Information of Modeled Objects
In urban 3D modelling, customers usually provide modelling vector basic data, such as building points, lines, surface data, road centerlines, traffic points, lines, surface data, water system points, lines, surface data, and CAD data. It is necessary to preprocess the original data, delete redundant elements, retain the building floor data and building-related information, and extract road centerline data and streetlamp coordinate point data.
Then the preprocessed CAD building bottom surface data is imported into ArcMap and converted into shp surface data, and a spatial reference is added. This article uses the UTM84 projection coordinate system. (2)Judging spatial relationships. Determine the spatial relationship between the streetlamp coordinate point and the road centerline, and use the road centerline as the neighboring element of the streetlamp coordinate point to calculate the neighborhood angle of the streetlamp coordinate point, as shown in Figure 5. Add the proximity angle as the attribute value to the attribute table of the streetlamp coordinate point. The proximity angle is used in batch automatic modelling to determine the direction of street lamps. Note: The proximity angle is positive in the positive east direction, counter clockwise is positive, and clockwise is negative (Cheng et al., 2018 Single roof Angle：slope; index： geometric edge index Table 3. The main functions of creating building models 3.3.2 Batch create streetlamp models: The geometry creation function in the CGA rules is used to introduce external static models, and the style of the streetlamp is determined according to the value of the streetlamp style attribute value of the streetlamp coordinate point. The orientation of the static model before the introduction is in the positive north direction in 3DMax. In the CityEngine, the y axis of the scene coordinate system is the positive axis direction in the positive north direction. It is also positive in the counter clockwise direction and negative in the clockwise direction. Use the geometric transformation function to adjust the size of the streetlamp model, set the offset of the model, and adjust the direction of the streetlamp according to the proximity angle. The main functions used in mass modelling of street lamps are shown in Table 4. attrLAMP_STYLE=1 attrLAMP_HEIGHT =10 attr NEAR_ANGLE =10 getObj(LAMP_STYLE)= "models/lap_export/lamp"+ LAMP_STYLE +".obj" angle_z=NEAR_ANGLE-90 importLamp--> i(getObj(LAMP_STYLE)) s(x,LAMP_HEIGHT,z) rotate(rel, world, 0,angle_z, 0) 3.4 3D Model Generation, Export and Import 3.4.1 Batch generation of 3D models of buildings and street lamps: The pre-processed two-dimensional building bottom surface and streetlamp coordinate point data are imported into CityEngine. When batch modelling, select the building bottom surface or streetlamp coordinate points respectively, and associate their attribute fields, then select and run the batch modelling rule program to generate a 3D model. Wherein, when the building batch modelling program sequentially reads each shp face and corresponding attribute information (building height, architectural texture, roof style, room house style, etc.) , the corresponding map is obtained according to the attribute information, and the corresponding roof structure and the house room structure are generated. The streetlamp batch modelling program reads each shp point and corresponding attribute information (streetlamp style, streetlamp height, proximity angle) in order, obtains the corresponding style according to the attribute information, and generates the streetlamp corresponding to the height; And adjust the angle of the streetlamp according to the neighboring angle, the lamp arm of the streetlamp is perpendicular to the centerline of the road. This method is used to batch model the streetlights of the community buildings in the urban area of Xixiang Street, Xixiang Street, Shenzhen, and the Zhongxin Road and Dongfeng Road in Shiwan Street, Foshan, and the batch generation models are shown in Figure 6 and Figure 7. The model is highly efficient, the structure and texture of the model are basically the same as the actual building, and the streetlamp model orientation is almost consistent with the actual. Figure 6. 3D building models of village in the city 3.4.2 Batch Export and Import of 3D Models of Buildings and Street Lamps: In digital 3D city construction, constructing 3D scenes in SuperMap 8c or Skyline usually needs to be converted to fbx or x format data in 3DMax, and then imported into a 3D platform. Therefore, the established model needs to be exported in CityEngine and then imported into 3DMax for format conversion. The process is shown in Figure 8. Export Import x format fbx format Figure 8. Three-dimensional model data conversion process With the built-in model export function of CityEngine software, batches of buildings can export 3D models with textures, and the memory used for importing into 3D Max is too large, which affects the reuse of the model. This is because the software model export function merges all materials into one file when the model is exported, and then imports the entire material file for each model import. As a result, the memory occupied by the model is too large to be used properly. The CityEngine built-in plug-in program (CityEngine Python module) is used to compile a plug-in for exporting building models in batches. Exporting the obj format building model according to the bulk of the building solve the problem that the model occupied too much memory. This is also the key to the feasibility of this method. And add the model name attribute to the twodimensional building bottom surface data, and its attribute value must be unique, so as not to export all the building models. At the same time, the 3Dmax import 3D model function can only import a single obj format model in a single operation. To improve the work efficiency, the MaxScript script language is used to compile plug-ins for bulk import of the obj format model. Run the plug-in to import the obj format building and streetlamp model into 3D Max. As shown in Figure 9 and Figure 10, respectively.

ANALYSIS AND DISCUSSION OF EXAMPLES
Modelling, model export and import experimental platform: Intel core7 3.6GHz. Graphics card Ceforce GTS 620, Memory 4G,Memory 8G. It is based on the image data DOM and DLG data of Shenzhen Baoan District and the collection of photo data and construction information in the field. Using the batch modelling method of this paper, 150 building models in the village of Chuantang community were generated in batches and imported into 3DMax successfully. In the case of exporting the obj model without a plug-in in CityEngine, the obj building model is imported into 3DMax for performance comparison.
The memory situation and comparison of the same building number are shown in Figure 10, and the 3DMax software automatically crashes due to excessive memory when the conventional method is used in more than 60 building models. This shows that the model derived from the plug-in can be better compatible with the 3DMax software and can be directly modified and format converted. Figure 11. Memory comparison of importing the model generated by the two export methods into 3DMax

CONCLUSION
In summary, compared with the above modelling method, the batch 3D modelling method based on parametric modelling technology and 3DMax modelling technology proposed in this paper can make full use of the attribute information of 2D data. Effectively control the structure and texture of the 3D model of the building; effectively controls the style, size and direction of the three-dimensional model of street lamps; automatically generate more detailed 3D building models and more accurate streetlamp models in rapid batch. Using export and import plugins for model export and import improves work efficiency, makes the model compatible with 3DMax, and has useful value.
The proposed method provides practical, low-cost, and highefficiency solutions for automatic batch modelling of 3D city. However, this method still has limitations on complex and diverse heterogeneous buildings. At the same time, if urban management needs to accurately manage floors or households, more elaborate modelling can be carried out. As well as having textual information on urban road ancillary facilities, such as the three-dimensional modelling of road signs still have limitations.