I have the following code to open a .shp file and to plot it in a MapWinGis
Map1 component.
procedure TForm1.Button1Click(Sender: TObject);
var shp: Shapefile;
HandleLayer: integer;
begin
shp:= CoShapefile.Create;
shp.Open ('C:\Users\Documents\BD Demo\Alta Cruz\cruz\alta_cruz.shp', nil) ;
Map1.Focused;
HandleLayer:= Map1.AddLayer (shp, true);
Map1.ZoomToMaxExtents;
And a good code to open the points file:
procedure TForm1.Button2Click(Sender: TObject);
var shp: Shapefile;
HandleLayer: integer;
begin
shp:= CoShapefile.Create;
shp.Open ('C:\Users\Desktop\opa\Win32\Debug\Amostragem.shp', nil) ;
Map1.Focused;
HandleLayer:= Map1.AddLayer (shp, true);
Map1.ZoomToMaxExtents;
shp.StartEditingShapes(true, null);
And as a result I have this:
WhatIneededwastoreadthe.dbffilefromthesamplefile,anddisplaythepointsasintheexamplebelow:
The above example was done gis; QGIS
Is it possible to do the same?