{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Working With Pointset Data","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":false}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"working-with-pointset-data","__idx":0},"children":["Working With Pointset Data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note"]},": You will need to include PointSetData to your ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Module Dependencies"]}," list."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"loading-a-pointset-from-a-file","__idx":1},"children":["Loading a pointset from a file"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["import com.interactive.intviewerapi.data.IData;"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    import com.interactive.intviewerapi.data.pointset.IPointSetData;\n    import com.interactive.intviewerapi.data.pointset.IPointsetDataCollection;\n    ...\n    try {\n        IPointSetData hd = IData.factory.createNewInstance(filePath, IPointSetData.class);\n    } catch (Exception ex) {\n        DialogManager.getDefault().showMessageDialog(\"Error loading pointset: \" + filename,\n         \"Error Loading Pointset\", DialogManager.ERROR);\n        return;\n    }\n    List<IKeyRange> klist = hd.getDataRange();\n    for (IKeyRange kr:klist) {\n        System.out.println(kr);\n    }\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"using-the-pointset-file-chooser","__idx":2},"children":["Using the pointset file chooser"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To select one dataset:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["import com.interactive.intviewerapi.data.ISingleDataChooser;"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"   // get the chooser for pointset data type\n   ISingleDataChooser<IPointSetData> singleChooser = ISingleDataChooser.Factory.createNewInstance(IDataChooser.POINTSET);\n   // popup the chooser dialog\n   int rc = singleChooser.setDataChooserVisible(true);\n   if (rc == JFileChooser.APPROVE_OPTION) {\n      IPointSetData pointSetData = singleChooser.getSelectedData();\n   }\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To select multiple datasets:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["import com.interactive.intviewerapi.data.IMultipleDataChooser;"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"   // get the file chooser for pointset data type\n   IMultipleDataChooser<IPointSetData> multipleChooser = IMultipleDataChooser.Factory.createNewInstance(IDataChooser.POINTSET);\n   // popup the chooser dialog\n   int rc = multipleChooser.setDataChooserVisible(true);\n   if (rc == JFileChooser.APPROVE_OPTION) {\n      for (IPointSetData pointSetData: multipleChooser.getSelectedData()) {\n      }\n   }\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"creating-a-pointset-from-scratch","__idx":3},"children":["Creating a pointset from scratch"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use the PointSetUtil.createPointSetData method to create a pointset from scratch. The time key should be specified using the setTimeKey method."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    IPointSetData hd = PointSetUtil.createPointSetData(\"tmp\",\n           new FieldDesc[]{\n               new FieldDesc(\"INLINE\", 0, true),\n               new FieldDesc(\"XLINE\", 1, true),\n               new FieldDesc(\"Time\", 2, true),\n               new FieldDesc(\"Amplitude\", 3)\n           });\n    hd.setTimeKey(2);\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"getting-information-about-the-data-keys","__idx":4},"children":["Getting information about the data keys"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Range keys provide information about how to access the horizon data. They can be accessed as follows:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["List<IKeyRange>"]}," keyRangeList = hd.getDataRange();"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Unlike in horizons where the time key is usually not indexed, the last key of a pointset dataset can be the Time key. The key names of a pointset are typically INLINE, XLINE and Time.Amplitude is usually a non-indexed attribute."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"adding-points","__idx":5},"children":["Adding points"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example shows how to populate the empty pointSet created in the previous section."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    import com.interactive.intviewerapi.data.PointData;\n    ...\n    for (int inline= 0; inline < 400; inline++) {\n        for (int xline = 0; xline < 400;  xline++) {\n            PointData pd = new PointData(4);\n            pd.setValues(new float[] {inline, xline,\n                inline*0.1f, (xline+inline)*13.45f});\n            hd.addPoint(pd);\n        }\n    }\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each time a point is added, a PointDataEvent is sent. This can cause performance issues when a large number of points has to be added. Wrap this code inside a IPointSetData.update method to reduce the event overhead."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    hd.update(new Runnable() {\n       @Override\n       public void run() {\n          for (int inline= 0; inline < 400; inline++) {\n             for (int xline = 0; xline < 400;  xline++) {\n                PointData pd = hd.createPointData();\n                pd.setValues(new float[] {inline, xline,\n                   inline*0.1f, (xline+inline)*13.45f});\n                hd.addPoint(pd);\n             }\n          }\n       }\n    });\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"deleting-points","__idx":6},"children":["Deleting points"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We delete all the points within INLINE 20-21 and XLINE 30-31."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    import com.interactive.intviewerapi.data.IPointSelection;\n    import com.interactive.intviewerapi.data.KeyRange;\n    import com.interactive.intviewerapi.data.query.RangeQuery;\n    ...\n    RangeQuery rq = new RangeQuery();\n    rq.addKeyRange(new KeyRange(\"INLINE\", 20, 21 ));\n    rq.addKeyRange(new KeyRange(\"XLINE\", 30, 31 ));\n    IPointSelection ps = hd.select(rq);\n    hd.delete(ps);\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"querying-points","__idx":7},"children":["Querying points"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["We retrieve all the points for INLINE 40."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    RangeQuery rq = new RangeQuery();\n    rq.addKeyRange(new KeyRange(\"INLINE\", 40, 40 ));\n    IPointSelection ps = hd.select(rq);\n    List<PointData> dataList = ps.getData();\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"saving-a-pointset","__idx":8},"children":["Saving a pointset"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You could do the following to save a pointset:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"    ISingleDataSaver ds = ISingleDataSaver.Factory.createNewInstance(IDataChooser.POINTSET);\n    if (ds.setDataSaverVisible(true, pointsetData.getDataPath()) == JFileChooser.APPROVE_OPTION) {\n        FileObject fo = (FileObject) ds.saveDataAndWait(pointsetData);\n        String path = FileUtil.toFile(fo).getAbsolutePath();\n        if (pointsetData.getDataPath() != null || pointsetData.getDataPath().length() != 0) {\n                pointsetData.setDataPath(path);\n            }\n        }\n    }\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This would display a dialog to let the users select the fileName in which they want to save the IPointSetData."]}]},"headings":[{"value":"Working With Pointset Data","id":"working-with-pointset-data","depth":1},{"value":"Loading a pointset from a file","id":"loading-a-pointset-from-a-file","depth":3},{"value":"Using the pointset file chooser","id":"using-the-pointset-file-chooser","depth":3},{"value":"Creating a pointset from scratch","id":"creating-a-pointset-from-scratch","depth":3},{"value":"Getting information about the data keys","id":"getting-information-about-the-data-keys","depth":3},{"value":"Adding points","id":"adding-points","depth":3},{"value":"Deleting points","id":"deleting-points","depth":3},{"value":"Querying points","id":"querying-points","depth":3},{"value":"Saving a pointset","id":"saving-a-pointset","depth":3}],"frontmatter":{"title":"Working With Pointset Data","pageId":"intviewer-apis-for-data/working-with-pointset-data","seo":{"title":"Working With Pointset Data"}},"lastModified":"2026-10-22T14:32:05.575Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/intviewer/intviewer-apis-for-data/working-with-pointset-data","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}