an arcscene plug-in for volumetric data conversion, modeling and spatial analysis

12
An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis Dayong Shen a,n , David W. Wong b , Fernando Camelli b , Yuling Liu c a The University of Mississippi, University, MS 38677, USA b George Mason University, Fairfax, VA 22030, USA c University of Maryland, College Park, MD 20740, USA article info Article history: Received 4 October 2012 Received in revised form 24 June 2013 Accepted 7 August 2013 Available online 14 August 2013 Keywords: 3D Data conversion Data modeling MultiPatch Contours ArcScene abstract Representation of volumetric data is necessary in hydrology, meteorology, ecology, environmental science and so on for modeling and visualization. As popular GIS software, ArcScene supports MultiPatch format for modeling and spatial analysis of volumetric data. It also supports conversion of 3D le formats into MultiPatch. But there are obvious limitations: (1) ArcScene does not support conversion of popular 3D formats such as Wavefront Objects (OBJ) and Visualization ToolKit (VTK) into MultiPatch; (2) after the conversion, the entire dataset only forms one patch which is inconvenient for further spatial analysis; (3) ArcScene does not support 3D contouring. In this study, we have successfully developed an ArcScene plug-in for converting OBJ and VTK le formats into MultiPatch, for accessing and editing MultiPatch les, and for tracing 3D contours based on MultiPatch. The ArcScene plug-in is characteristic of a time complexity of O(N), strong data structure in terms of spatial analysis, user-friendly operation, high robustness and good extendibility, and therefore it enriches ArcScene functionalities and users can benet from the new plug-in for various applications. & 2013 Elsevier Ltd. All rights reserved. 1. Previous work Representation of volumetric data e.g. clouds, polluted air, polluted water, forest re and geological entities is very important in many disciplines such as hydrology, meteorology, ecology and environmental science etc. Existing methods for volumetric data modeling mainly include GIS method and CAD method (Oosterom et al., 2006, Li et al., 2009). Since CAD method often exhibits restrictions in data structure and spatial analysis (Taylor et al., 2000), in this study we focus on GIS method. 1.1. 3D GIS modeling In terms of geometry, existing approaches for 3D GIS modeling can be classied into three types (Shen et al., 2003, 2006, Shen and Takara, 2006, Fig. 1): (1) Surface-based (Mallet, 1989, Kelk and Challen, 1992, Orlic, 1997): e.g. grid, shape model, facet model, and boundary representation (B-rep); (2) Volume-based (Orlic, 1997, Abdul-Rahman and Pilouk, 2008): e.g. 3D Array, Octree, Constructive Solid Geometry (CSG), Tetrahedral Network (TEN), GIS Soft Voxel (SV), Tri-Prism, Geocellular, Pyramid, 3D voronoi, Voxel; (3) Hybrids (Shi, 2000, Tao, 2009): e.g. TIN-Octree and TIN-CSG where TIN is the abbreviation of Triangulated Irregular Network. Facet models e.g. TIN have been integrated in ArcScene, a widely applied 3D Viewer developed by Environmental Systems Research Institute, Inc. (ESRI) due to the structural stability, feature adaptability and data interpolation simplicity of TIN (Abdul- Rahman, 1992, Midtbø, 1996). TIN is capable of preserving all the original observation data for surface representation (Abdul- Rahman and Pilouk, 2008). 1.2. 3D functionalities of ArcScene 10 ArcScene 10 is capable of 3D data classication and data operations. See Section 5.5 for details. ArcScene 10 supports conversion of 3D Studio Max (3DS), SketchUp (SKP), OpenFlight (FLT), VRML and GeoVRML (WRL) into multipath-based Shapeles (SHP) to represent 3D volumetric data (ESRI 2010). A Shapele stores geometry and attribute information for the spatial features in a data set. Each attribute record has a one-to-one relation- ship with the associated shape record. Shapeles support point, line, polygon and MultiPatch features, and have advantages over other data sources such as faster drawing speed and editability. Contents lists available at ScienceDirect journal homepage: www.elsevier.com/locate/cageo Computers & Geosciences 0098-3004/$ - see front matter & 2013 Elsevier Ltd. All rights reserved. http://dx.doi.org/10.1016/j.cageo.2013.08.004 n Corresponding author. Tel.: þ1 662 915 8974. E-mail addresses: [email protected], [email protected] (D. Shen). Computers & Geosciences 61 (2013) 104115

Upload: yuling

Post on 12-Dec-2016

219 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

An ArcScene plug-in for volumetric data conversion, modelingand spatial analysis

Dayong Shen a,n, David W. Wong b, Fernando Camelli b, Yuling Liu c

a The University of Mississippi, University, MS 38677, USAb George Mason University, Fairfax, VA 22030, USAc University of Maryland, College Park, MD 20740, USA

a r t i c l e i n f o

Article history:Received 4 October 2012Received in revised form24 June 2013Accepted 7 August 2013Available online 14 August 2013

Keywords:3DData conversionData modelingMultiPatchContoursArcScene

a b s t r a c t

Representation of volumetric data is necessary in hydrology, meteorology, ecology, environmentalscience and so on for modeling and visualization. As popular GIS software, ArcScene supports MultiPatchformat for modeling and spatial analysis of volumetric data. It also supports conversion of 3D file formatsinto MultiPatch. But there are obvious limitations: (1) ArcScene does not support conversion of popular3D formats such as Wavefront Objects (OBJ) and Visualization ToolKit (VTK) into MultiPatch; (2) after theconversion, the entire dataset only forms one patch which is inconvenient for further spatial analysis; (3)ArcScene does not support 3D contouring. In this study, we have successfully developed an ArcSceneplug-in for converting OBJ and VTK file formats into MultiPatch, for accessing and editing MultiPatchfiles, and for tracing 3D contours based on MultiPatch. The ArcScene plug-in is characteristic of a timecomplexity of O(N), strong data structure in terms of spatial analysis, user-friendly operation, highrobustness and good extendibility, and therefore it enriches ArcScene functionalities and users canbenefit from the new plug-in for various applications.

& 2013 Elsevier Ltd. All rights reserved.

1. Previous work

Representation of volumetric data e.g. clouds, polluted air,polluted water, forest fire and geological entities is very importantin many disciplines such as hydrology, meteorology, ecology andenvironmental science etc. Existing methods for volumetric datamodeling mainly include GIS method and CAD method (Oosteromet al., 2006, Li et al., 2009). Since CAD method often exhibitsrestrictions in data structure and spatial analysis (Taylor et al.,2000), in this study we focus on GIS method.

1.1. 3D GIS modeling

In terms of geometry, existing approaches for 3D GIS modelingcan be classified into three types (Shen et al., 2003, 2006, Shen andTakara, 2006, Fig. 1):

(1) Surface-based (Mallet, 1989, Kelk and Challen, 1992, Orlic,1997): e.g. grid, shape model, facet model, and boundaryrepresentation (B-rep);

(2) Volume-based (Orlic, 1997, Abdul-Rahman and Pilouk, 2008):e.g. 3D Array, Octree, Constructive Solid Geometry (CSG),

Tetrahedral Network (TEN), GIS Soft Voxel (SV), Tri-Prism,Geocellular, Pyramid, 3D voronoi, Voxel;

(3) Hybrids (Shi, 2000, Tao, 2009): e.g. TIN-Octree and TIN-CSGwhere TIN is the abbreviation of Triangulated IrregularNetwork.

Facet models e.g. TIN have been integrated in ArcScene,a widely applied 3D Viewer developed by Environmental SystemsResearch Institute, Inc. (ESRI) due to the structural stability, featureadaptability and data interpolation simplicity of TIN (Abdul-Rahman, 1992, Midtbø, 1996). TIN is capable of preserving all theoriginal observation data for surface representation (Abdul-Rahman and Pilouk, 2008).

1.2. 3D functionalities of ArcScene 10

ArcScene 10 is capable of 3D data classification and dataoperations. See Section 5.5 for details. ArcScene 10 supportsconversion of 3D Studio Max (3DS), SketchUp (SKP), OpenFlight(FLT), VRML and GeoVRML (WRL) into multipath-based Shapefiles(SHP) to represent 3D volumetric data (ESRI 2010). A Shapefilestores geometry and attribute information for the spatial featuresin a data set. Each attribute record has a one-to-one relation-ship with the associated shape record. Shapefiles support point,line, polygon and MultiPatch features, and have advantages overother data sources such as faster drawing speed and editability.

Contents lists available at ScienceDirect

journal homepage: www.elsevier.com/locate/cageo

Computers & Geosciences

0098-3004/$ - see front matter & 2013 Elsevier Ltd. All rights reserved.http://dx.doi.org/10.1016/j.cageo.2013.08.004

n Corresponding author. Tel.: þ1 662 915 8974.E-mail addresses: [email protected],

[email protected] (D. Shen).

Computers & Geosciences 61 (2013) 104–115

Page 2: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

They also typically require less disk space and are easier to readand write (ESRI, 1998).

1.3. Challenges

Even though ArcScene 10 has a lot of functionalities, it still hasfollowing limitations in terms of volumetric data modeling andanalysis:

(1) Conversion of 3D file formats. For example, Wavefront Objects(OBJ) and Visualization ToolKit (VTK) are two popular 3D fileformats in CAD. ArcScene does not support the conversion ofOBJ and VTK into MultiPatch;

(2) Even though the entire dataset before conversion may containmore than one patch, the entire dataset only forms one patchafter conversion. Therefore, the converted volumetric data inArcScene is inconvenient for spatial analysis;

(3) ArcScene 10 does not provide 3D contouring functionality,which is very important for analysis of volumetric data.

1.4. Main content of this study

The main content of this paper is the algorithm design, develop-ment and implementation of an ArcScene plug-in.

Here, plug-ins are defined as components that can form userinterfaces and interact with users to realize algorithms (Jiang,2008). In ArcScene, a plug-in is shown as interfaces such asICommand, ITool, IToolBarDef, IMenuDef, or IDockableWindow(Jiang, 2008). In details, our proposed ArcScene plug-in is expectedto:

� Enhance support of 3D file formats. The plug-in will supportconversion of 3D file formats such as OBJ and VTK into Multi-Patch, and keep all geometry and attributes information.

� Enhance support of reading, editing and writing MultiPatch-based geometry features and attributes. The plug-in will useSHP and DBF File APIs (Warmerdam, 2012) to access MultiPatchfiles directly.

� Enhance support of MultiPatch-based data modeling. The plug-in will apply flexible schemes for patches construction to meetthe requirements of in-depth spatial analysis of volumetricdata. See details in Section 3.1.

� Enhance support of 3D contouring. The plug-in will applyMultiPatch-based contouring algorithm with speed optimiza-tion and high robustness.

� Enhance the capability of ArcScene in modeling and spatialanalysis of volumetric data. The plug-in will be capable ofgenerating MultiPatch-based and polyline-based shapefiles.Combined with existing functionalities in ArcScene such asdata classification and data operations, the plug-in will sig-nificantly strengthen ArcScene in 3D data representation.

The remainder of this paper is organized as the following:Section 2 presents technical procedures and algorithm realizationfor the proposed plug-in development. Section 3 describes Multi-Patch and VTK file formats. Sections 4 and 5 present the interfaceand a detailed implementation of the ArcScene plug-in, respec-tively. Section 6 gives concluding remarks.

2. Methodology

2.1. General approach

2.1.1. Development platformsIn terms of ArcScene plug-in development, VCþþ has follow-

ing advantages compared to VB and VBA: (a) VCþþ can be used torealize everything possible in VB and VBA; (b) VCþþ has moreadvanced component and extension options e.g. implementingevery interface, even those supporting inheritance; (c) Perfor-mance is the best: compared to VCþþ , VB is Approximately 2%slower, and VBA is approximately 4% slower (ESRI 2002). There-fore, in this study VCþþ is selected for the ArcScene plug-indevelopment.

Fig. 1. In terms of geometry, approaches for 3D GIS modeling are classified into: (a) Volume-base, (b) Surface-based (Abdul-Rahman and Pilouk, 2008), and (c) Hybrids.Where CSG is short for Constructive Solid Geometry, TEN is short for Tetrahedral Network, SV is short for Soft Voxel, B-Rep is short for Boundary Representation, and TIN isshort for Triangulated Irregular Network.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115 105

Page 3: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

2.1.2. Development proceduresWe developed the ArcScene plug-in for data conversion and 3D

contouring by:

(1) Creating an Active Template Library (ATL) project in whichDynamic Link Library (DLL) COM Server type and MicrosoftFoundation Classes (MFC) are supported. Then we create a “3DTools” command by inserting a new ATL COM object.

(2) Implementing ICommand interface defined within the ERSIobject libraries and adding code to the members of theICommand to realize the plug-in algorithms. See Fig. 2 andSection 2.2 for details.

After the DLL is registered into an appropriate ComponentCategory, end users will see the new plug-in in the Customizeddialog box the first time ArcScene 10 is started.

2.2. Description of MultiPatch-based 3D contouring algorithm

Taking the efficiency of contours tracing as well as geometryand attribute query into account, we define the following basicdata structures and algorithms:

(1) Data structure(a) Vertex

Typedef struct vertex{

int vertex_number //Vertex IDint building_number //Building IDdouble x,y,z //Coordinatesvectoro int4 vAdjacentTri //List of adjacent

trianglesdouble concentration //Vertex attribute

value} VERTEX

(b) Triangle

Typedef struct triangle //i.e. patch{

int triangle_number //Triangle IDint building_number //Building IDint vertex_number[3] //IDs of three verticesint adjacent_tri[3] //IDs of three neighboring

trianglesint processed //Processing flag

} TRIANGLE

(c) Contour

Typedef struct contour{

int contour_number //Contour IDdouble concentration //Contour attribute

valuevectoro3DPoint4 vContour //List of

ordered equivalent pointsint NextTri //ID of next trianlge to be traced

} CONTOUR

(d) MultiPatch (ESRI, 1998)

MultiPatch{

Double[4] Box // Bounding BoxInteger NumParts // Number of PartsInteger NumPoints // Total Number of PointsInteger[NumParts] Parts // Index to First

Point in PartInteger[NumParts] PartTypes // Part TypePoint[NumPoints] Points // Points for All

PartsDouble[2] Z Range // Bounding Z RangeDouble[NumPoints] Z Array // Z Values for

All PointsDouble[2] M Range // Bounding Measure

RangeDouble[NumPoints] M Array // Measures

}

Since the basic data structures incorporate sufficient topolo-gical and attribute inforamtion, it is very efficient for contourstracing. Moreover, based on the above data structures geo-metry and attribute query such as all triangles incident at apoint, all triangles neighboring to a given triangle, all tiranlgescontained in a building, all triangles contained in terrain,distribution of point concentration, or distribution of contourconcentration can be answered in a straightforward manner.

(2) Data preprocessingInput data are preprocessed to enhance the efficiency ofcontours tracing:

Step 1: Read MultiPatch Shapefile using .SHP File API.Step 2: Read Attribute dBase file using .DBF File API.Step 3: Store attribute value of each vertex.Step 4: Create adjacent triangle list of each vertex.Step 5: Find adjacent triangle list of each triangle.Step 6: Process attibute value of a vertex if the value isequal to an isovalue, i.e. CVm�Cð Þ CVn�Cð Þr0 if |Ci�C|oε,then Ci¼Ciþε where Ci is attribute value of vertex i(i¼1,2,3), C is isovalue, ε¼min{Ci}/10n and nANþ .

Note Shapefile C library (Warmerdam, 2012), which providesthe ability to write C programs for reading, writing and editing

3D Contouring

Load Multipatch file

Calculate maximum and minimum values

Select contours tracing mode

Set parameters

Trace contours

Write Polyline file

3D Data Conversion

Load 3D file

Derive attributes and geometrical features

Write Multipatch file

Fig. 2. Flow chart of the algorithms integrated in the proposed ArcScene plug-in.For 3D data conversion, data reading, derivation and writing are based on SHP FileAPI and DBF File API. For 3D contouring, minimum and maximum values arecalculated for parameters setting. There are three modes of contours tracing.Parameters need to be set for mode I include base contour and contour interval;parameters for mode II AND III both include minimum value, maximum value, andnumber of isovalues. Note that MultiPatch file loading and Polyline file writing arealso using SHP File API and DBF File API.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115106

Page 4: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

