Big Ideas

Getting Virtual

We recently paid a visit to some software colleagues in Oregon City. Since we’re in the business of mapping, you probably think we visited fellow digital cartographers, or maybe hung out with some javascript developers.
Here, I’ll give you a hint:

We went to visit the folks at SuperGenius Studio, a gaming development shop that specializes in virtual and augmented reality.

What would a mapping software company have in common with a gaming company? When you stop to think about it, virtual reality places great emphasis on the development of a powerful and richly defined sense of place. As virtual worlds expand in scope and detail, the techniques of mapping in the real-world may be applied to virtual space and they may be used to support navigation that is simultaneously in real and digitally crafted places. It’s a bit of a brain-stretch, I know, but the day is coming when we will have robust virtual worlds that co-exists with the real world.

Less of a brain-stretch and something that is is already upon us is augmented reality (AR). Pokémon Go is an example of gamified AR, where gamers use the camera in their phones to view the real-world and place virtual characters onto it. Google made an attempt to bring AR into the mainstream with Google Glass. It is no longer available to consumers, but while it was available, users could wear a set like they wear glasses and view contextual information within their field of view. Google is continuing to explore the technology in factories and other industrial settings.

The potential uses of VR and AR and their scope of application is growing exponentially with the progressive implementation of the “smart city,” with expansion of building information modeling (BIM) and through the ever-enriching network of  the internet of things (IOT) reporting out their status, condition and activity.

Imagine being a maintenance worker in an unfamiliar building and using your phone (or a pair of glasses) to “see” into a wall to find the utilities you are seeking out, planning your work or identifying the location of a hot spot, rupture or line break. Or maybe you’re a field crew supervisor in your office, donning goggles and “going down” to direct the work of  a technician while you examine a complicated arrangement underground assets they are working on.  Or you might be a firefighter with floor plans displayed in your field of view as you navigate smoke-filled hallways. These are examples of forthcoming scenarios where our expertise can complement the work of folks in the VR/AR space such as the crew at SuperGenius.

This field trip was the beginning of a discussion. No current VR/AR projects to report on just now, though we do have some prototyping and exploration work coming up. Mainly we just wanted to share some thoughts on trends and possibilities concerning this next major platform. ...and to show you how cool we look in the glasses.

 

 

 

Vector Tiles for All!!

What are vector tiles?

Vector tiles are packets of geographic data, packaged into pre-defined roughly-square shaped “tiles” for transfer over the web. As with the widely used raster tiled web maps, map data is requested by a client as a set of “tiles” corresponding to square areas of land of a pre-defined size and location. Unlike raster tiled web maps, however, the server returns vector map data, which has been clipped to the boundaries of each tile, instead of a pre-rendered map image.

Why should one use vector tiles?

Compared to an un-tiled vector map, the data transfer is reduced because only data within the current view, and at the current extent needs to be transferred. Vector tiles are also faster to download than a tiled raster map, as vector data is typically much smaller than a rendered bitmap.

Additionally, with a tool such as Mapbox GL JS, styling can be applied later in the process, or even in the browser itself, allowing much greater flexibility in how data is presented. It is also easy to provide interactivity with map features, as their vector representation already exists within the client. 

This is an example of a building footprint layer (from Oregon Metro) presented as vector tiles using Mapbox GL JS. The tiles are served quickly to the client, and using the Mapbox GL JS the data can be rendered in a variety ways. Here it’s being shown in 3D.

How do we use them?

Our crack team of developers has deployed a vector tile server that allows us to serve mbtiles raster files, mbtiles vector files, and ESRI bundled cache files. At this point, we are using it for most of our client-hosted applications. It’s a faster solution than anything we’ve used in the past, and it allows our dev team to create tools and functions in our JS-based Map Viewer that take advantage of the flexibility of the tiles.

We like to share

We submitted the code to GitHub for anyone to deploy.  At the core of the MBTiles server are dual instances of a node.js script that has been customized and offered to the public. Everything windows users need to get this up and running is included in the repository. The mbtiles server, the .NET reverse proxy, and the service creation scripts.

Once you’ve installed the MBTiles server, starting a web service is as simple as copying either raster or vector mbtiles files into the mbtiles cache directory. Setting up an ESRI bundled cache service is just as simple; copy the arcgis server cache directory to your mbtiles cache directory and you’re done!

Let us know what you think, or if you have any questions!

Links

The Gartrell Group MBTiles server 

Script to install windows services

The script that we forked in order to create the windows services script

 

Drag and Drop GIS

I dragged and dropped this image onto the blog postDrag and drop isn’t really anything new. The ability to drag a file across network has been with us for quite some time. Photoshop users are pretty comfortable with dragging elements from one layer to another and anyone using Word has likely done a little dragging and dropping. It’s practically ubiquitous at this point.
Except for within the world of GIS.

When was the last time that you dragged a shapefile onto a map? Never, you say?

Well, my (GIS nerd) friends, prepare for your world to be rocked!

Drag and Drop in Javascript is as easy as…

While developing the ESII Tool, it became clear that our clients would really love the ability to quickly swap out basemaps and possibly use some specialized georeferenced imagery, such as GeoTiffs and shapefiles. The ESII tool has two components; the web-based Project Workspace, where projects are planned, and the iPad app, where data collection is implemented. We wanted to be able to bring the drag and drop function to the Project Workspace, written in Javascript.

The exposure of the FileReader API in HTML5, now well supported by the Big 3 browsers, has allowed for fantastic ports of GIS format converters, including binary format converters. The ESRI Shapefile, and the GeoTiff are perhaps the 2 most staple formats of the GIS world representing vector and raster respectively. To be able to drop these data formats into a web map is indeed a miraculous feat for those of us who have whiled many an hour in the bad old days trying to bring these up on a monochrome CRT. Both the Shapefile and GeoTiff JavaScript libraries were obtained via GitHub.

At the heart of these conversions is support for Typed Arrays in JavaScript or rather, the ability to obtain ‘views’ into binary data. With the shapefile converter for example, the zipped file must first be decompressed (using the JsZip library), the PRJ file is then parsed and a proj4.js conversion function is created, then the DBF and SHP files are parsed (including the important differences in Endianness and any necessary projection functions) and converted to GeoJSON, a human-readable format. From there it’s just tossing the GeoJSON at your mapping API of choice and symbolizing as you like.

Drag and Drop your own file

We’ve provided a sample below for you to try your own drag and drop GIS. The widget will support up to 15 megabytes of geogoodness; the GeoTiff needs to be uncompressed and stored in WGS84, while the shapefile can either be zipped or, simply drop the .shp, .prj, and .dbf files on the map and see what happens!

If you don’t have a shapefile handy, you can download one from the RLIS Discovery site.

Set up an account with ESII and do more Drag and Drop GIS

Now that you’ve read about what we did – and dipped your toes into the water –  it’s time to try it for yourself. To get started, go to esiitool.com and sign up for an account. Once you’ve got an account set up, you’ll want to create a Site and a Data Collection Effort in a location that you have specialized georeferenced imagery. It is here, during this stage, that you can drag and drop a geotiff, or shape file onto your map and it will act as a layer that you can turn on or off.

Try it out for yourself.