Process layer using topojson.

def process_topojson(self, name, layer, input_path):
        """
        Process layer using topojson.
        """
        output_path = os.path.join(TEMP_DIRECTORY, '%s.topojson' % name)

        # Use local topojson binary
        topojson_binary = 'node_modules/bin/topojson'

        if not os.path.exists(topojson_binary):
            # try with global topojson binary
            topojson_binary = 'topojson'

        topo_cmd = [
            topojson_binary,
            '-o', output_path
        ]

        if 'id-property' in layer:
            topo_cmd.extend([
                '--id-property', layer['id-property']
            ])

        if layer.get('all-properties', False):
            topo_cmd.append('-p')
        elif 'properties' in layer:
            topo_cmd.extend([
                '-p', ','.join(layer['properties'])
            ])

        topo_cmd.extend([
            '--',
            input_path
        ])

        sys.stdout.write('* Running TopoJSON\n')

        if self.args.verbose:
            sys.stdout.write('  %s\n' % ' '.join(topo_cmd))

        r = envoy.run(' '.join(topo_cmd))

        if r.status_code != 0:
            sys.stderr.write(r.std_err)

        return output_path