Skip to content

Latest commit

 

History

History
66 lines (42 loc) · 2.87 KB

spatial-reference-system-data.md

File metadata and controls

66 lines (42 loc) · 2.87 KB

#Spatial Reference System Data Product

Conversion requirements and input for conversion among gantry coordinate system, USDA GPS, and MAC GPS

Raw data comes with gantry coord (images, sites table) or MAC coord (UTM zone 12; tractor planting data and tractor sensor data). We need to convert them (directly or indirectly through functions) to USDA coord (UTM Zone 12 or EPSG:4326).

Gantry coord (x,y) is in meters and refer (0,0) to the bottom right of the gantry. MAC GPS is on all tractors; it has good precision but a static calibration error (2.5m discrepency); USDA GPS has similar precision and is accurate. Therefore, the geo coord we will concert to will all use USDA as reference.

  • UAV: georegistered to USDA
  • Tractor: uses MAC

Availability of reference data

Pylon coordinates in both MAC and USDA GPS; SE SW CW CE NW NE coord in MAC

Gantry --> MAC (G2M)

Given a gantry(x, y), the MAC(x, y) in UTM zone 12 is calculated using the linear transformation formula:

ay = 3659974.971 ; by = 1.0002 ; cy = 0.0078 ;

ax = 409012.2032 ; bx = 0.009 ; cx = - 0.9986 ;

Mx = ax + bx * Gx + cx * Gy

My = ay + by * Gx + cy * Gy

Note: Assume Gx = -Gx', where Gx' is the raw X coord (Gantry uses right --> left X axis).

MAC --> USDA (M2U)

We do a linear shifting to convert MAC coord in (lat, lon) to USDA (lat, lon):

Latitude: Uy = My - 0.000015258894

Longitude: Ux = Mx + 0.000020308287

The coefficients are calculated by averaging the difference of the four points in the linked excel sheet row 4-7.

TODO: confirm this formula with Andy.

Gantry --> USDA (G2U)

G2U = G2M + M2U

MAC --> Gantry (M2G)

This is done by inversing G2M. This formula can be used to convert tractor data to gantry coord.

Gx = ( (My/cy - ay/cy) - (Mx/cx - ax/cx) ) / (by/cy - bx/cx)

Gy = ( (My/by - ay/by) - (Mx/bx - ax/bx) ) / (cy/by - cx/bx)

Note: Assume left --> right X axis for Gx; need to do Gx' = -Gx to create X on Gantry's right --> left X axis.

Conversion b/w XY in meters and latlon for USDA

  • XY from USDA reference is in UTM zone 12 (either EPSG:32612 WGS 84 / UTM zone 12N or EPSG:26912 NAD83 / UTM zone 12N)
  • latlon projection code is EPSG:4326
  • The conversion b/w XY and latlon can be done by a lot of GIS software, e.g., PROJ4 (thus GDAL)

sites table processing

  • Input: gantry coord (x,y) for plot corner points
  • Output: postgis sql statements (.sql) with a geom column in USDA coord (G2U), plot id, gantry_x, gantry_y, ...

Gantry projection

Requirements

Projection definition

References

terraref/reference-data#51

Rcode

https://github.com/terraref/computing-pipeline/blob/master/scripts/geospatial/field_scanner_plots.R