2
I have the following code to open a file . shp and plot it on a component of MapWinGis
Map1.
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 very similar code to open the stitch 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 it:
what I needed was to read the . dbf File from the sample file, and display the points as in the example below:
The example above was made the gis; QGIS
it is possible to do the same?
Sorry for the delay, I had a personal problem, I wanted to be able to give you the reward. .
– Guilherme Lima
Kra does not worry good is that it worked and now you are again in production with your project! Hugs!
– Christiano Ribeiro Soares
Taking advantage, as I release the dbf after using it?
– Guilherme Lima
Yes, I was reading your question in the other topic. For me you did everything right. Closed your Adoquery, then closed the connection. It may seem a little extreme, but have you thought about, instead of using the component in your form, creating Adoquery next to its function ? You could destroy it and recreate it whenever necessary. The problem of the file being in use has to do with the existence of the component. Well, I’ve been there and that’s how I solved my problem.
– Christiano Ribeiro Soares
I’ll try, thanks buddy.
– Guilherme Lima