/
ReadGribFiles.cs
71 lines (43 loc) · 1.62 KB
/
ReadGribFiles.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Grasshopper;
using Grasshopper.Kernel;
using Grasshopper.Kernel.Types;
using Rhino.Geometry;
using GH_IO;
namespace ReadGribFiles
{
public class ReadGribFiles : GH_Component
{
public ReadGribFiles() : base("Read Grib Files", "RGF", "This component converts Grib files into Grasshopper data", "GIS", "GribFiles")
{
}
public override Guid ComponentGuid
{
get { return new Guid("87C9CF98-C72F-4A14-8296-F5EA90F132D4"); }
}
protected override void RegisterInputParams(GH_InputParamManager pManager)
{
pManager.AddTextParameter("String", "S", "String", GH_ParamAccess.item);
}
protected override void RegisterOutputParams(GH_OutputParamManager pManager)
{
pManager.AddTextParameter("StringOut", "SO", "String Out", GH_ParamAccess.item);
}
protected override void SolveInstance(IGH_DataAccess DA)
{
GdalConfiguration.ConfigureOgr();
GdalConfiguration.ConfigureGdal();
string input = "";
DA.GetData(0, ref input);
string file = @"C:\Users\Paula\Desktop\Felipe\New\multi_1.20181031.grb2";
OSGeo.GDAL.Dataset ds = OSGeo.GDAL.Gdal.Open( file, OSGeo.GDAL.Access.GA_ReadOnly );
//string output = ds.GetProjectionRef();
string output = file;
DA.SetData(0, output);
}
}
}