Map Series of Shapefile

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Fodder77
Newbie
Newbie
Posts: 2
Joined: Mon Jul 27, 2020 12:00 am

Map Series of Shapefile

Post by Fodder77 » Mon Aug 17, 2020 6:44 am

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;

Fodder77
Newbie
Newbie
Posts: 2
Joined: Mon Jul 27, 2020 12:00 am

Re: Map Series of Shapefile

Post by Fodder77 » Thu Aug 20, 2020 8:34 am

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?

Yeray
Site Admin
Site Admin
Posts: 9509
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Map Series of Shapefile

Post by Yeray » Thu Aug 27, 2020 5:56 am

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?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply