2

Which of those files are needed, to be able to convert them to geojson without losing any information?

From what i know:

  • *.shp - contains coordinates for lines, points, and other geometries
  • *.prj - contains data about projection, that shapefile is using

I don't know what *.dbf and *.shx files are for. Do I need them to convert to geojson?

1
  • 4
    You need .dbf - that is the attributes. .shx is just indexes, but they are mandatory part of the shapefile, so you need those too.
    – BradHards
    Jan 5, 2017 at 7:17

1 Answer 1

1

Converting to GeoJson, you need the geometry, so the .shp should be sufficient plus the .prj for the projection. The other extensions provide indexing capabilities and attribute table information

Esri's definitions for .shx and .dbf is the following:

.shx—The index file that stores the index of the feature geometry; required.

.dbf—The dBASE table that stores the attribute information of features; required. There is a one-to-one relationship between geometry and attributes, which is based on record number. Attribute records in the dBASE file must be in the same order as records in the main file.

enter image description here

Another way to understand those extensions

.shx: ESRI and AutoCAD shape index position. This type of file is used to search forward and backwards. Mandatory.

.dbf: Standard database file used to store attribute data and object IDs. .dbf can be opened in Microsoft Access or Excel. Mandatory.

1
  • Depending on the software being used, you would need the .shp and the .shx. For example QGIS or OGR will not open a ShapeFile without the .shx, although in GDAL 2.1 onwards a missing .shx can be generated. Jan 10, 2017 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.