Error in VCLTee.TeeSHP

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Markus
Newbie
Newbie
Posts: 2
Joined: Wed Nov 19, 2014 12:00 am
Contact:

Error in VCLTee.TeeSHP

Post by Markus » Wed Oct 28, 2015 3:10 pm

I am playing a little bit around with the LoadMap function because we want to extend our tool to deal with GIS data. The funtion works well but I guess there's a bug in the Code right here:

Code: Select all

  {$IFDEF CLR}
  ReadSHPHeader(ShpStream,SHPHeader);
  {$ELSE}
  ShpStream.ReadBuffer(SHPHeader,SizeOf(TSHPHeader));
  {$ENDIF}

  VerifySignature(SHPHeader.FileCode);

  {$IFDEF CLR}
  ReadSHPHeader(ShxStream,SHPHeader);
  {$ELSE}
  ShxStream.ReadBuffer(SHPHeader,SizeOf(TSHPHeader));
  {$ENDIF}

  VerifySignature(SHPHeader.FileCode);
As you may see, the code is doubled. That leads to a false record number in the following code

Code: Select all

NumRecords:=RecordCount(SHPHeader);
Is this a known issue? The resulting map Chart then mirrors that error as one can see, when you make the legend visible or just have a look at the data. There are too many data rows in the map.

Regards
Markus

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

Re: Error in VCLTee.TeeSHP

Post by Yeray » Fri Oct 30, 2015 12:16 pm

Hello Markus,
Markus wrote:As you may see, the code is doubled.
Not exactly doubled. The first part loads the shp while the second part loads the shx.
Markus wrote:or just have a look at the data. There are too many data rows in the map.
Looking at the data tab in the demo, the shapes don't look doubled there:
europe.png
europe.png (157.72 KiB) Viewed 4613 times
Could you please arrange a simple example project we can run as-is to reproduce the problem here?

Thanks in advance.
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

Markus
Newbie
Newbie
Posts: 2
Joined: Wed Nov 19, 2014 12:00 am
Contact:

Re: Error in VCLTee.TeeSHP

Post by Markus » Sat Oct 31, 2015 12:04 pm

Hi Yeray,

your right! My fault! But I still have the problem that when I load a shp file, the data rows are multiple. I attached a sample project with a specific shp file, where you can see the effect. Is the shape file corrupt?

Thanks for your Support!

Regards
Markus
Attachments
GISTest.zip
(231.93 KiB) Downloaded 392 times

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

Re: Error in VCLTee.TeeSHP

Post by Yeray » Mon Nov 02, 2015 11:17 am

Hello,

This shapefile has 16 records; some records have a single shape but some of them have multiple shapes. That's why there are more rows in the "Data" grid than records in the shp file.
The "Value" field on the "Data" grid represents the ZValues array used to give a color to each shape.
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