sashuk / watsonc

WatsonC Vidi extension
0 stars 2 forks source link

New profile drawing tool #24

Closed mapcentia closed 5 years ago

mapcentia commented 5 years ago

We need a tool for drawing a line and create a buffer. The buffer geometry should be sendt to a yet undefined 3. party end-point, which will create and return a Plot.ly object. The object should be plotted in the new dashboard and should be treated as the boreholes plots. The line and buffer should be stored with the plot object in snapshots.

The tool should work pretty much as the query tool: image

mapcentia commented 5 years ago

New profile drawing tool

sashuk commented 5 years ago

@mapcentia Could you please provide any specification concerning the description of the returned object?

mapcentia commented 5 years ago

@sashuk Some more info: The buffer polygon should be sendt to the a Vidi endpoint, where the polygon should be used to find all intersecting boreholes using the SQL API. So it should work just like the standard advanced query tool but with a hardcoded table/view. On the server side the found boreholes should be used in calling a Python script, which will return a JSON string, which should be parsed into an object, which agian should be used in creating a Plotly plot. The Python script will be provided by the client. There is more to this tool, but I think we must take it in small steps

sashuk commented 5 years ago

@mapcentia Thanks for the clarification! Should the map have the same set of drawing controls as in advanced query or there should be only the line drawing which is activated by default? As Watsonc uses the embedded template, the regular drawing control probably should not be used then and the drawing control like in measurements should be implemented.

drawing

sashuk commented 5 years ago

@mapcentia Currently the tool can draw the profile with certain buffer and request the backend. However, when the request is sent to the SQL API, the Nginx's 414 Request-URI Too Large is returned - is it possible to make Nginx accept longer requests? The tool is pretty much ready for Python script.

profile

mapcentia commented 5 years ago

@sashuk Are you using GET for the request? There should not be any limit on POST body

sashuk commented 5 years ago

@mapcentia I will try POST, thanks!

sashuk commented 5 years ago

@mapcentia @JacobBirk The querying now works correctly (requesting via POST in https://github.com/sashuk/watsonc/commit/fbdfa9ae1f7760d4b9a7206d677b5d2b3787790a, please see the demo below)

Could you please provide the Python script to test with? It will be great to have the Profiles section ready, so the https://github.com/sashuk/watsonc/issues/31 can be closed along the way.

querying

mapcentia commented 5 years ago

@sashuk @JacobBirk Python script is send to sashuk

sashuk commented 5 years ago

@mapcentia Script received, thanks!

sashuk commented 5 years ago

@mapcentia @JacobBirk The script was installed and run (not in the Vidi folder, as being deployed in Docker it will reside in a separate folder). However, could you please give some information concerning the data format?

In the example, the script input is a JSON-encoded data:

{
    "coordinates": [                             (1)
        [565977, 6372779],
        [567447, 6370030],
        [569000, 6369000]
    ],
    "DGU_nr": ["  6.   37A", " 6.   37B", ...],  (2)
    "Profile_depth": -80                         (3)
}

The SQL API returns the following data:

{
    "success": true,
    "forStore": [{
        "name": "gid",
        "type": "bigint"
    }, ...],
    "type": "FeatureCollection",
    "features": [{
        "geometry": {
            "type": "Point",
            "coordinates": [8.4355220024148, 56.898661032305]
        },
        "type": "Feature",
        "properties": {
            "gid": 175594,
            "boreholeno": " 29.   18",              (4)
            "numofintakes": 1,
            "minofbottom": [[null]],
            "maksoftop": [[null]],
            "drilldepth": "43.50",
            ...
        }
    }],
    "auth_check": {...},
    "_execution_time": 0.185
}
  1. To what coordinate system the selected boreholes coordinates should be converted before providing them in (1) parameter to the script?
  2. Is the DGU_nr property actually an array of borehole names from (4)?
  3. Where the Profile_depth property should be taken from?
JacobBirk commented 5 years ago

@sashuk Sorry forgot your question. Feel free to ask again :-)

  1. Coordinate system: UTM epsg 25832
  2. yes
  3. from right menu - see #36
sashuk commented 5 years ago

@JacobBirk Thank you very much!

sashuk commented 5 years ago

@mapcentia @JacobBirk The profile drawing tool is complete, three parameters are sent to the Vidi backend:

Next, data from the profile tool should be used when calling script which is part of the https://github.com/sashuk/watsonc/issues/35 and https://github.com/sashuk/watsonc/issues/36.

profiledrawing