ESRI Shapefiles, and the associated attribute file (.dbf), areused in this study. SHP File API uses SHPHandle, SHPObject,SHPOpen(), SHPGetInfo(), SHPReadObject(), SHPClose(),SHPCreate(), SHPCreateSimpleObject(), SHPCreateObject(),SHPComputeExtents(), SHPWriteObject(), SHPRewindObject(),SHPDestroyObject(), etc. to access and update Shapefiles whileDBF File API uses DBFHandle, DBFOpen(), DBFCreate(),DBFGetFieldCount(), DBFGetRecordCount(), DBFGetFieldIndex(), DBFGetFieldInfo(), DBFAddField(), DBFReadIntegerAttribute(), DBFReadDoubleAttribute(), DBFReadStringAttribute(), DBFI-sAttributeNULL(), DBFWriteIntegerAttribute(), DBFWriteDou-bleAttribute(), DBFWriteStringAttribute(), DBFWriteNULLAttribute(), DBFIsRecordDeleted(), DBFMarkRecordDeleted(),DBFGetNativeFieldType(), DBFClose(), etc. to access and updateDBF files. Refer to Warmerdam (2012) for details.

(3) Contours tracingFig. 3 shows the flow chart for 3D contours tracing:Firstly triangles are classified into three types: a triangle willbe identified as type 0 if the triangle does not contain anyequivalent point or identified as type 1 if the triangle containsstart (end) point of an open contour; otherwise, the trianglewill be identified as type 2 (Fig. 4). All triangles are theninitialized as unprocessed and all open contours are tracedbefore close contours to enhance the algorithm efficiency.Details of tracing open contours and close contours aredescribed in Figs. 5 and 6, respectively. The following functionsare called during 3D contours tracing:

Call function 1: Find an equivalent point A in a triangleAssuming that Ti (i¼1,…,n) is a triangle, Vm (m¼1,2,3)are three vertices of Ti.If there is an equivalent point on the edge (Vm, Vn), then(Wen and Liu, 2010)

ðCVm�CÞðCVn�CÞr0 ð1Þwhere mA[1, 3], nA[1, 3], and man. C is isovalue, CVm

and CVn are values of Vm and Vn respectively.

Call function 2: Interpolate coordinates of the equiva-lent point

X ¼ XVm þαðXVn�XVm ÞY ¼ YVm þαðYVn�YVm ÞZ ¼ ZVm þαðZVn�ZVm Þα¼ ðC�CVm Þ=ðCVn�CVm Þ

8>>>><>>>>:

ð2Þ

Where (X, Y, Z), (XVm , YVm , ZVm ) and (XVn , YVn , ZVn ) arecoordinates of the equivalent point, Vm, and Vn respec-tively, α is coefficient.

(4) Data outputWrite geometry of contours into a Polyline Shapefile using SHPFile API and write attributes of contours into a dBase file using.DBF File API.

3. 3D file formats

3.1. MultiPatch shapefile format

(1) MultiPatchMultiPatch is a 3D geometry used to represent the outersurface of features that occupy a discrete area or volume inthree-dimensional space. It is a GIS industry standard devel-oped by ESRI in 1997 (ESRI, 1998).A MultiPatch consists of a number of surface patches. Thesurface patches of a MultiPatch are referred to as its parts. Thepart of a MultiPatch can be of the type of triangle or ring,which controls how the order of vertices of a MultiPatch partis interpreted.By providing better control over polygon face orientations andbetter definition of polygon face interiors, MultiPatchaddresses the need for a 3D polygon geometry type that isunconstrained by 2D validity rules. So Multipatch is the idealdata type for representation of realistic-looking 3D features.

(2) MultiPatch shapefileMultiPatch shapefiles are composed of(a) Main File (.shp): contains feature geometry.(b) The index file (.shx): contains a positional index of the

feature geometry to allow seeking forwards and back-wards quickly.

Start

Identify triangle types

Initialize all triangles

Trace open contours

Trace close contours

Close

Fig. 3. Flow chart for MultiPatch-based 3D contours tracing. Step 1: Identify triangletypes; Step 2: Initialize all triangles as unprocessed triangles; Step 3: Trace opencontours; Step 4: Trace close contours.

Ti does not contain any equivalent point

Ti contains start/end point of an open contour

Set Ti type as 0

Set Ti type as 1

Set Ti type as 2

Break

Break

T

T

F

F

Fig. 4. Triangles are classified into three types for MultiPatch-based 3D contourstracing. A triangle will be identified as type 0 if the triangle does not contain anyequivalent point or identified as type 1 if the triangle contains start (end) point ofan open contour; otherwise, the triangle will be identified as type 2.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115 107

Page 5: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

T F

Create C

i=k Ti proc TYi =1 CZ >1

Add C into A Initialize C

k<Tn

TYi =0

Ti proc

CZ <1 S1, S2, S3, S4 S5, S6, S7, S8

Set Ti as proc

IDtri_next >0 i= IDtri_next - 1

TF

T

F

F

T F

T

Fig. 5. Flow chart for tracing open contours. Where C is current contour; A is contour array for saving all contours; Tn is total number of triangles; proc represents processed;Ti is the ith triangle; TYi is the type of the ith triangle i.e. 0, 1, or 2; T is true; F is false; Cz is the total number of equivalent points saved in the current contour; S1 meansfinding the edge that contains start point of the contour; S2 means interpolating the coordinates of the equivalent point; S3 means adding the point into the point list ofcurrent contour; S4 means marking ID of next triangle (Tnext) that contains the equivalent point; S5 means finding the edge that contains middle/end point of the contour;S6 means interpolating the coordinates of the equivalent point; S7 means adding the point into the point list of current contour; S8 means marking ID of next triangle (Tnext)that contains the equivalent point; IDtri_next is the ID of Tnext.

T F

