Table Of Contents

Previous topic

Importing data

Next topic

Geometric operations

This Page

Creating data

new empty layer

clusterpy0_9_9.clusterpy.new()

Creates an empty Layer

Description

Use this function to create an empty layer. This allows the user to create his own maps.

Return type:Layer (new empty Layer)

Examples

import clusterpy
lay = clusterpy.new()

Create a regular distribution of points

clusterpy0_9_9.clusterpy.createPoints(nRows, nCols, lowerLeft=(0, 0), upperRight=(100, 100))

Creates a new Layer with uniformly distributed points in space

Parameters:
  • nRows (integer) – number of rows
  • nCols (integer) – number of cols
  • lowerLeft (tuple or none) – lower-left corner coordinates; default is (0,0)
  • upperRight (tuple or none) – upper-right corner coordinates; default is (100,100)
Return type:

Layer (new points layer)

Description

The example below shows how to create a point-based regular grids with clusterPy.

Examples

Creating a grid of ten by ten points.:

import clusterpy
points = clusterpy.createPoints(10, 10)

Creating a grid of ten by ten points on the bounding box (0,0,100,100).

import clusterpy
points = clusterpy.createPoints(10, 10, lowerLeft=(0, 0), upperRight=(100, 100))

create a regular lattice of polygons

clusterpy0_9_9.clusterpy.createGrid(nRows, nCols, lowerLeft=(0, 0), upperRight=(100, 100))

Creates a new Layer with a regular lattice

Parameters:
  • nRows (integer) – number of rows
  • nCols (integer) – number of columns
Return type:

Layer new lattice

Description

Regular lattices are widely used in both theoretical and empirical applications in Regional Science. The example below shows how easy the creation of this kind of maps is using clusterPy.

Examples

Create a grid of ten by ten points.:

import clusterpy
points = clusterpy.createGrid(10,10)

Create a grid of ten by ten points on the bounding box (0,0,100,100).:

import clusterpy
points = clusterpy.createGrid(10, 10, lowerLeft=(0, 0), upperRight=(100, 100))