Contour Mapping


tlemar

Recommended Posts

I have data in a SQL database with the following format:

x, y, elevation

I would like to create a contour map of the data. Is this possible? If so, can you provide some direction on how to get started?

Thanks

Tracy

Link to comment
Share on other sites

Yes you can, but the X and Y values have to be evenly spaced. If not, I suppose you could write a simple interpolation routine to get a nice grid. Anyhow, your data then needs to be in an 2 dimensional array, with both rows and columns, where your elevation is the data in each point. Then you can use either the 3D graph component or the image component (for a color map).

Link to comment
Share on other sites

  • 2 weeks later...

Here is an sample of my code. I use this to build color map (3D Graph & Image)with a array channel.

Component.MOIImage.ClearColors()

Private.Spacing = (Var.MOIImagespan - Var.MOIImageCenterSpan) / 3 // 3 is for 3 colors on each side

// now, starting at the bottom, add the desired colors. You may want nicer ones:

Component.MOIImage.AddColor(RGB(0,0,155),MOISP[0] - Var.MOIImagespan)

Component.MOIImage.AddColor(RGB(0,0,255),MOISP[0] - Var.MOIImagespan + Private.Spacing)

Component.MOIImage.AddColor(RGB(0,155,255),MOISP[0] - Var.MOIImagespan + 2 * Private.Spacing)

// add center area, requires 2 of same color to avoid shading:

Component.MOIImage.AddColor(RGB(0,255,0),MOISP[0] - Var.MOIImageCenterSpan)

Component.MOIImage.AddColor(RGB(0,255,0),MOISP[0] + Var.MOIImageCenterSpan)

// and the top area

Component.MOIImage.AddColor(RGB(255,255,0),MOISP[0] + Var.MOIImagespan - 2 * Private.Spacing)

Component.MOIImage.AddColor(RGB(255,145,0),MOISP[0] + Var.MOIImagespan - Private.Spacing)

Component.MOIImage.AddColor(RGB(255,0,0),MOISP[0] + Var.MOIImagespan)

Component.MOIGraph.ClearColors()

Component.MOIGraph.AddColor(RGB(0,0,155),MOISP[0] - Var.MOIImagespan)

Component.MOIGraph.AddColor(RGB(0,0,255),MOISP[0] - Var.MOIImagespan + Private.Spacing)

Component.MOIGraph.AddColor(RGB(0,155,255),MOISP[0] - Var.MOIImagespan + 2 * Private.Spacing)

// add center area, requires 2 of same color to avoid shading:

Component.MOIGraph.AddColor(RGB(0,255,0),MOISP[0] - Var.MOIImageCenterSpan)

Component.MOIGraph.AddColor(RGB(0,255,0),MOISP[0] + Var.MOIImageCenterSpan)

// and the top area

Component.MOIGraph.AddColor(RGB(255,255,0),MOISP[0] + Var.MOIImagespan - 2 * Private.Spacing)

Component.MOIGraph.AddColor(RGB(255,145,0),MOISP[0] + Var.MOIImagespan - Private.Spacing)

Component.MOIGraph.AddColor(RGB(255,0,0),MOISP[0] + Var.MOIImagespan)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.