Point ShapeType not supported

Attempting this conversion:
string shapefilePath = path + “test2.shp”;
string kmlPath = path + “test2.kml”;
try
{
VectorLayer.Convert(shapefilePath, Drivers.Shapefile, kmlPath, Drivers.Kml);
}
finally
Is there a point ShapeType to the correct ShapeType conversion that should be done prior?

Thanks
Pete

@pthiel168, Aspose.GIS keeps the geometry type unchanged during conversion, but you can process feature geometries as necessary and then save them to the destination file format.
Could you provide more details about the conversion functionality you’re are working on, so that we can better understand your requirements?

Thanks.
I have rural farmers uploading shape files (*.shp) that represent their farm fields. We need to take these files and convert them to KML format for inclusion in a Google map layer. Unfortunately the conversion fails with the error, “Point ShapeType not supported”.

Cheers
Pete

@pthiel168, thank you for details. This should normally work fine, as Point geometries are supported in full. Could you attach the shapefile that fails to convert? We’ll investigate what causes the problem and get back to you asap.

Thanks - here is the complete shapefile zip but they are only upload the *.shp.

crosby2018smartfirmer.zip (111.8 KB)

@pthiel168, I tried to reproduce the issue with the file you provided, but with this code I converted the file to KML successfully:

string shapefilePath = "crosby2018smartfirmer\\crosby2018smartfirmer.shp";
string kmlPath = "output\\crosby2018smartfirmer.kml";
VectorLayer.Convert(shapefilePath, Drivers.Shapefile, kmlPath, Drivers.Kml);

Please note that shapefile format requires at least these three files to be present:

  • .shp — contains shape geometries
  • .shx — contains feature index
  • .dbf — contains feature attribute values.

If the .shx file is missing, Aspose.GIS throws a GisException with message “.SHX file missing.”

Could you post the code you use to convert shapefiles with Aspose.GIS? Also, does crosby2018smartfirmer shapefile give you the “Point ShapeType not supported” error during conversion?

Thanks again, I deleted and recopied the crosby2018smartfirmer files to the subdirectory for testing, testing using this code:
string shapefilePath = path + “test2.shp”;
string kmlPath = path + “test2.kml”;
VectorLayer.Convert(shapefilePath, Drivers.Shapefile, kmlPath, Drivers.Kml);

I no longer get the point shapetype error, unfortunately I now get:
System.StackOverflowException
HResult=0x800703E9
Message=Exception of type ‘System.StackOverflowException’ was thrown.
on the line:
VectorLayer.Convert(shapefilePath, Drivers.Shapefile, kmlPath, Drivers.Kml);

any thoughts?
Thanks
Pete

These are very unusual errors and unfortunately I still can’t reproduce them. Please create a zip archive of the entire test project and attach it here. I’ll also need this information:

  • Your OS (Windows/Linux/macOS)
  • Is the OS 64-bit or 32-bit?
  • What version of .NET are you using?

Thanks!

I created a quick test project that still throws the StackOverflow exception.
I left in the upload (even though it no longer is doing anything) in case it has any bearing on the issue.

OS: Windows 64-bit; .Net 4.7.2

I have attempted to add the project zip file but it is not appearing in the post, is there a size limitation?

@pthiel168,
Yes, the forum does not allow large attachments. Could you remove binary files (dll, exe) and directories like bin or obj from the archive and try again?

I removed as directed and left out the Packages folder: Please see the attached:
testProject.zip (982.9 KB)

@pthiel168, thanks a lot. I reproduced the error and logged an issue GISNET-395 for further investigation. I’ll post an update here as soon as more information is available.

@pthiel168, the issue GISNET-395 has been fixed in Aspose.GIS version 19.6. Please let me know if the problem still occurs in your environment. Thanks!

Thank you very much, worked perfectly.