Create C

i=k Ti proc TYi =2 CZ >3

Add C into A Initialize C

k<Tn

TYi =0

Ti proc

CZ <1 S1, S2, S3, S4 S5, S6, S7, S8

Set Ti as proc

IDtri_next >0 i= IDtri_next - 1

TF

T

F

F

T F

T

Fig. 6. Flow chart for tracing close contours. Where S1 means finding the edge that contains start point of the contour; S2 means interpolating the coordinates of theequivalent point; S3 means adding the point into the point list of current contour; S4 means marking ID of next triangle (Tnext) that contains the equivalent point; S5 meansfinding the edge that contains middle/end point of the contour; S6 means interpolating the coordinates of the equivalent point; S7 means adding the point into the point listof current contour; S8 means marking ID of next triangle (Tnext) that contains the equivalent point; IDtri_next is the ID of Tnext. Meanings of other symbols are the same as thoseappear in Fig. 5.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115108

Page 6: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

(c) The dBASE file (.dbf): contains columnar attributes for allshape features. There are three requirements (ESRI, 1998):

� The file name must have the same prefix as the shape andindex file.

� The table must contain one record per shape feature.� The record order must be the same as the order of shape

features in the main file.(3) Create MultiPatch shapefiles

Step 1: Create geometrical features by using .SHP File API(a) Patch construction schemes (Fig. 7(b)).� Triangle based patch construction: each triangle is a patch.� Building surface based patch construction: each building

surface is a patch.� Building volume based patch construction: each building

volume (surfaceþbottom) is a patch.� All surface based patch construction: all building surfaces

and terrain forms a patch. Note that it is a seamlesssurface.

� All volume based patch construction: all building volumesform a patch.Flexible patch construction schemes described above canmeet various application requirements.

(b) Representation of 3D holes, overpasses, overhangs, andgas plumes

MultiPatch is capable of representing complex true 3Dobjects like holes, overpasses, overhangs, and gas plumes(Fig. 3(c)–(f)).Step 2: Create attributes (Fig. 8) by using .DBF File API.Attributes in Fig. 8 include triangle IDs, vertex IDs, vertexconcentration, and building IDs (Bi), where

Bio0; terrainBiZ0; building

