Load a ClusterPy project (<file>.CP)
| Parameters: |
|
|---|---|
| Return type: | Layer |
| Returns: | CP project |
Description
With clusterPy you can save your layer objects on a .cp file, which can be reopened in the future using this function.
Examples
import clusterpy
lay = clusterpy.new()
lay.save("lay")
layer = clusterpy.load("lay")
Creates a new Layer from a shapefile (<file>.shp)
| Parameters: |
|
|---|---|
| Return type: | Layer (CP project) |
Description
ESRI shapefile is a binary file used to save and transport maps. During the last times it has become the most used format for the spatial scientists around the world.
On clusterPy’s “data_examples” folder you can find some shapefiles. To load a shapefile in clusterPy just follow the example bellow.
Example
import clusterpy
china = clusterpy.importArcData("clusterpy/data_examples/china")
Reads the geographic information stored in a shape file and returns them in python objects.
| Parameters: |
|
|---|---|
| Return type: | tuple (coordinates(List), Wqueen(Dict), Wrook(Dict)). |
Example
import clusterpy
chinaAreas = clusterpy.importShape("clusterpy/data_examples/china.shp")
Get variables from a dbf file.
| Parameters: |
|
|---|---|
| Return type: | tuple (dbf file Data, fieldNames and fieldSpecs). |
Example
import clusterpy
chinaData = clusterpy.importDBF("clusterpy/data_examples/china.dbf")
Get variables from a csv file.
| Parameters: |
|
|---|---|
| Return type: | tuple (csv file Data, fieldnames). |
Example
import clusterpy
chinaData = clusterpy.importCSV("clusterpy/data_examples/china.csv")