NCAT API Endpoint wrapper for python.
Project description
ncat-python
A python wrapper for the NGS’s Coordinate Conversion and Transformation Tool (NCAT) API. More information about the API is available here.
Features
- Can make calls to all 5 NCAT services (LLH, SPC, UTM, XYZ, and USNG)
- Ensures required parameters for different NCAT services are present before making api call.
Installation
Using pip:
pip install ncat-api
Usage
To use the package:
import NCAT from ncatapi
Making Requests
LLH Request
Perform an LLH Service request.
from ncatapi import NCAT
ncat = NCAT()
response = ncat.llh({
'lat': 40.0,
'lon': -80.0,
'orthoHt': 99.0,
'inDatum': 'nad83(1986)',
'outDatum': 'nad83(2011)',
'inVertDatum': 'NGVD29',
'outVertDatum': 'NAVD88'
})
Sample Response:
{
'ID': '1664818932872',
'nadconVersion': '5.0',
'vertconVersion': '3.0',
'srcDatum': 'NAD83(1986)',
'destDatum': 'NAD83(2011)',
'srcVertDatum': 'NGVD29',
'destVertDatum': 'NAVD88',
'srcLat': '40.0000000000',
'srcLatDms': 'N400000.00000',
'destLat': '39.9999983008',
'destLatDms': 'N395959.99388',
'deltaLat': '-0.189',
'sigLat': '0.000263',
'sigLat_m': '0.0081',
'srcLon': '-80.0000000000',
'srcLonDms': 'W0800000.00000',
'destLon': '-79.9999976143',
'destLonDms': 'W0795959.99141',
'deltaLon': '0.204',
'sigLon': '0.000221',
'sigLon_m': '0.0052',
'heightUnits': 'm',
'srcEht': 'N/A',
'destEht': 'N/A',
'sigEht': 'N/A',
'srcOrthoht': '99.000',
'destOrthoht': '98.848',
'sigOrthoht': '0.005',
'spcZone': 'PA S-3702',
'spcNorthing_m': '76,470.391',
'spcEasting_m': '407,886.681',
'spcNorthing_usft': '250,886.607',
'spcEasting_usft': '1,338,208.220',
'spcNorthing_ift': '250,887.109',
'spcEasting_ift': '1,338,210.896',
'spcConvergence': '-01 27 35.22',
'spcScaleFactor': '0.99999024',
'spcCombinedFactor': 'N/A',
'utmZone': 'UTM Zone 17',
'utmNorthing': '4,428,235.878',
'utmEasting': '585,360.668',
'utmConvergence': '00 38 34.18',
'utmScaleFactor': '0.99968970',
'utmCombinedFactor': 'N/A',
'x': 'N/A',
'y': 'N/A',
'z': 'N/A',
'usng': '17SNE8536128236'
}
SPC Request
Perform an SPC Service request.
from ncatapi import NCAT
ncat = NCAT()
response = ncat.spc({
'northing': 173099.419,
'easting': 503626.812,
'spcZone': 2402,
'inDatum': 'nad83(2011)',
'outDatum': 'nad83(NSRS2007)'
})
USNG Request
Perform an USNG Service request.
from ncatapi import NCAT
ncat = NCAT()
response = ncat.usng({
'usng': '15SWB4788338641',
'inDatum': 'nad83(2011)',
'outDatum': 'nad83(NSRS2007)'
})
UTM Request
Perform an UTM Service request.
from ncatapi import NCAT
ncat = NCAT()
response = ncat.utm({
'northing': 4138641.144,
'easting': 547883.655,
'utmZone': 15,
'spcZone': 2401,
'inDatum': 'NAD83(2011)',
'outDatum': 'NAD83(NSRS2007)'
})
XYZ Request
Perform an XYZ Service request.
from ncatapi import NCAT
ncat = NCAT()
response = ncat.xyz({
'x': -217687.279,
'y': -5069012.406,
'z': 3852223.048,
'inDatum': 'NAD83(2011)',
'outDatum': 'NAD83(NSRS2007)'
})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ncat_api-0.0.2.tar.gz.
File metadata
- Download URL: ncat_api-0.0.2.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f8e4848bcc17dba0fd0443f9d718767f167afe5addcf755c9342686958fe339
|
|
| MD5 |
0dcdca73ed50746a9b7ecc3cc090e824
|
|
| BLAKE2b-256 |
05af443ec6ea93130838fa5fb404d1af43ef6a8b0d901d6ffc0a9ca899ffb5c5
|
File details
Details for the file ncat_api-0.0.2-py3-none-any.whl.
File metadata
- Download URL: ncat_api-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79a444a51232e8b8be230c9f3d33c512a07ab72ac74514f7bbf9607ae13e7558
|
|
| MD5 |
f9c4b60333d447de09d886bf007ca23b
|
|
| BLAKE2b-256 |
174716ff348bccb828fe0e986347850ca85259169ecbc684c1e1d0087c3f7a13
|