Page 1 of 1

Map Series of Shapefile

Posted: Mon Aug 17, 2020 6:44 am
by 16589117
Hi All,

I am trying to create some maps from shapefiles. So far, I have managed to draw the polygons in a shapefile with the code below.

However, I can't figure out how to load or access the attributes of the shapes from the dbf file. Can anyone help?

I also couldn't find an example of Map Series with GIS layers (at https://github.com/Steema/TeeChart-VCL-samples)?

When I try to compile the TeeChart_Maps project, I get a Unit DBTables not found error. I am using: Steema TeeChart Pro VCL FMX Source Code 2020.30

Code: Select all

 Chart1.View3D := false;
 Chart1.Legend.Visible := false;

  series1 := TMapSeries.Create(Chart1);
  Chart1.AddSeries(series1);

  series1.Clear;

  SHPFile := 'shapes.shp';  

  try
    LoadMap(Series1 , SHPFile);
  finally
  end;
  Series1.ColorEachPoint := true;

Re: Map Series of Shapefile

Posted: Thu Aug 20, 2020 8:34 am
by 16589117
Hi everyone,

I have made a bit of progress, I installed BDE and was able to compile the Map Layer demo including reading shapefile attributes using DBTables TTable. However, is there a preferred object to use now BDE is deprecated?

My next issue is that many of my shapefiles return the 'corrupt table index/header' error on TTable.Open despite the fact that they work fine in GIS applications. Does anyone have any ideas on this?

Is KML a better format to use than SHP with TeeChart? Can TeeChart retrieve values and names from KML files similar to SHP?

Re: Map Series of Shapefile

Posted: Thu Aug 27, 2020 5:56 am
by yeray
Hello,
Fodder77 wrote:
Thu Aug 20, 2020 8:34 am
I have made a bit of progress, I installed BDE and was able to compile the Map Layer demo including reading shapefile attributes using DBTables TTable. However, is there a preferred object to use now BDE is deprecated?
I'm not an expert on the subject but migrating from BDE to FireDAC seems to be the most recommended.
Fodder77 wrote:
Thu Aug 20, 2020 8:34 am
My next issue is that many of my shapefiles return the 'corrupt table index/header' error on TTable.Open despite the fact that they work fine in GIS applications. Does anyone have any ideas on this?
I'm afraid I don't have enough information here. If you think the problem is in TeeChart, please try to arrange a simple example project we can run as-is to reproduce the problem here.
Fodder77 wrote:
Thu Aug 20, 2020 8:34 am
Is KML a better format to use than SHP with TeeChart? Can TeeChart retrieve values and names from KML files similar to SHP?
You can load KML files using TTeeKMLSource as in the example here. Have you tried it?