5

I deal a lot with borehole information and looking the best way to move it around in javascript / take advantage of javascript libraries (e.g. leaflet) for looking at this information on mobile devices / maps. I'm most interested in the popup/mouseover actions to describe additional data contained within a point.

In plan, these are points. In reality, it's a line I am looking at end on with a number of data points stacked in the same x,y location.

For example Point 1 (x,y,z collar location): +------------+-----------+---------+ | Depth from | Depth to | Reading | +------------+-----------+---------+ | 0 | 2 | 4 | | 2 | 4 | 7 | | 4 | 7 | 15 | +------------+-----------+---------+ etc.

Is there a good way to capture the above using geojson? Currently I parse a lot of it in JSON (or multidimensional arrays) in javascript. I can shoe-horn it into geojson by making many depth parameters, but it's pretty awkward (and even more awkward when I have multiple different types of data at varying depths along the same hole).

What does everyone use for borehole data and leaflet/other sources? Looking for advice / a point in the right direction, as the direction I'm going is defining my own internal format and writing my own scripts for populating the downhole information in tables during mouse-overs (which is time consuming).

1
  • 1
    You're basically talking about doing dynamic segmentation along the Z axis. Interesting. However, I'm not sure you really want to treat the borehole itself as a linear feature, but rather as a Point feature that has associated depth data stored in the properties. Sep 10, 2015 at 17:14

1 Answer 1

2

The cool thing about geoJson is the flexibility of the properties. So if you already have an object to represent the depths (ie: an array of depth intervals with readings) you can just attach this info to the GeoJson object. To use this in a map you just need to create an association (such as x,y) between the depth readings and the point on the surface.)

JSON:

var boreData = { 
  "SurfacePoint": [-117, 46], 
  "DepthReadings": [
    {"From": 0, "To": 2, "Reading": 4}, 
    {"From": 2, "To": 4, "Reading": 7 }, ... 
   ] 
}

GeoJSON:

var geoJsonFeature = {
 "type": "Feature", "geometry": {
    "type": "Point",
    "coordinates": boreData.SurfacePoint
  },
  "properties": boreData
}

Define what happens on click of the surface feature:

function clickFeature(e)
{
   var data = e.target.feature.properties;

   // do your cool and creative visualization of the borehole   
   alert(JSON.stringify(data));
}

Add marker (layer) for the surface point where drilling began (simplified this a bit, but you get the idea..):

        function onEachFeature(feature, layer)
        {
            layer.on({
                click: clickFeature
            });
        }

        var layer = L.geoJson(geoJsonFeature, {
            onEachFeature: onEachFeature
        });

Usage: Click on the borehole surface marker to view the details for the borehole. To visualize it you can even do some cool stuff like scaling the data into a stacked bar chart or something, whatever suits your fancy...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.