goGPS-Project/goGPS_Java

Add DTM Module

Opened this issue · 8 comments

The DTM module is missing from goGPS Java. Actually I would be happy just with adding a "soft constraint" to make an under-determined system a full rank one, or to make a full rank system over-determined, perhaps based on an a priori estimate of height.
I'm not sure how that works with the design matrix in ECEF coordinates.

I've had some success at adding a soft constraint on height, while using the WGS84 model (so not precise at all, but it's a start). The Matlab code was the inspiration. Here's a snippet:

    nObsAvail += 1;
    ....
    double lam = Math.toRadians(recpos.getGeodeticLongitude());
    double phi = Math.toRadians(recpos.getGeodeticLatitude());
    double cosLam = Math.cos(lam);
    double cosPhi = Math.cos(phi);
    double sinLam = Math.sin(lam);
    double sinPhi = Math.sin(phi);
    double[][] data = new double[1][3];
    data[0][0] = cosPhi * cosLam;
    data[0][1] = cosPhi * sinLam;
    data[0][2] = sinPhi;

    k = nObsAvail-1;
    A.set(k, 0, data[0][0] );
    A.set(k, 1, data[0][1] ); 
    A.set(k, 2, data[0][2] ); 
    A.set(k, 3, 0 ); 
    A.set(k, 4, 0 );

    //      %Y0 vector computation for DTM constraint
    //      y0_dtm = h_dtm  - hR_app + cos(phiR_app)*cos(lamR_app)*X_app + cos(phiR_app)*sin(lamR_app)*Y_app + sin(phiR_app)*Z_app;
    y0.set(k, 0, 0 );

I've set y0_dtm to zero for now

Nice!!
I'll test it as soon as I have some free time :)
On Apr 7, 2015 6:33 AM, "Emanuele Ziglioli" notifications@github.com
wrote:

I've had some success with adding a soft constraint on height, while using
the WGS84 model (so not precise at all, but it's a start). The Matlab code
was the inspiration. Here are some snippets:

double lam = Math.toRadians(recpos.getGeodeticLongitude());
double phi = Math.toRadians(recpos.getGeodeticLatitude());
double cosLam = Math.cos(lam);
double cosPhi = Math.cos(phi);
double sinLam = Math.sin(lam);
double sinPhi = Math.sin(phi);
double[][] data = new double[1][3];
data[0][0] = cosPhi * cosLam;
data[0][1] = cosPhi * sinLam;
data[0][2] = sinPhi;

k = nObsAvail-1;
A.set(k, 0, data[0][0] );
A.set(k, 1, data[0][1] );
A.set(k, 2, data[0][2] );
A.set(k, 3, 0 );
A.set(k, 4, 0 );

//      %Y0 vector computation for DTM constraint
//      y0_dtm = h_dtm  - hR_app + cos(phiR_app)*cos(lamR_app)*X_app + cos(phiR_app)*sin(lamR_app)*Y_app + sin(phiR_app)*Z_app;
y0.set(k, 0, 0 );

I've y0_dtm to zero for now

Reply to this email directly or view it on GitHub
#10 (comment).

That's for a standalone type of positioning, I don't think Matlab does that yet.
So in y0 it goes only the difference between DTM height and approximate height, rather than the full distance from the center of the earth. (Correct me if I'm wrong).

PS Correction, I've found DTM is implemented in the standalone case too, see:
http://sourceforge.net/p/gogps/code/HEAD/tree/trunk/positioning/kalman/goGPS_KF_SA_code_phase_loop.m#l217

       y0_dtm = h_dtm + cos(phi_app)*cos(lam_app)*X_app + cos(phi_app)*sin(lam_app)*Y_app + sin(phi_app)*Z_app - h_app;

In my case y0_dtm = h_dtm - h_app

I'm thinking about adding a generic interface for a "DTM provider", so that we could plug different services without the need to add dependencies to the main goGPS project.

Is DTM support in goGPS/Matlab tied to the main code or is it generic enough to be replaced by a different service?

In goGPS MATLAB, the DTM module is not generic at all, meaning that it needs to first "digest" DTM raster files (in ASCII GRID format) to subdivide them into tiles (in its own "custom" format). It does not use any online service.

So I like the Java approach better then :-)
It sounds like there's no standard definition for a raster file, am I right? I'm not familiar with this topic at all .
I wonder whether the soon-to-be-opensourced Google Earth Enterprise could be useful:
https://maps-apis.googleblog.com/2017/01/open-sourcing-google-earth-enterprise.html?m=1
https://cloud.google.com/storage/docs/public-datasets/

What we could do (more plans...) perhaps would be to provide an API and documentation to make it easier for people to add any third party elevation service .

@mrgoce (Mirko) suggested that also the IDEMS service by the International Association of Geodesy could be of interest: http://www.cse.dmu.ac.uk/EAPRS/iag/

Sorry, I got the old site, this is the new link from Mirko: https://idems.maps.arcgis.com/home/index.html