2.23.6.1. pycsamt.format.pointset#
PCPT - pyCSAMT Points: a tiny format for targets and points of interest.
PCPT is deliberately small. It carries a flat list of named positions -
drill targets, planned collars, samples, anomalies, generic markers -
each with a location and optional depth window, so a map or a 3-D scene
can be annotated independently of a full pycsamt.format.borehole
document. No trajectory, no interval logs, no vocabularies.
Canonical encoding is UTF-8 JSON, canonical extension .pcpt.json.
CSV and spreadsheet importers resolve the same canonical fields through
a small alias table.
Functions
|
Build and validate a |
|
Return a canonical JSON-safe dict for point_set. |
|
Import a points CSV (one point per row). |
|
Import points from one worksheet of an |
|
Read a |
|
Write point_set as canonical |
Classes
|
One named position with an optional depth window. |
|
A validated flat list of points sharing one CRS. |
Exceptions
Raised when a PCPT document fails validation. |
- class pycsamt.format.pointset.Point(id, name='', x=None, y=None, longitude=None, latitude=None, z=None, depth_top=None, depth_bottom=None, kind='poi', symbol='circle', color=None, note='', category='', properties=<factory>)[source]
Bases:
PyCSAMTObjectOne named position with an optional depth window.
- Parameters:
- id: str
- name: str = ''
- kind: str = 'poi'
- symbol: str = 'circle'
- note: str = ''
- category: str = ''
- class pycsamt.format.pointset.PointSet(document_id, created_at, created_by, crs, points, pcpt_version='0.1.0', title='', description='', metadata=<factory>)[source]
Bases:
PyCSAMTObject,MetadataMixinA validated flat list of points sharing one CRS.
- Parameters:
- document_id: str
- created_at: str
- created_by: str
- crs: str
- pcpt_version: str = '0.1.0'
- title: str = ''
- description: str = ''
- validate()[source]
Validate object state.
Subclasses can override this hook. The base implementation intentionally accepts all states.
- Return type:
None
- exception pycsamt.format.pointset.PointSetValidationError[source]
Bases:
ValueErrorRaised when a PCPT document fails validation.
- pycsamt.format.pointset.read_points(path)[source]
Read a
.pcpt.jsonfile.
- pycsamt.format.pointset.write_points(point_set, path)[source]
Write point_set as canonical
.pcpt.json.
- pycsamt.format.pointset.points_from_csv(path, *, columns=None, crs=None, document_id=None)[source]
Import a points CSV (one point per row).
- pycsamt.format.pointset.points_from_xlsx(source, *, sheet=None, header_row=None, columns=None, crs=None, document_id=None)[source]
Import points from one worksheet of an
.xlsxworkbook.
- pycsamt.format.pointset.point_set_to_dict(point_set)[source]
Return a canonical JSON-safe dict for point_set.