KB no longer maintained - MapViewer is a Legacy Product. Legacy Products are still supported, but no longer receive new features or updates. Many of MapViewer's features have been moved to Surfer. Please contact support@goldensoftware.com with any questions. |
This article contains a sample script for creating a choropleth (hatch) map with user defined class ranges.
To run this script:
- Copy the script below, or click here to download the BAS file: Create_Hatch_Map_UserDefClasses.bas.
- In a Windows Explorer window, navigate to C:\Program Files\Golden Software\MapViewer 8\Scripter.
- Double click on Scripter.exe to launch Scripter.
- Press Ctrl+A to select all of the existing lines then press Delete.
- If you copied this script, press Ctrl+V to paste it into Scripter. If you downloaded it, click File | Open, select the BAS file from your downloads directory, and click Open.
- Click Script | Run to run the script.
*********
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Create_Hatch_Map_UserDefClasses.bas ' Copyright (C) Golden Software Inc. 1992-2015 ' ' This script creates a hatch map with user-defined class ranges. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub Main Dim mvApp, plot, hatch As Object Dim path As String ' Start MapViewer and create a pointer to the application object Set mvApp = CreateObject("MapViewer.Application") ' Make the application visible mvApp.Visible = True ' Create a plot document Set plot = mvApp.Documents.Add(DocType:=mvDocPlot) ' Set the path variable to point to the MapViewer samples folder path = mvApp.ApplicationFolder + "samples\" ' Create a hatch map of the population in Alabama ' Col A contains the PID ' Col G contains the population Set hatch = plot.CreateHatchMap( _ BoundaryFileName := path + "al2010.gsb", DataFileName := path + "al2010.dat", _ PIDCol := 1, VarCol := 7, NumClasses :=3 ) hatch.ClassificationMethod = mvClassificationUserDefined hatch.SetClassMinMaxVals(1,0,20000) hatch.SetClassMinMaxVals(2,20000,100000) hatch.SetClassMinMaxVals(3,100000,800000) End Sub
Updated August 20, 2018
Comments
0 comments
Please sign in to leave a comment.