Python code for building a linkset using web and local resources.
currently only performs joins using point in polygon joining functions.
The link_creator users the following algorithm:
- Get a list of ids to process
- Loop through the ids in the list (multithreaded) 2.1 Get the point 2.2 Perform the point in polygon to obtain the ID from a reference dataset 2.3 Write the result to the file
The output file is a comma separated value (CSV) file, containing the following fields:
- An identifier for the established link
- An identifier for the item used to drive the joins
- An identifier for the corresponding item from the reference dataset
In the options below, the following are indicated in brackets:
- Polygon: indicates a parameter used for the Polygon model
- WFS: indicates a parameter used by the WFS specialisation of the Polygon model
- Model: indicates a parameter used by the Point model
The endpoint of the polygon
The name of the polygon geometry attribute
The name of the WFS layer to query
The name of the identifier attribute of the WFS layer
This is the namespace prefix for the WFS layer identifier, used to parse the XML returned
This is the namespace URL for the WFS layer identifier, used to parse the XML returned
The name of the WFS filter to apply (e.g., Contains, Intersects)
The model to use to drive linking. Choose from:
- DBModel: Use a database to drive the process
- LDAPIModel: Use the PyLDAPI Python Linked Data API to drive the process
The endpoint of the model to use to drive linking. When this is set to LDAPIModel, this is the endpoint of the register. When the model is set to DBModel, this will be the PostgreSQL connection string in the form:
dbname='<db_name>' user='<db_user>' host='<db_host>' password='<db_password>'.
The batch page to start from
The number of batches to run before stopping
The number of records to process as a batch each time
The file to write the results to
The number of threads to process simultaneously
A starting sequence to use for the identifier for each established link