Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for binary Leica XCF / DBX format #38

Open
steko opened this issue Feb 24, 2015 · 11 comments
Open

Add support for binary Leica XCF / DBX format #38

steko opened this issue Feb 24, 2015 · 11 comments

Comments

@steko
Copy link
Collaborator

steko commented Feb 24, 2015

Leica 1200 series total stations output a file-based raw data format, that is binary (not ASCII) and is recognizable by the presence of an "index" file with the .XCF extension. Other files in the archive correspond to jobs and have file extensions such as .X01, .X02 and so on.

This is a binary, undocumented file format.

Sample files are attached, graciously provided by Anna Hodgkinson (Anna Hodgkinson) and Hannah Petten.

See also:


@steko steko added this to the future milestone Feb 24, 2015
@steko
Copy link
Collaborator Author

steko commented Feb 24, 2015

From Stefano Costa on 2013-05-03 17:40:30+00:00

Issue #33 was marked as a duplicate of this issue.

@steko
Copy link
Collaborator Author

steko commented Feb 24, 2015

From Stefano Costa on 2013-05-03 17:48:25+00:00

See the comment by filip klosowski posted here:

It is very problematic issue because of proprietary format. Some CAD programs can import and export Leica DBX but usually using printfpc- Leica commandline tool and Leica dll libraries. This tool can convert DBX to ASCII using special format template that one creates with LGO's format manager utility. However reversing DBX would be the coolest way you can choose, the best and the most realistic solution would be non-disclosure agreement with Leica Geosystems - maybe they would let you use printfpc as an addon. As soon as you break DBX format, Leica will persuade you to hide source:(

@steko steko removed the prio:low label Feb 28, 2015
@steko
Copy link
Collaborator Author

steko commented Apr 26, 2016

The attached zip file contains the DBX / XCF data mentioned above, provided by Anna Hodgkinson and Hannah Petten.

GUDEM040412_1463_0404_074043.zip

@Mizaro
Copy link

Mizaro commented Mar 5, 2017

Hello, I'm trying to create a automation to a process I'm doing on LGO program. My source files are of XCF, XDB,M00 types and I have a problem reading them in python.
I saw an issue about this formats in github.
steko have quoted "filip klosowski" and filip said that "using printfpc- Leica commandline tool and Leica dll libraries". I'm interested in this commandline tool, Can you please help me?

@psolyca
Copy link
Collaborator

psolyca commented Mar 6, 2017

I do not have it. This tool should be packaged with Leica soft. So it is difficult to get unless you know someone with Leica soft.

@steko steko modified the milestones: v0.6, future Dec 3, 2019
@coolsheets
Copy link

SBG has Leica tools available to download here: https://sbg.se/en/downloads/geo/

@steko
Copy link
Collaborator Author

steko commented Sep 5, 2023

If there's a chance we support this format in the future, we need more sample data. Anyone who has data data in this format is welcome to attach it here as a ZIP file 🤓

@fklosowski
Copy link

I succefully added Leica DBX support to my GPS analytics application using printfpc and frt file. Trimble has very similar soultion as well, so at this point my python application handles propritetary Leica DBX and Trimble JOB formats.

@steko
Copy link
Collaborator Author

steko commented Feb 19, 2024

I succefully added Leica DBX support to my GPS analytics application using printfpc and frt file. Trimble has very similar soultion as well, so at this point my python application handles propritetary Leica DBX and Trimble JOB formats.

Thanks! Could you contribute one or two sample data sets? That would be very helpful. Is your application available by the way?

@fklosowski
Copy link

I have many samples but only GPS survey inside, no TPS data. In regards of adding support for Leica DBX or Trimble job proprietary formats, it is possible only for Windows because PrintfPC and Trimble AsciiFileGenerator are available for Windows only.

@fklosowski
Copy link

    outpath = './_app_files/csv_outputs/jobcsv.txt'
    xslpath = './_app_files/WGS84 format.xsl'
    fpath = Path(f).suffix
    print os.path.abspath(f), os.path.abspath(xslpath), os.path.abspath(outpath)
    if fpath == '.jxl':
        print 'Trying to process Trimble Job JXL file'
    if fpath == '.job':
        print 'Trying to process Trimble Survey Controller Journal'
    try:
        report = subprocess.Popen([".\utils.dll", os.path.abspath(f), os.path.abspath(xslpath), os.path.abspath(outpath)], shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        ret_code = str(report.stdout.readline())
        report.wait()
        print 'Trimble Job conversion return code: ', report.returncode

        if report.returncode == 0:
            idx = 0
            with open(os.path.abspath(outpath), 'rb') as data_csv:
                for row in csv.reader((line.replace('\0','') for line in data_csv), delimiter=','):
                    if row and not any(char.isalpha() for char in clear_non_ascii(row[0])):
                        name = clear_non_ascii(row[0])
                        B = row[1].strip()
                        L = row[2].strip()
                        H = row[3].strip()
                        idx += 1
                        csv_writer.writerows([[name, B, L, H]])
            points_dataset.seek(0)
            print 'Points loaded: '+ str(idx)
    except:
        print 'Trimble Job conversion failed'```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants