Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Python API Load Tabular Data

Johannes Kolbe edited this page Jun 19, 2014 · 1 revision

Attribute Table

It is quite simple to load an attribute table in IlwisObjects from an existing Feature Coverage file. If you haven't already done so, you first need to initialize a new Feature Coverage. Once you have done that, you can simply extract it's attribute table by using the method .attributeTable(). The variable you assign it to will then automatically be of the type Table and you can use it for further processing.

Engine.setWorkingCatalog("file:///D:/<working>/<directory>/")
fc = FeatureCoverage("rainfall.shp")
table = fc.attributeTable()

Standalone Ilwis3 Table

If you already have a separate table file that you want to load in IlwisObjects you can simply do so by calling the table constructor Table() and pass it the name of your file. Take care that the working catalog is set to the folder where your file can be found, else it won't be able to load.

Engine.setWorkingCatalog("file:///D:/<working>/<directory>/")
table = Table("countries.tbt")

Standalone Gdal Table

The third way to create a Table object is similar to the Ilwis3 Table. But instead of using a separate table file you can simply use a file that contains a feature coverage which is linked to an existing table and pass it's name to the Table() constructor.

Engine.setWorkingCatalog("file:///D:/<working>/<directory>/")
table = Table("rainfall.shp")

Clone this wiki locally