© 2011 Bentley Systems, Incorporated 1 | Using VRT Files to Import ODBC, CSV Problem : Many data sources come in comma delimited or in Excel or database formats Solution : VRT files describe the data source so they can be easily imported into Bentley Map Notes: –Works best with point features –Capitalization is important in the various parameters
© 2011 Bentley Systems, Incorporated 2 | What is VRT (Virtual Datasource) An XML format file that describes the format of the source data –Data source –Feature name –Spatial Reference System –Field encoding Sample VRT SurveyMon.csv wkbPoint
© 2011 Bentley Systems, Incorporated 3 | SurveyMon.csv wkbPoint Common Parts of VRT file Name of feature
© 2011 Bentley Systems, Incorporated 4 | SurveyMon.csv wkbPoint Common Parts of VRT file Source for feature
© 2011 Bentley Systems, Incorporated 5 | SurveyMon.csv wkbPoint Common Parts of VRT file Feature Type
© 2011 Bentley Systems, Incorporated 6 | SurveyMon.csv wkbPoint Common Parts of VRT file Spatial Reference
© 2011 Bentley Systems, Incorporated 7 | SurveyMon.csv wkbPoint Common Parts of VRT file Encoding (Column names containing XY(Z) values)
© 2011 Bentley Systems, Incorporated 8 | CSV Example Source Data: SurveyMon.csv Easting,Northing,ID,Elevation , ,1, , ,2, , ,3, , ,4, , ,5, , ,6, , ,7, , ,8, , ,9, , ,10, VRT File SurveyMon.csv wkbPoint
© 2011 Bentley Systems, Incorporated 9 | The Map Interoperability Tool File -> Map Interoperability Import -> New Import Add file… Set All File Types Show Properties -> Ungrouped
© 2011 Bentley Systems, Incorporated 10 | Import the Data All headings from CSV are present, including system generated FID Set any WHERE clauses or spatial constraints Set any required symbology Import the data
© 2011 Bentley Systems, Incorporated 11 | Review the Imported Features Feature named correctly – Located at correct location – All other properties imported
© 2011 Bentley Systems, Incorporated 12 | specifies the geographic coordinate system (GCS) of the input data Examples are: – WGS84 – GEOGCS [ "GDA94", DATUM ["Geocentric Datum of Australia 1994 (EPSG ID 6283)", SPHEROID ["GRS 1980 (EPSG ID 7019)", , ]], PRIMEM [ "Greenwich", ], UNIT ["Decimal Degree", ]] A Note About Coordinate Systems
© 2011 Bentley Systems, Incorporated 13 | A Note About Coordinate Systems Because the GCS can be difficult to define, a simple workaround is to omit the GCS definition and import to a DGN to which the GCS of the data has been assigned. Reference to other DGN files or reassign GCS Sample data is MTM27-10 Import to DGN file with GCS defined as: Reassign GCS as required for transformation
© 2011 Bentley Systems, Incorporated 14 | Database and Spreadsheet Sources Require an ODBC connection to be setup which is specified in the data source parameter –SrcDataSource>ODBC:SurveyMonXLS Because there can be multiple tables or sheets in each source, an additional parameter is required – MonumentData This defines the table or range name in the source All other parameters remain the same
© 2011 Bentley Systems, Incorporated 15 | ODBC Example – Excel Spreadsheet Setup ODBC link to XLS file File must be in Excel 97 – 2003 format Data is as shown Range Name (MonumentData) defines the extent of the cells to import including the column headers
© 2011 Bentley Systems, Incorporated 16 | ODBC Example – Excel Spreadsheet VRT File ODBC:SurveyMonXLS MonumentData wkbPoint
© 2011 Bentley Systems, Incorporated 17 | ODBC Example – Access Database Setup ODBC link to MDB or ACCDB file Data table is as shown Source layer is the name of the table
© 2011 Bentley Systems, Incorporated 18 | ODBC Example – Access Database VRT File ODBC:SurveyMonMDB SurveyMon wkbPoint
© 2011 Bentley Systems, Incorporated 19 | Require a custom format for the data Geometry type is – wkbLineString – wkbPolygon For more information and examples: Linear and Polygon Sources top/f/5924/t/65028.aspx