SketchUp models in 3DVIA Scenes

Cliff Medling is my counterpart over at Dassault Systèmes; he’s the Evangelist for 3DVIA. Since we’re both in the business of spreading the word about the power and glory of 3D modeling (regardless of which tool you choose), we figured it would be productive to work together from time to time.

The first fruit of this collaboration is a video that Cliff made specifically for SketchUp modelers. It shows how to use 3DVIA Scenes to explore an imported SketchUp model by walking around inside it. The killer app (in my opinion) is a feature that lets multiple people explore the same model simultaneously as avatars. SketchUp’s Walk Tool offers a similar, first-person experience, but having the model online and accessible to anyone with a web connection is enormously powerful.

Two things: Cliff tells me that Mac compatibility for 3DVIA Scenes is on its way. Also, the clever folks over at Dassault have built an iOS app (for Apple mobile devices) that lets you view and interact with models you’ve uploaded to 3DVIA.com. Since COLLADA (.dae) is one of the formats they accept, you can use these apps to view SketchUp models, too. 3D everywhere!

Dev Tip of the Week: Using Bing Maps with SQL Server spatial

SQL Server 2008 and SQL Azure databases support spatial data types, including spatial data indexes and queries. My company, OnTerra, has developed a tool we call AJAX Map DataConnector that helps make developing spatial maps with SQL Server 2008 and SQL Azure on Bing platforms quite simple. DataConnector’s open-source framework allows you to get started quickly, reuse existing code/best practices, and focus on your application requirements and data.

For example, many mapping applications involve storing latitude and longitude data as extra fields in relevant database tables. An individual location could be an address (which could be geocoded using the Bing Maps geocoder). It could also be more complex data like country or state polygons. Spatial data gets stored in the spatial data types using functions like STTextAsGeom(), which converts textual location data to binary spatial data types.

Aside: For complex data loading scenarios I would recommend that you consider using FME (Feature Manipulation Engine) from Safe Software (www.safe.com).

So you have spatial data in SQL Server spatial, what now? Well, there is no direct integration between SQL Server/SQL Azure and Bing Maps. This is mostly because SQL Server is server-side and Bing Maps is a client-side technology. To build web mapping applications, developers need to bring these technologies together. Architecture has much in common with the standard tiered web application, with database, Data Access Layer (DAL), web server, and client UI. However, there are some key differences for web mapping applications.

Client UI is fundamentally the map, and can be implemented using Bing Maps AJAX or Silverlight map controls. The UI displays spatial data and handles user interaction and queries. A DAL would then typically reside on the web server to connect the DB and client UI. The DAL is important because it processes queries from the client, queries the DB, and then performs data conversions. Spatial data from SQL Server is returned as Well Known Text (or other formats like WKB or GML). The WKT data includes strings of data representing points, lines, and polygons. Latitude and longitude fields are part of the strings. The client UI, however, cannot easily take WKT. So either the client or the DAL must convert it.

If the client is AJAX, this could be done using GeoJSON, a JavaScript-based format for storing geospatial data. (See figure 1 for an example client UI.) JSON has the advantage of being more easily processed by JavaScript code and less verbose than XML and others. You should consider limiting the amount of data returned via this method to a few thousand (varies based on browser performance). To load larger amounts of data consider raster tile layers.

Figure 1 – Query/display of spatial data in Bing Maps AJAX using GeoJSON.

clip_image002

The DataConnector projects on Codeplex provide a lot of the pieces of this architecture including sample databases, DAL, and client UI. Recently we released an AJAX version using the Bing Maps AJAX 7.0 API (http://ajaxmapdataconnector.codeplex.com). See figure 2 for details on the elements.

Figure 2 – AJAX Map DataConnector architecture.

We hope that you find the AJAX Map DataConnector to be a useful tool that makes your development process faster and easier. As always, we’ll be watching comments to catch any feedback or questions that you have.

–Steve

Steve Milroy is CEO and cofounder of OnTerra Systems (http://www.onterrasystems.com) and an expert with Location Based Services and geospatial solutions. Steve has presented at developer conferences, user groups, and business associations on many emerging technology solution and development topics.