Shape file to ODS (Open Document Spreadsheet) conversion is required when you only need non spatial information i.e. only attribute information. This conversion need ogr2ogr utility. Or you may also you any other tool to convert shp to ods easily.
Convert SHP to ODS using MapOG Tool for hassle free conversion
What is ODS (Open Document Spreadsheet) and Shapefile-Shp to ODS CONVERT
An ODS (Open Document Spreadsheet) file is a spreadsheet. It stores data in cells that are organized into rows and columns. ODS files are formatted using the OASIS Open Document XML-based standard. Whereas shape files are collection of geometry with non spatial data as attributes.
To install ogr2ogr utility you can follow the given lines of command.
Then check for presence of ogr2ogr utility by typing ogr2ogr in your terminal.
Conversion- Shapefile shp to ODS (Open Document Spreadsheet) using Ogr2ogr utility-
Now the conversion command can be executed,
–> ogr2ogr -f ODS output_ods_fileName.ods India_raods.shp
Here, in the command -f is the option for file format.
Note that while converting shx file should be present in same folder where shp file is kept. Otherwise you will get error like-
All the supported file (.shx, .prj and .dbf etc.) should be kept together while performing any conversion.
Code- Convert shp to ods
You can use any programming language to convert between shapefile to ods, if you know the format of shapefile and ods file. I have created one such minimum example of code to find the minimum bounding box of shapefile with c++ programming lanauage. Below is the php code.
public function shptoods($shpfilepath,$output) {
$query=”ogr2ogr -f ODS $output.ods $shpfilepath.shp”;
shell_exec($query);
}
The generated output can be seen in the same folder, where shapefile is kept. Output will look as-
You may also be interested in knowing how to convert shapefile to kml, shp to gml, shapefile to csv, shapefile to geojson, shapefile to topojson etc.
Hope this post is helpful for you to convert shp to ods document. If you find any difficulty in implementing the conversion of shapefile to open document spreadsheet, let you know by commenting below in the box provided.