geodesymiami / insarmaps

3 stars 0 forks source link

Do not add default values to URL #77

Open falkamelung opened 1 year ago

falkamelung commented 1 year ago

When I display a dataset without any options: http://129.213.120.104/start/19.5128/-155.5242/10.0522?flyToDatasetCenter=false&startDataset=CSK_SM_091_0000_20180916_XXXXXXXX_N19368_N19540_W155666_W155481

and then display a time series for a point and close it again (i.e. the plot does not change), the URL contains information start/end dates, previously selected points, color limits, etc: http://129.213.120.104/start/19.5128/-155.5242/10.0522?flyToDatasetCenter=false&startDataset=CSK_SM_091_0000_20180916_XXXXXXXX_N19368_N19540_W155666_W155481&minScale=-4&maxScale=4&pointLat=19.45755&pointLon=-155.55466&startDate=20180916&endDate=20211229

The user thinks that these values are important but they are just the defaults. Can we add only those options to the URL that differ from the default.?

This is in particular important for the reference point. When you try out different reference points but go back to the original one, reference point is still in the URL:

http://129.213.120.104/start/19.5128/-155.5242/10.0522?flyToDatasetCenter=false&startDataset=CSK_SM_091_0000_20180916_XXXXXXXX_N19368_N19540_W155666_W155481&minScale=-4&maxScale=4&pointLat=19.51062&pointLon=-155.55897&startDate=20180916&endDate=20211229&refPointLat=19.47878&refPointLon=-155.53844

This looks like a modified reference point, but it is actually the original one.

stackTom commented 1 year ago

I agree for the reference point it is important, as having a reference point in the URL will cause the special reference point recoloring to kick in (which is slower). Vs using the default reference point where no recoloring is even required.

However, the other ones don't really affect anything. Do we really need to omit the other ones?

I will fix the reference point one for the reason stated above, but the other ones will take some more time due to how I've implemented this custom url state feature and might be tedious to fix (will have to look at the code). Not sure if it's worth spending time on the other ones, but I can do it if you wish.

falkamelung commented 1 year ago

No problem. It is of low priority. Lets do it later if at all. One issue is that once a time series gets longer (S1 file 20200101-XXXXXXXX) the endDate is a pain. I have to strip off most options before saving/sending a URL but this is not too much a problem.

I thought this would be easy to implement. Saving the default/initial values and checking whether they are changed but, as you say, it might be more complicated.

For the reference point in the URL. Can you put it immediately after the Dataset? That makes it easy to strip off the unnecessary portions of the URL.

For the options in the URL it will be good to have them always in the same order. I have not yet created an issue because I am wavering about the order. In any case, if there is an easy way to implement a fixed order and later change the order please do so.