Borehole — GSTPy documentation

# Borehole

For this example we create a borehole and output it in PNG. We assume that we have a feature class with name “area1” that has some TIN features.

Getting the feature ids

We can get them from a feature class like so.

    feature_classes = ni.list_feature_classes()
    area1_feature_class = next((fc for fc in feature_classes
                                if fc.name == "area1"))
    area1_features = ni.list_features(area1_feature_class)

Or we could get them from a MoMa node like in the following example.

List all child feature ids of a MoMa Node

Setting up the input parameters

    bore_point = GSTPy.Point2d(5398872, 5667584)
    bore_point_srs = area1_feature_class.srs
    input_params = GSTPy.BoreHoleImageParameters(area1_feature_ids, bore_point,
                                                 bore_point_srs)

Setting up the output parameters

    output_path = r"D:\temp\isec\output"
    output_params = GSTPy.OutputShapeParameters(output_path)

Performing the intersection

    output_zip_name = ni.save_borehole_shape(input_params, output_params)

Full code sample

    import GSTPy

    # getting the feature ids
    feature_classes = ni.list_feature_classes()
    area1_feature_class = next((fc for fc in feature_classes
                                if fc.name == "area1"))
    area1_features = ni.list_features(area1_feature_class)
    area1_feature_ids = [f.feature_id for f in area1_features]

    # input parameters
    bore_point = GSTPy.Point2d(5398872, 5667584)
    bore_point_srs = area1_feature_class.srs
    input_params = GSTPy.BoreHoleImageParameters(area1_feature_ids, bore_point,
                                                 bore_point_srs)

    # output parameters
    output_path = r"D:\temp\isec\output"
    output_params = GSTPy.OutputShapeParameters(output_path)

    # intersection
    output_zip_name = ni.save_borehole_shape(input_params, output_params)