GeoComPy is a Python library providing wrapper functions for serial communication protocols of Leica surveying instruments.
The package is mainly built around the GeoCom ASCII protocol, supported by a number of total stations and other instruments running TPS1000, 1100, 1200 and other firmware. For some older instruments that do not support GeoCom, the GSI Online command set is used for communication.
- Download: https://pypi.org/project/geocompy/
- Documentation: https://geocompy.readthedocs.io/
- Source: https://github.com/MrClock8163/GeoComPy
- Bug reports: https://github.com/MrClock8163/GeoComPy/issues
- Pure Python implementation
- Support for type checkers
- Primitives for relevant data
- Command building and parsing through function calls
- Multiple supported protocols (e.g. GeoCom, GSI Online)
To use the package, Python 3.11 or higher is required. For the platform independent serial communication, GeoComPy relies on the pySerial package to provide the necessary abstractions.
The preferred method to install GeoComPy is through PyPI, where both wheel and source distributions are made available.
python -m pip install geocompy
If not yet published changes/fixes are needed, that are only available in source, GeoComPy can also be installed locally from source, without any external tools. Once the repository is cloned to a directory, it can be installed with pip.
git clone https://github.com/MrClock8163/GeoComPy.git
cd GeoComPy
python -m pip install .
The below example demonstrates how to connect to a GeoCom capable instrument through a serial connection. Once the connection is up and running, the total station is instructed to turn to horizontal 0, and position the telescope parallel to the ground.
from geocompy import (
Angle,
open_serial,
GeoCom
)
with open_serial("COM1") as comm:
tps = GeoCom(comm)
tps.aut.turn_to(Angle(0), Angle(90, 'DEG'))
GeoComPy is free and open source software, and it is distributed under the terms of the MIT License.