区块链olo合法吗?,neo区块链官网下载
请查看相关英文文档
Ⅰ Can you briefly introduce what software mapinfo is?
Mapinfo is a desktop map information system launched by the American Mapinfo company in 1986. It has developed from the original Mapinfo for Dos 1.0 Arrived Mapinfo Professional 6.0. Mapinfo products are positioned on desktop map information systems. Compared with large-scale GIS systems such as Arc/Info, because Mapinfo metadata does not contain topological structures, its mapping and spatial analysis capabilities are relatively weak, but it can handle popular PC desktop data. In terms of information mapping applications, Mapinfo is small and exquisite, easy to learn and use, and has a low price. It is a preferred GIS product. Mapinfo provides its own secondary development platform on which users can develop their own GIS applications. There are three secondary development methods, which are development based on MapBasic, development based on OLE automation and development using MapX controls. From the early MapBasic to the current MapX4.5, GIS system development on Mapinfo has become more and more efficient and simple. Here is an introduction to how to use MapBasic, OLE automation and MapX to develop GIS application systems.
1. Development using MapBasic
MapBasic is the secondary development language that comes with Mapinfo. It is an interpretive language similar to Basic. The *.mbx file generated by MapBasic programming can be used on the Mapinfo software platform. Operation, the early secondary development of Mapinfo was based on MapBasic. MapBasic is easy to learn, but it has many constraints when using it. It cannot implement more complex custom functions, and it is also troublesome to use it to build a user interface. From the current perspective, MapBasic is more suitable for extending Mapinfo functions.
2. Use OLE automation development
1. Establish Mapinfo automation objects
Development based on OLE automation means that programmers use standardized programming tools such as VC, VB, Delphi, PB, etc. to establish automation controllers. Then operate Mapinfo by sending macro commands similar to MapBasic language. Mapinfo is actually used as an out-of-process server, which outputs OLE Automation objects in the background for the controller to call its properties and methods.
The first step in OLE automation development is to create a Mapinfo automation object. Taking Delphi as an example (this will be the case later), you can set a global variable of Variant type to represent the OLE automation object. Suppose the variable is named olemapinfo, then There are:
oleMapinfo :=CreateOleObject('Mapinfo.Application')
Once the OLE automation object is created, that is, the background Mapinfo is successfully started, you can use the Do method of the object to send commands to Mapinfo, such as:
oleMapinfo.Do(' Set Next Document Parent' + WinHand + 'Style 1')
This command makes the Mapinfo window a child window of the application, WinHand is the map window handle, and style 1 is the window type without borders. You can also use the Eval method of the automation object to return the value of the MapBasic expression. For example, the following statement returns the number of tables currently open:
TablesNum:=olemapinfo.eval('NumTables()')
You also You can directly call the Mapinfo menu or button commands to operate the map window, such as enlarging the map display:
oleMapinfo.RunMenuCommand(1705)
2. Establish a customer automation object to trigger CallBack
Developed based on OLE automation The difficulty lies in the so-called CallBack. The Mapinfo server's response to the client program's map window is called CallBack. If you move the map target in the map window, Mapinfo can return information telling you the current coordinate position of the map target. This is the CallBack function. If you want to customize your own map operation tools or menu commands, you must rely on CallBack. But if you want to capture CallBack information, your client program must have the ability to receive CallBack information. To do this, you need to define your own OLE automation object in the client program, such as:
//Definition interface
IMyCallback = interface( IDispatch)
['{2F4E1FA1-6BC7-11D4-9632-913682D1E638}']
function WindowContentsChanged(var WindowID: Integer):SCODE;safecall;
function SetStatusText(var StatusText: WideString) : SCODE; safecall;
//DefinedDefinition interface implementation
TMyCallback = class(TAutoObject, IMyCallback)
function SetStatusText(var StatusText: WideString): SCODE; safecall;
function WindowContentsChanged(var WindowID: Integer): SCODE;safecall; < br />The WindowContentsChanged function is used to return the ID number of the changed window, that is, when the map window changes (such as zooming in or out), Mapinfo returns the ID number of the map window to the client program; the other SetStatusText function returns the Mapinfo status bar change information. Programmers cannot define these functions at will, because the Mapinfo server's CallBack will be triggered only in three situations: (1) The map window changes, and the trigger function is WindowContentsChanged; (2) The Mapinfo status bar information changes, and the trigger function is SetStatusText. ; (3) The user selects a custom tool or menu command to operate on the map window, such as a user-customized line drawing tool. When the user draws a line in the map window, Mapinfo's CallBack is triggered to return the coordinate position of the line.
After establishing the customer automation object, call the SetCallback method of the MapInfo automation object to tell Mapinfo the customer-defined automation object. As soon as the program is run, the customer automation object will automatically be registered in the registry, and then you will receive the CallBack information, such as:
My:=MyCallBack.Create
oleMapInfo.SetCallBack(My)
Here is an analogy that I think will help to understand the above mechanism, the relationship between the client program and Mapinfo The interaction is like the communication between a stage conductor and a puppet actor. The map window or Mapinfo sub-window in the client program is just a marionette. The background Mapinfo is the real puppeteer. Therefore, the client program must establish a positive relationship with the background Mapinfo. , reverse connection mechanism to control the graphical objects in the map window.
3. Development using MapX
1. Master the use of MapX
MapX is the latest ActiveX control product launched by Mapinfo Company, and has now been developed to MapX4.5. Since MapX is a standard control based on the Windows operating system, it can support VC,When using standardized programming tools such as VB, Delphi, and PB, you only need to load the control into the development environment. After loading the control, a control button Map will be added to the ActiveX toolbar of the development environment. Drag and drop it onto the form to create a An ActiveX map object Map of type TMap can quickly integrate map operation functions into your application by setting or accessing the properties of the Map object and calling the methods and events of the Map object.
MapX consists of a series of Objects and Collections. Map is the most basic object. Each Map consists of three objects: Layer, Dataset and Annotation. and object collections (Layers, Datasets, Annotations) to define, among which Layer is used to operate map layers, Dataset is used to access attribute data of spatial objects, and Annotation is used to add text, symbols and other annotations on the map. Master the above three main After learning the characteristics of the object, we can then follow the clues to grasp the characteristics of the next-level object. For example, each Layer is defined by Feature (point, line, surface, text graphic object) objects and object collections (Features), and each Dataset is defined by Field (attribute data). Domain) objects and object collections (Fields) definition..., so you can learn MapX quickly.
2. Define the map coordinate system
In the development of MapX, special attention needs to be paid to the issue of the map coordinate system. The MapX map coordinate system is divided into a map display coordinate system and an internal calculation coordinate system. The two are independent of each other. In GIS In application development, it is very important to set these two coordinate systems according to the application needs, because the coordinate system affects the internal coordinate processing of the software system on the one hand, and the appearance display of the map on the other hand. The coordinate system and projection of the Map object are defined through the Set method of the CoordSys object:
Set(Type, [Datum], [Units], [OriginLongitude], [OriginLatitude],
[StandardParallelOne], [StandardParallelTwo] , [Azimuth], [ScaleFactor],
[FalseEasting], [FalseNorthing], [Range], [Bounds], [AffineTransform])
The main parameters: Type represents the projection type, when Type is 1 Map coordinates are expressed in longitude and latitude, followed by optional parameters, where Datum is the earth's datum; Units is the coordinate unit.Bit, if Units is 7, it means in meters; OriginLongitude and OriginLatitude are the starting longitude and latitude respectively; StandardParallelOne and StandardParallelTwo are the first and second standard latitudes. This parameter is related to the map projection.
By setting the CoordSys object returned by the DisplayCoordSys and NumericCoordSys properties of the Map object, you can set the map display coordinate system and internal calculation coordinate system. For example:
procere TMain.DefineMapParam();
var
MapDatum: Variant;//Earth datum
begin
try
MapDatum := CreateOleObject ('MapX.Datum.4'); //Create a datum object
//Define the Beijing 54 coordinate system datum
// (Ellipsoid, ShiftX, ShiftY, ShiftZ, RotateX, RotateY, RotateZ, ScaleAdjust, PrimeMeridian)
MapDatum.set(3, 24, -123, -94, -0.02, 0.25, 0.13, 1.1, 0);
//Define the longitude and latitude of Beijing 54 coordinate system as internal calculation coordinates System
Map1.NumericCoordSys.Set_(1, MapDatum);
//Define Beijing 54 coordinate system 30-degree standard latitude Mercator projection as the display coordinate system, the unit is meters
Map1.DisplayCoordSys .Set_(26,MapDatum,7,0,0,30);
finally
VarClear(MapDatum);
end;
The coordinate system is the cornerstone of the GIS system and must be set correctly The coordinate system is the key to the success or failure of the system.
3. Manipulate map objects
You can simply load a GeoSet file, give specific content to the Layers object collection, and then you can see the map display in the Map object. GeoSet files are similar to those in MapInfo Workspace, GeosetMangater.exe, an editor for Geoset files in MapX. Users can combine and set layers in the editor., then save and generate a *.gst file and directly transfer it into the Map object, which can save time. You can also add or remove map layers through the Add or Remove method of the Layers object, such as:
Map.layers.Add(FileName); // Add a layer, FileName is the full path name of the file
Map.Layers.Remove(3); // Remove the third layer of the map
The Layers object consists of a set of Layer objects. Through the Features and Selection object collections of the Layer object, you can manipulate and select graphic targets on the layer. , such as:
Map.Layers.Item(1).AddFeature(Newobj); //Add the new object Newobj to layer one
4. Map data bundling
Data bundling is to combine different The process of mapping the source data to the map layer, and the bundling result will generate a Dataset object. The collection of Dataset objects forms the Datasets Collection, which defines the dataset attributes of the Map object. You can use Datasets to bundle data from different sources onto the map to achieve graphic and text interaction, or create thematic maps, such as the following example of bundling and thematic analysis of ODBC Access data:
procere TMapForm.ODBC1Click(Sender: TObject);
/> var
param: ODBCQueryInfo;
ds: Dataset; //Define data set
Datafields: Fields; //Define data fields
begin
param.SqlQuery: = 'select * from China'; //Select the China table in the Access database
param.DataSource := 'MapChina'; //ODBC data source name
param.ConnectString := 'ODBC;'; //Or user = ... Pwd = ..., define ODBC connection
Datafields.Add('GEONAME','GEONAME', miAggregationAuto,miTypeString); //Add data field GEONAME
Datafields.Add('POPU','POPU', miAggregationAuto,miTypeNumeric); //Add data field POPU
//Bundle Access data to Mapinfo China table
ds := Map.Datasets .Add(miDataSetODBC, param, unassigned, unassigned, unassigned, 'CHINA', Datafields, unassigned);
ds.Themes.Add(miThemeRanged, 'POPU', 'MyTheme'); //Add a range thematic map
end;
5. Create customized tools
You can also customize your own map operation tools. The following is a brief description of the method steps by customizing an information button tool named Info:
(1) Define customer tool constants
Const CUSTOM_INFO_TOOL = 1
(2) Use the CreateCustomTool method of the Map object to define customer tools. The method is:
CreateCustomTool (ToolNumber, Type, Cursor, [ShiftCursor] , [CtrlCursor], [InfoTips])
Where ToolNumber is the tool number, which is the constant defined above; Type is the tool type; Cursor is the cursor shape, and other parameters are optional.
//Define the Info tool as the cross cursor point trigger tool
Map.CreateCustomTool(CUSTOM_INFO_TOOL, miToolTypePoint, miCrossCursor, miArrowCursor, miArrowCursor, unassigned)
(3) Write the tool in the Map object event ToolUsed Handler (operation content)
procere TMain.MapToolUsed(Sender: TObject; ToolNum: Smallint; X1, Y1, X2, Y2, Distance: Double;
Shift, Ctrl: WordBool; var EnableDefault: WordBool);
begin
Case ToolNumber of
CUSTOM_INFO_TOOL : //Information toolInfo
try
……
end;
(4) Define the Click event of the information button
procere TMain.InfoClick(Sender: TObject);
begin
Map.CurrentTool:=CUSTOM_INFO_TOOL;
end
IV. Summary
Development based on MapBasic is simple but has many restrictions, and is more suitable for Mapinfo function expansion programming. The development based on OLE automation is more cumbersome, because it needs to send MapBasic string commands back and forth to the background Mapinfo, and the created application runs relatively slowly. However, this development method can create a beautiful and friendly interface at will, and integrate geography Operations and non-geographic operations are integrated into one, and almost 100% of Mapinfo functions can be realized, which is unmatched by the current MapX4.5. Compared with traditional GIS professional development environments, the emergence of component GIS systems like MapX can be said to be a qualitative leap. It is small and flexible, easy to develop, and cheap. It will become more and more popular in the future. GIS systems developed with MapX run quickly because they do not need to run on the Mapinfo software platform. However, judging from the current MapX4.5, MapX has not been able to implement all Mapinfo functions (it is said that more than 95%). During use, it was found that its ability to generate or edit maps and geographical analysis capabilities is insufficient, and there are many bugs in it. With the launch of new versions in the future, MapX will become more and more stable and perfect.
- 上一篇: 区块链是啥股票啊,区块链是啥股票类型
- 下一篇: 区块链的完全信任机制是什么,区块链的完全信任机制包括