Aspose.Gis.GisException: '.SHX file missing.'

Hi,

I am getting this error when trying to convert a .shp file into GeoJson using Aspose.GIS,

Aspose.Gis.GisException: ‘.SHX file missing.’

Is there anyway to do the conversion when the SHX file is not provided ?

Hello, @luongor27!

Thank you for the question.

We cannot perform the conversion if no SHX file is provided. Every .shx file is a mandatory part of a shapefile. In order to read or convert a shapefile at least two files, .shp and .shx, must be present. You can find out more about shapefiles here.

Thanks.

Thanks a lot for such a prompt reply,

Is there any config options where you can tell Aspose.GIS to create the SHX file if not provided ?

@luongor27

Unfortunately, by the moment Aspose.GIS has no option to restore a missing .shx file. We will include this feature in the roadmap and update you here as soon as additional information is available. We have created a ticket GISNET-505. Thanks.

thanks a lot

Hi, just one more question, is the SHX file mandatory also when we are converting a SHAPE file into TopoJSON ?

@luongor27

Yes, an SHX file is also required when converting a SHAPE file to TopoJSON or any other format. This is because the conversion from the SHAPE format requires reading of both files (.shp and .shx). Thanks.

thanks so much for such a prompt answer again, we are now seriously evaluating choosing Aspose.GIS to perform out SHP to GeoJSON conversions, however I have noticed that the unlicensed version only allows for 100 features, will it be possible to have some sort of free trial version to be able to test our files in full and without restrictions ? please let me know

Also, can you please confirm whether or not Aspose.GIS can provide the BBOX = BoundaryBox for each feature that gets converted from SHAPE into GeoJSON format ? many thanks

@luongor27

Currently Aspose.GIS doesn’t support the BBOX field when processing GeoJSON format. We added a ticked GISNET-507 and we will include this feature in the roadmap.

However, Aspose.GIS provides a GetExtent function for GeoJSON and any other format. The GetExtent function computes and returns the bounding box of the geometry in the feature. This is an alternate for the BBOX field in GeoJSON format.

Geometry.GetExtent Method: Geometry.GetExtent | Aspose.GIS for .NET API Reference

To get a Temporary License, please visit the following page: Temporary License - Purchase - aspose.com

Did it help you? Thanks.

Very useful !! thanks so much, yes the GetExtent() method is quite handy while the BBOX cannot be provided straight from the conversion, also thanks for the link to get the free trial license :grinning::+1: , will keep you posted on how the tests go

Hello, @luongor27!

One of the features (GISNET-507) you were looking for is available in Aspose.GIS for .NET 20.2. Aspose.GIS allows you to read and write BBOX members from GeoJSON. Please, take a look at 'ReadBoundingBoxe’s and ‘WriteBoundingBoxes’ options.

In case of any further assistance, please feel free to let us know.