(ð3Þ

3.2. VTK file format

A VTK file is composed of five parts (Kitware, Inc., 2010):

Part 1: Header# vtk Data File Version 2.0

Part 2: TitleConverted FEFLO File: Time¼0.50412528Eþ03

Part 3: Data type, either ASCII or BINARYASCII

Part 4: Geometry/topology typeDATASET UNSTRUCTURED_GRID

Part 5: Dataset attributes

Fig. 7. MultiPatches: (a) represents urban pollution scenario where buildings, terrain surfaces and gas plumes are all MultiPatch-based; (b) shows patches constructionschemes, which could be triangle-based, building-surface-based, building-surface-plus-building-bottom-based, or all-building-surfaces-plus-terrain-surfaces-based;(c) overhang; (d) overpass; (e) 3D holes; and (f) gas plumes. (c)–(f) prove the strong capability of MultiPatches in 3D geometry modeling.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115 109

Page 7: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

POINTS 781240 float…//x,y,z coordinatesCELLS 1562503 6250012…//number of vertices, vertex IDsCELL_TYPES 1562503…//cell typesPOINT_DATA 781240SCALARS adv_varia1 float 1LOOKUP_TABLE default…//point attributes

4. Interface description

After ArcScene startup, the plug-in is loaded automatically (Fig. 9).Fig. 10 shows the interface of the proposed plug-in, which can: (1)convert OBJ into MultiPatch, (2) convert VTK into MultiPatch, and (3)trace 3D contours. In Fig. 10, input is the input 3D data in full path,and output is converted MultiPatch data in full path.

We have integrated three modes of contours tracing into theplug-in:

(1) Mode I: set contour interval� Scheme: Divides the range of isovalues into equal-sized

subranges by setting base contour and contour interval.

� Parameters setting: Base Contour (B) and ContourInterval (CI).

� Mathematical expressions:

Ci ¼ Bþ iðCIÞ; i¼ 0;⋯;M;CminrBrCmax;CI40M¼ ðCmax�BÞ=CI

(ð4Þ

where Cmax is maximum value, Cmin is minimum value, and Mis number of isovalues.

(2) Mode II: set the number of isovaluesScheme: Divides the range of isovalues into equal-sizedsubranges by setting minimum value, maximum value, andnumber of isovalues.� Parameters setting: minimum value (Cmin), maximum value

(Cmax), and number of isovalues (M).� Mathematical expressions:

M¼ 1;CI ¼ Cmax�Cmin;Ci ¼ Cminþ iðCIÞ; i¼ 0;1M41;CI¼ ðCmax�CminÞ=ðM�1Þ;Ci ¼ Cminþ iðCIÞ; i¼ 0;⋯;M�1

(

ð5Þ(3) Mode III: log scale

Scheme: Divides the range of the logarithm of isovalues intoequal-sized subranges by setting minimum value, maximumvalue, and number of isovalues.� Parameters setting: minimum value (Cmin), maximum value

(Cmax), and number of isovalues (M).

Fig. 8. Derivation of attributes and geometrical features using SHP File API and DBF File API. The 3D scenarios show Oklahoma City Downtown area. In the table on the leftside, the shape type is triangle-based MultiPatch. V1, V2, V3 are vertex IDs. Con_V1, Con_V2, Con_V3 are concentration values of V1, V2, V3 respectively. Note if BuildingID isequal to -1, then the patch belongs to terrain surface, otherwise the patch belongs to a building.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115110

Page 8: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

� Mathematical expressions:

M¼ 1;CI¼ log 10Cmax�log 10Cmin;Ci ¼ 10log 10Cmin þ iðCIÞ; i¼ 0;1

M41; CI¼ ðlog 10Cmax�log 10CminÞ=ðM�1Þ; Ci ¼ 10log 10Cmin þ iðCIÞ; i¼ 0;⋯;M�1

(

ð6Þ

Fig. 9. ArcScene startup and the process of loading plug-ins (Source: Jiang, 2008). When started, ArcMap.exe searches information of plug-in objects in ComponentCategories in Registry, and initializes the plug-in objects: (1) Host program creates actual User Interface (UI) layer objects according to the UI information carried by theplug-in objects, which appear in the host program in different UI forms. (2) The host program creates two common objects, i.e. Application and ThisDocument, both of whichcarry information and interaction methods of the host program. (3) The host program establishes the interactive-communication channel between a plug-in UI object andthe plug-in object based on “Event Mechanism”. When a user clicks a plug-in UI object, the host program calls the right plug-in object via function pointers and callbackfunctions to complete the operation.

Fig. 10. Interface of the proposed ArcScene plug-in, which has three mainfunctions: conversion of OBJ into MultiPatch, conversion of VTK into MultiPatch,and 3D contours tracing and creation. The input data is in 3D file format and theoutput is MultiPatch file for data conversion or Polyline file for 3D contouring.There are three modes for 3D contouring. Each mode has parameters which need tobe set via the interface for contours tracing.

Fig. 11. Multipatch-based 3D contouring. Note that 3D contours, which includeopen contours and close contours, are true 3D. Each contour in this case representsa level of gas concentration on building surfaces.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115 111

Page 9: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

5. Implementation

Air motions in and around cities are very complicated and theincreasing threat of toxic agent releases into urban atmospheresmakes advancing the state-of-science of understanding and mod-eling atmospheric flows in and around cities essential (Allwineand Flaherty, 2006). We simulate a transport and dispersion eventusing FEFLO-Urban, a general purpose finite element model(Camelli et al., 2006, Wong et al., 2007, Camelli et al. 2012). Themodel has been validated using the high-resolution dispersiondata from the Joint Urban 2003 experiment conducted in Okla-homa City, Oklahoma from June 28 through July 31, 2003 (Allwineand Flaherty, 2006).

5.1. Data source

The seamless surface merging triangulated building and terraindata from Oklahoma City is in VTK format. Each vertex has aconcentration value of a simulated gas, a passive tracer with acontinuous release type. The concentration values were generatedby using FEFLO-Urban to simulate the transport and dispersion ofa passive tracer during the Joint Urban field experiment held inOklahoma City 2003. The gas flow of the tracer is assumed tofollow the transport and diffusion equation (See Fig. 13 for details).The concentration of every vertex of the surface mesh wasextracted from the volume data for the end time of simulationi.e. 504 s after the release was initiated.

5.2. System configuration

� Manufacturer: TOSHIBA� Model: Satellite L555D� Processor: AMD Turion (tm) II Dual-Core Mobile M520 2.3 GHz

� Installed memory(RAM): 4.00 GB� System type: 64-bit Operating System� Windows edition: Windows 7 Home Premium

5.3. Performance of the 3D data conversion tool

The converted data are true 3D. In Fig. 7(a), background isbuildings in Oklahoma City downtown area. There are two plumeisosurfaces extracted from CFD simulation of continuous release ofa passive tracer: the big one T¼500 s, CZ0.00001 ppm; the smallone T¼500 s, CZ0.0001 ppm where T is the time after the releaseof the tracer and C is concentration. Note that the small plumeisosurface is totally contained in the big one and all buildings andisosurfaces in Fig. 7 are represented by MultiPatches.

5.4. Performance of the 3D contouring tool

(1) RobustAssuming that M is number of points contained in a contour,the algorithm can trace any close contour with MZ4 and anyopen contour with MZ2 (Fig. 11).

(2) QuickThe time complexity to trace an isovalue reaches O(N). In thecase study of Oklahoma City, number of triangles is 476290.Running time depends on number of isovalues. Table 1 showsthe algorithm performance: For both mode II and mode III, thespeed is 5 isovalues per second i.e. M/S¼5 since the timecomplexity to trace an isovalue is the same.In Fig. 12, N1/ME2 while N2/ME18. The curve of N2/N1 showsthat mode III catches much more information than mode II.

5.5. Combine the proposed plug-in with existing ArcScene tools forvolumetric data analysis

When 3D file in OBJ/VTK format is converted into MultiPatch fileusing the plug-in proposed in this study, we can do further 3Danalysis to the MultiPatch file by applying 3D tools integrated inArcScene. Alternatively, we can trace 3D contours using the plug-inproposed in this study, and then do further 3D analysis to the 3Dcontours by applying 3D tools in ArcScene. Taking Oklahoma CityDowntown area as an example, the MultiPatch-based buildings,terrain, gas plumes, and the 3D contours of the plume data can befurther analyzed using the following tools integrated in ArcScene toexhibit the impact of pollutants on urban environment.

(1) Data classificationArcScene 10 supports manual, equal interval, defined interval,quantile, natural breaks (Jenks), geometrical interval, andstandard deviation schemes for data classification. Amongthese schemes, the geometrical interval classification schemecan well accommodate continuous data by creating classbreaks based on class intervals that have a geometrical series.The scheme minimizes variance within classes and can evenwork reasonably well on data that are not normally distributed(ESRI 2010). Fig. 13 shows 3D contours traced by our proposedplug-in. In this case the geometrical interval scheme is best viaexperiments (Fig. 13(c)). Compared to the equal intervalscheme (Fig. 13(a)), the geometrical interval scheme is capableof catching small clouds detached from the main cloud, andthese detached clouds are moving away from the winddirection, showing the effect of the wind close to the groundthat was transversal to the main wind direction. Compared tothe quantile scheme (Fig. 13(b)), the geometrical intervalscheme is capable of clearly marking the source of the release,

0.0

2.0

4.0

6.0

8.0

10.0

12.0

14.0

16.0

18.0

20.0

50 200 350 500

N1/MN2/MN2/N1

Fig. 12. Comparison of the performance of equal interval scheme (Mode II) and logscale scheme (Mode III). Where M is number of isovalues, N1 is number of contoursin Mode II, N2 is number of contours in Mode III. In this case study, N1/ME2,N2/ME18, and the curve of N2/N1 shows that Mode III catches much moreinformation that Mode II.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115112

Page 10: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

Fig. 13. Comparison of schemes using the same dataset. (a) Equal interval: This scheme divides the range of attribute values into equal-sized subranges; (b) Quantile:A quantile classification is well suited to linearly distributed data, since the classification assigns the same number of data values to each class; (c) Geometrical interval: Thisalgorithm was specifically designed to accommodate continuous data. Physical principle behind the gas plume simulation—the transport and diffusion equation for the gas,which is expressed by ∂c=∂tþ u!∇c¼∇ðD∇cÞþS (Camelli, 2002) where c is gas concentration (ppm), u! is velocity, D is molecular diffusivity, and S is the change rate ofconcentration due to sources. D is a scalar function of the temperature and pressure with typical values in the order of 10�5 m2/s, so the most important affecting factor of cin the above equation is the velocity vector u!¼ ðuð x!; tÞ; vð x!; tÞ;wð x!; tÞÞ. The simulation assumed a boundary condition for the inflow of a logarithmic profile with a velocityof 2 m/s at 10 m above the ground.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115 113

Page 11: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

which was close to Ronald J. Norick Downtown Library,Oklahoma City.

(2) Data operationsArcScene 10 is capable of:(a) Selection by attributes

Assuming that P is previous selection set, C is currentselection set, P′ is complement set of P, and R is result set,then

SUBSET_SELECTION: R¼P\C;SWITCH_SELECTION: R¼P′;

(b) Selection by locationAssuming that F represents features set in the input layer,S represents selected features set in 3D space, D represents3D buffer set with a specific radius, and R is result set, then

INTERSECT_3D: R¼F\S;WITHIN_A_DISTANCE_3D: R¼F\D.

(c) Union/Difference/IntersectionAssuming that A, B are two volume sets defined by closedMultiPatch features, O is output feature set, then

Difference 3D: O¼A�B or O¼B�A;Intersection 3D: O¼A\B;Union 3D: O¼A⋃B.

Note that all the above data operations can be combined withour proposed plug-in for volumetric data analysis. For example:

SUBSET_SELECTION operation is used for the selection ofMultiPatches based on attributes in Fig. 14(a), which showsbuilding patches with cZ0.00001 ppm at t¼500 s after releaseof the tracer gas, and in Fig. 14(b), which displays an isosurface ofgas plume with c¼0.00001 ppm and t¼500 s after release of thetrace gas.

Fig. 9(c) shows the entire building shell formed by fifteen partsbefore Union 3D operation while Fig. 14(d) displays the entirebuilding shell formed by only one patch after the Union 3Doperation, which is used for aggregation of MultiPatches inthis study.

Fig. 15 exhibits a 3D influence area with a radius of 300 maround the source of release by applying WITHIN_A_DISTANCE_3Doperation for distance-based selection of MultiPatches.

6. Concluding remarks

In this study, we successfully designed and developed anArcScene plug-in, which is capable of converting OBJ and VTK 3Dfile formats into MultiPatch, editing geometry and attribute featuresof Shapefiles, and tracing 3D contours for volumetric data repre-sentation and spatial analysis. By using 3D data of Oklahoma City,the algorithms integrated in the plug-in were verified to be highlyrobust, strong in spatial analysis and friendly for user operations.The proposed plug-in thus enhances the functionalities of ArcScene10 in true 3D data representation significantly.

Table 1Analysis of 3D contouring schemes. In the table, M/S1E5 and M/S2E5 since thetime complexities to trace an isovalue for both modes are the same. Generally N2 ismuch larger than N1, which indicates that Mode III is capable of catching muchmore details than Mode II in the case study.

Number ofisovalues (M)

Time ratio

Equal interval Log scale

Number ofcontours (N1)

Running timeratio (S1)

Number ofcontours (N2)

Runningtime ratio(S2)

50 131 1 892 1100 189 2 1768 2150 250 3 2608 3200 305 4 3547 4500 663 10 8777 10

Fig. 14. Selection by attribute and Union 3D operation: (a) Building patches with cZ0.00001 ppm at t¼500 s after release of the tracer gas. Here each patch is a triangle;(b) An isosurface of gas plume with c¼0.00001 ppm and t¼500 s after release of the trace gas; (c) Before 3D union operation, the entire building shell is formed by fifteenparts; (d) After 3D union operation, the entire building shell is formed by only one patch.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115114

Page 12: An ArcScene plug-in for volumetric data conversion, modeling and spatial analysis

Acknowledgments

This work was partially supported by the College of Science,George Mason University. We thank anonymous reviewers fortheir constructive comments.

References

Abdul-Rahman, A., 1992. Triangular Irregular Network in Digital Terrain ReliefModelling (M.Sc. thesis). ITC, Enschede, The Netherlands, 80pp.

Abdul-Rahman, A., Pilouk, M., 2008. Spatial Data Modelling for 3D GIS. SpringerVerlag, Berlin Heidelberg p. 289.

Allwine, K.J., Flaherty, J.E., 2006. Join urban 2003: study overview and instrumentlocations. Pacific Northwest National Laboratory, Oak Ridge.

Camelli, F., S. R. Hanna, R. Lohner, 2006. FEFLO CFD model study of flow anddispersion as influenced by tall buildings in New York City. In: Proceedings ofthe Sixth Symposium on the Urban Environment, Atlanta, GA, AmericanMeteorological Society.

Camelli, F., 2002. Study of Atmospheric Dispersion at Building and Street Scales(Doctoral thesis). George Mason University, 236pp.

Camelli, F., Lien, J.M., Shen, D., Wong, D.W., Rice, M., Löhner, R., Yang, C., 2012.Generating seamless surfaces for transport and dispersion modeling in GIS.Geoinformatica 16 (2), 307–327.

ESRI, 1998. ESRI Shapefile Technical Description. An ESRI White Paper, July 1998,34pp.

ESRI, 2002. ESRI Training Materials, Advanced ArcObjects Component Developent II(Cþþ), 24pp.

ESRI, 2010. ArcGIS desktop 10 help. ⟨http://help.arcgis.com/en/arcgisdesktop/10.0/help/⟩ (accessed 28.04.12).

Jiang, B., 2008. Design and implement plug-in type GIS application frameworkbased on C# and ArcGIS Engine9.2. Beijing: Electronic Industry Press, 257pp(in Chinese).

Kelk, B., Challen, K., 1992. Experiments with a CAD package for spatial modelling ofgeo-scientific data. In: Vinken, R. (Ed.), From Digital Map Series in Geosciencesto Geo-Information Systems. Geologisches Jahrbuch, Reihe A, Heft 22,Hannover, Germany, pp. 145–153.

Kitware, Inc., 2010. VTK User's Guide, 11th Edition Kitware, Inc., NY, USA, p. 536.

Li, D., Wang, M., Hu, Q., Hu, F., 2009. On three-dimensional visualization ofgeospatial information: graphics based or imagery based? Annals of GIS 15(2), 75–84.

Mallet, J., 1989. GOCAD: a computer aided design program for geological applica-tions. In: Turner, K.A. (Ed.): Three-Dimensional Modelling With GeoscientificInformation Systems. Series C, Vol. 356 of the NATO ASI Series. KluwerAcademic Publishers, Golden, CO, pp. 123–142.

Midtbø, T., 1996. Spatial Modelling by Delaunay Networks of Two and ThreeDimensions (Ph.D. thesis). Norwegian Institute of Technology. University ofTronheim, Norway, ⟨http://guran1.iko.unit.no/home/terjem/terjem.html⟩(accessed 28.04.12).

Oosterom, P.J.M., van; Stoter, J., Jansen, E., 2006. Bridging the worlds of CAD andGIS. In: Zlatanova, S., Prosperi, D. (Eds.), Large-Scale 3D Data Integration—Challenges and Opportunities. Taylor & Francis, London, pp. 9–36.

Orlic, B., 1997. Predicting Subsurface Conditions for Geotechnical Modelling (Ph.D.thesis). ITC, The Netherlands, pp. 192.

Shen, D., Ma, A., Lin, H., Nie, X., Mao, S., Zhang, B., Shi, J., 2003. A new approach forsimulating water erosion on hillslopes. International Journal of Remote Sensing24 (14), 2819–2835.

Shen, D., Takara, K., 2006a. A modelling and 3-D simulation system for watererosion on hillslopes—M3DSSWEH. Journal of Hydraulic Research 44 (5),674–681.

Shen, D., Takara, K., Tachikawa, Y., Liu, Y., 2006b. 3D simulation of soft geo-objects.International Journal of Geographical Information Science 20 (3), 261–271.

Shi, W., 2000. Development of a hybrid model for three-dimensional GIS. Geo-spatial Information Science 3 (2), 6–12.

Tao, J., 2009. A new integrated data structure for 3D GIS based on CSG and TIN.In: Proceedings of the 2009 International Conference on Test and Measure-ment, ICTM 2009, December 5–6, 2009, Hong Kong, pp. 153–156.

Taylor, G., Fairbairn, D.J., Parsley, S., 2000. The phoenix algorithm for threedimensional data capture. Photogrammetric Record 16 (96), 1007–1021.

Warmerdam, F., 2012. Shapefile C Library. ⟨http://shapelib.maptools.org/⟩ (accessed28.04.12).

Wen, Y., Liu, Y., 2010. An isoline generating algorithm based on Delaunay. In:Proceedings of 2nd International Conference on Computer Engineering andTechnology, 7, April 16–18, 2010, Beijing, China, pp. V7-173–V7-176.

Wong, D.W., Camelli, F., Sonwalkar, M., 2007. Integrating computational fluid dynamics(CFD) models with GIS: an evaluation on data conversion formats. In: SPIE (Ed.),Geoinformatics 2007: Geospatial Information Science China. International Societyfor Optical Engineering, Washington, USA, http://dx.doi.org/10.1117/12.761763.

Fig. 15. A 3D influence area with a radius of 300 m around the source of release extracted by using WITHIN_A_DISTANCE_3D operation. In the figure, the source of releasehas the maximum level of concentration. 3D Buildings and terrain surfaces where have been influenced are clearly marked with different levels of concentrations.

D. Shen et al. / Computers & Geosciences 61 (2013) 104–115 115