Saturday, 10 November 2012

Exporting video from ArcGIS to Lightworks


In the past I have used Microsoft Movie Maker for video editing. Like many Microsoft products it was relatively easy to use, but quite limited functionality. It also had an unfortunate tendency to crash and refused to load when I tried to install it on my current laptop. Rather than deal with the installation problem I decided to try the free Lightworks video editing suite instead. Much of my contents comes from ArcGIS animations, so how do you go get high-definition video out of ArcGIS and into Lightworks?

Lightworks currently only supports some free and open video codecs. Codecs are implementations of video storage and compression algorithms. Video 'formats' such as AVI (.avi) and MOV (.mov) are wrappers around these codecs. To play or edit video files an appropriate codec must be installed and the software support the format. Other issues, such a frame rates may also be important as I discovered.

How I export HD video from ArcGIS to Lightworks:
  • In ArcGIS:
    1. Make you animation 20% longer than you want it to be as the conversion process will speed up the video by 20%.
    2. From the Animation Toolbar, Export animation.
    3. In the Export animation dialog, open the Options... dialog. Check Use custom extents under Video Resolution, then set the Horizontal resolution to 1440 and Vertical Resolution to 1080. These are the dimensions required by the to render the video using the MPEG-2 I-frame HD codec in 1440×1080i/p format. Codec resolution information is on page 2 in Using the Matrox VFW Software Codecs. Also set Frame based video export to the full range of frames.
    4. Export, then in the Video Compression dialog select the Matrox MPEG-2 I-frame HD codec.
    5. Click OK to export.

ArcGIS Video Export Options dialog

There is however a problem. Despite being in a format and codec supported by Lightworks, Lightworks only supports video with a frame rate of at least 25fps. ESRI help indicates that the frame rate can be set from 1 -100, but I have been unable to change from the default 20 fps. Instead, I use VirtualDub 1.9.11 to change the frame rate.

    1. Open VirthualDub.
    2. From the File menu, Open video file.
    3. From the Video menu, Frame Rate. Set Source rate adjustment to Change frame rate to (fps) to your desired rate; 25 in this case. Also set Frame rate conversion to the desired rate. I suspect the first is not really need.
    4. From the Video menu, select Compression and select the within the dialog select the Matrox MPEG-2 I-frame HD codec.
    5. From the File menu, Save as AVI.

VirtualDub Frame Rate Control
VirtualDub Compression
  • Open Lightworks
    1. Create a project with your frame rate. 25 fps in this case.
    2. Click on the Project Name to open the Project settings menu. Select the Video tab and set the Format to 1080i 25fps.
    3. You can now import you video.
    4. It will however be 20% quicker than the time set in ArcGIS.



Wednesday, 9 May 2012

London Congestion Charge Zone as GIS data

So, I ask Transport for London whether the London Congestion Charge Zone is available as a GIS file, and if not, why not? 

I get a letter back, telling me no, but asking if I have any suggestions. Wake up TFL!



Tuesday, 3 April 2012

How to get the extent of a PostGIS table

Here are two way to query the spatial extent of a PostgreSQL/PostGIS table.

For a table bc_roads in the bc schema with a geometry column the_geom...

To get the extent as a Well-known text (WKT) box:

SELECT Extent(the_geom) AS extent FROM bc.bc_roads;

To get the extent as xmax, xmin, ymax, ymin as fields:

SELECT ST_XMax(r) AS xmax, ST_XMin(r) AS xmin, ST_YMax(r) AS ymax, ST_YMin(r) AS ymin FROM  (SELECT ST_Collect(the_geom) AS r FROM bc.bc_roads) AS foo;




Monday, 26 March 2012

Leica Cyclone Back Compatability 7.2 to 6.0

In the school of Geography, Geology and the Environment, Kingston University London, we are running Leica Geosystems Cyclone 6.0 on our network, but 7.2 on the Panasonic Toughbook we use with our Leica ScanStation 2 3D scanner. Unfortunately, the 7.2 database is not compatible with older versions, so to get the data out of 7.2 and into 6.0 it must be exported as a point cloud .ptx file and re-imported. It has taken me a little while to work out how to do this as instructions appear to be somewhat limited.

The Export command in Cyclone Navigator seemed a good place to start, so I searched the database directory tree till it became active, which was when I selected a ModelSpace View.




An Export to File dialog is presented, followed by the Export Options dialog, but this just resulted in an exception. Foiled!

It appears, data can only be exported from within an open ModelSpace View using File Export, checking Visible or Selected in the Export Options depending on which data you wish to export.


Importing into version 6.0 is very straightforward. Create a new Cyclone database, then right-click and Import. Select one of your .ptx files and Merge or keep Separate multiple clouds as required.


The point clouds are now in Cyclone 6.0.


There are MultiImages associated with the scans, however, so far I have been unable to convert these. I can  export them from 7.0 as individual images, but get an error in 6.0 when I try and create a new MultiImage folder in the Images folder. 


This is most unsatisfactory, but will have to wait for another day.


Thursday, 3 November 2011

Pattern in the geographical orientation of diversification

In 'Guns, Germs and Steel' Jared Diamond argued that European technological advance was enhanced by the East-West orientation of Eurasia which allowed domesticated animals and plants to easily migrate, as ecological conditions are generally more similar to the east and west than to the north and south. I wondered if this increased motility would lead to more or less diversification? Increased motility may result in larger ranges and hence a greater probability of vicariance (splitting and diversification). Alternatively, mobility may prevent divergence through increased admixture. Perhaps the relative importance of these factors changes through time?

To investigate this question, I calculated the bearing between the geographical centroid of the ranges of terrestrial mammal sister clades. I classified the lines connecting range centroids as north-south or east-west and plotted them on a map and as a temporal histogram.


North-South diversification is most common in South America (except the Atlantic coast), Western North America, Sub-Saharan Africa, S.E. Asia and Western Australia - New Guinea, but much rarer in Eurasia and the majority of North America. East-West diversification occurs everywhere, except polar regions. Glaciations will have severely eroded pattern in northern latitudes, but why is north-south diversification uncommon in western South America and Eastern Australia?

Interestingly, over the last 50 million years the frequency of east-west diversification has been consistently 2.5-3 times more frequent than north-south diversification. Temporal slicing of the map (not shown, but see) shows that pattern does vary though time with east-west connections between southern continents being more common further back it time - traces of the breakup of Gondwana.

So, these data seem to show that, yes, diversification is more 2-3 time more common east-west than north south, and that this pattern has been consistent in mammals for the last 50 million years. It also shows there is considerable geographical variation in north-south diversification, possibly related to recent environmental change destroying pattern.

Friday, 14 October 2011

GeoPhyloBuilder for ArcGIS 10

The labs here at the Silwood Park campus of Imperial College are still running ArcGIS 9.3, but with our recent license renewal I finally decided it was time for me to personally upgrade to v10 and recompile GeoPhyloBuilder.

Following the instructions from ESRI upgrading turned out to be pretty straight-forward. I just had to remove and re-add the ESRI.ArcGIS references (they are now in C:\Program Files\ArcGIS\DeveloperKit10.0\DotNet\), change the platform CPU target and change runtime binding from using the ESRI.ArcGIS.esriSystem.IAoInitialize class to the code generated by the ArcGIS License Initializer wizard. Amazingly it all worked.

The new version can be downloaded from SourceForge, I just need to work out how to make it the default download from the project page and sort the ssh key problem out that is preventing posting the code to the repository.