Shx and Shp explained?
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
7
down vote
favorite
I am searching for a more in depth explanation of the differences in shp and shx files to little avail. I mean beyond the 'shp contain geometry - shx contains an index of the geometry'.
The reason I ask, is because while working in QGIS recently, I have made two observations that led to questions in my mind around the exact differences in these file extentions:
- QGIS can open and display both shx and shp, and each file appears to be more or less identical in their output (display),
- but not exactly so - I have noticed that sometimes the matching shx/shp files display slightly 'off-kilter' relative to each other. It doesn't appear to be a projection issue, they simply don't draw in the exact same location as each other.
These observations made me curious as to why these differences in display exist, and why QGIS can open and operate the shx in the same manner as the shp, when previously my understanding was that the shp is the 'master' file if you will, but requires .dbf and .shx to function correctly as a single, whole entity.
qgis shapefile file-formats
add a comment |Â
up vote
7
down vote
favorite
I am searching for a more in depth explanation of the differences in shp and shx files to little avail. I mean beyond the 'shp contain geometry - shx contains an index of the geometry'.
The reason I ask, is because while working in QGIS recently, I have made two observations that led to questions in my mind around the exact differences in these file extentions:
- QGIS can open and display both shx and shp, and each file appears to be more or less identical in their output (display),
- but not exactly so - I have noticed that sometimes the matching shx/shp files display slightly 'off-kilter' relative to each other. It doesn't appear to be a projection issue, they simply don't draw in the exact same location as each other.
These observations made me curious as to why these differences in display exist, and why QGIS can open and operate the shx in the same manner as the shp, when previously my understanding was that the shp is the 'master' file if you will, but requires .dbf and .shx to function correctly as a single, whole entity.
qgis shapefile file-formats
2
@Chris, have you seen this references ESRI Shapefile Technical Description, What are the shapefile files?, and What is a Shapefile?.
â Taras
Sep 4 at 10:25
2
Look at GeospatialPython.com:Generating Shapefile shx Files
â gene
Sep 4 at 14:58
add a comment |Â
up vote
7
down vote
favorite
up vote
7
down vote
favorite
I am searching for a more in depth explanation of the differences in shp and shx files to little avail. I mean beyond the 'shp contain geometry - shx contains an index of the geometry'.
The reason I ask, is because while working in QGIS recently, I have made two observations that led to questions in my mind around the exact differences in these file extentions:
- QGIS can open and display both shx and shp, and each file appears to be more or less identical in their output (display),
- but not exactly so - I have noticed that sometimes the matching shx/shp files display slightly 'off-kilter' relative to each other. It doesn't appear to be a projection issue, they simply don't draw in the exact same location as each other.
These observations made me curious as to why these differences in display exist, and why QGIS can open and operate the shx in the same manner as the shp, when previously my understanding was that the shp is the 'master' file if you will, but requires .dbf and .shx to function correctly as a single, whole entity.
qgis shapefile file-formats
I am searching for a more in depth explanation of the differences in shp and shx files to little avail. I mean beyond the 'shp contain geometry - shx contains an index of the geometry'.
The reason I ask, is because while working in QGIS recently, I have made two observations that led to questions in my mind around the exact differences in these file extentions:
- QGIS can open and display both shx and shp, and each file appears to be more or less identical in their output (display),
- but not exactly so - I have noticed that sometimes the matching shx/shp files display slightly 'off-kilter' relative to each other. It doesn't appear to be a projection issue, they simply don't draw in the exact same location as each other.
These observations made me curious as to why these differences in display exist, and why QGIS can open and operate the shx in the same manner as the shp, when previously my understanding was that the shp is the 'master' file if you will, but requires .dbf and .shx to function correctly as a single, whole entity.
qgis shapefile file-formats
qgis shapefile file-formats
edited Sep 4 at 10:21
Matthias Kuhn
17.6k14486
17.6k14486
asked Sep 4 at 10:13
Maggie
836
836
2
@Chris, have you seen this references ESRI Shapefile Technical Description, What are the shapefile files?, and What is a Shapefile?.
â Taras
Sep 4 at 10:25
2
Look at GeospatialPython.com:Generating Shapefile shx Files
â gene
Sep 4 at 14:58
add a comment |Â
2
@Chris, have you seen this references ESRI Shapefile Technical Description, What are the shapefile files?, and What is a Shapefile?.
â Taras
Sep 4 at 10:25
2
Look at GeospatialPython.com:Generating Shapefile shx Files
â gene
Sep 4 at 14:58
2
2
@Chris, have you seen this references ESRI Shapefile Technical Description, What are the shapefile files?, and What is a Shapefile?.
â Taras
Sep 4 at 10:25
@Chris, have you seen this references ESRI Shapefile Technical Description, What are the shapefile files?, and What is a Shapefile?.
â Taras
Sep 4 at 10:25
2
2
Look at GeospatialPython.com:Generating Shapefile shx Files
â gene
Sep 4 at 14:58
Look at GeospatialPython.com:Generating Shapefile shx Files
â gene
Sep 4 at 14:58
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
15
down vote
accepted
The definitive reference on the shapefile format is the ESRI Shapefile Technical Description.
It is misleading to describe the shx
as being an "index." Instead, it is the direct access offset file. There is no data in the shx
, only a clone of the first hundred bytes and record number and offset to the starting byte of that record in the shp
. The only location for attributes is the dbf
(which is standalone -- despite "knowledge" to the contrary, the shx
does not tie the shp
and dbf
, only record number does that).
It is possible for shapefiles to have "gaps" in the shp
which make the shx
indispensible, but in practice Esri tools will rewrite the entire shp
and shx
so that any gap created by editing records is removed. Under most conditions, it is possible to recover the shx
contents if it goes missing; the same cannot be said for the shp
or dbf
.
The naming of shp
and shx
is an artifact of the VFILE
variable width direct access module of the PrImeOS operating system, first ported by Esri to Unix, VAX/VMS, Data General, and IBM, then to Microsoft Windows. The sbn
/sbx
spatial index pair shares the same naming convention (though these are not documented within the shapefile specification). Within the original VFILE
FORTRAN library, only the base file was named, and the offset file with an x
terminal character just appeared at file creation.
If you search for .shx in that document the first entry is "The suffix for the index file is .shx". It's not a link between the dbf and shp, but as I understand it more like a spatial index.
â HeikkiVesanto
Sep 4 at 11:02
1
And later:The index file (.shx) contains a 100-byte header followed by 8-byte, fixed-length records. Figure 4 illustrates the index file organization.
Logically it is analogous to database indexesa data structure that improves the speed of data retrieval operations
.
â user30184
Sep 4 at 11:06
No, theshx
is absolutely not a spatial index.
â Vince
Sep 4 at 11:41
1
"..., only a clone of the first hundred bytes and record number and ...". "... the shx does not tie the shp and dbf, only record number does that". First you say 'record number' is within .shx. Later you say .shx does not tie .shp and .dbf, but that 'record number' does. If 'record number' ties the two cited formats and it is part of .shx, then why can't it be said .shx ties .shp and .dbf? It is confusing to me this part of your answer. Can you clarify? Tks.
â Andre Silva
Sep 4 at 23:34
1
The record number is present in bothshp
andshx
. It is not present in thedbf
, only the implicit byte offset from the end of the header records (40 bytes for table, which includes a field count, and 40 additional bytes for each field) times the record size. I've written shapefile readers and writers in both 'C' and Java, and it is the loop counter variable of the program which links theshp
/shx
to thedbf
. Theshx
provides linkage of record number, by offset with a recno integrity check, to the start of theshp
record, nothing more.
â Vince
Sep 5 at 1:59
 |Â
show 1 more comment
up vote
12
down vote
Shx certainly has nothing to show on a map alone as you can read from the specification https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf.
You are indeed right in that it is possible to open shapefile by selecting the .shx part with QGIS 3.0.3 but I can't see any difference on the location. I believe that shapefile is still opened through the same path and the result is the same. If you can make a test case for reproducing the issue of different placement of the geometries please create a QGIS ticket about the issue.
If you delete .shp part you'll see that QGIS does not open .shx alone.
My mistake, I checked the same files again and it was indeed a mismatched projection. When I realigned these, the shx and shp versions of the same layer lined up and were identical as expected. Interestingly, QGIS allows both the .shx and .shp to be uploaded to the same project, and they display their own respective source path, but as pointed out by others, the output is the exact same geometries as these are indeed the same file.
â Maggie
Sep 5 at 7:29
add a comment |Â
up vote
2
down vote
.shx
is the index for a .shp
file.
You need both to be able to open the .shp
file. If you open a .shx
file in QGIS, it opens the .shp
file. If they are off, it is a projection issue.
A ShepeFile needs three components:
.shp
- stores the geometry.shx
- stores the index.dbf
- stores the attributes
A .prj
file is usually recommended, which stores the projection information. There can be other files associated with a ShapeFile, but these are not absolutely needed.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
15
down vote
accepted
The definitive reference on the shapefile format is the ESRI Shapefile Technical Description.
It is misleading to describe the shx
as being an "index." Instead, it is the direct access offset file. There is no data in the shx
, only a clone of the first hundred bytes and record number and offset to the starting byte of that record in the shp
. The only location for attributes is the dbf
(which is standalone -- despite "knowledge" to the contrary, the shx
does not tie the shp
and dbf
, only record number does that).
It is possible for shapefiles to have "gaps" in the shp
which make the shx
indispensible, but in practice Esri tools will rewrite the entire shp
and shx
so that any gap created by editing records is removed. Under most conditions, it is possible to recover the shx
contents if it goes missing; the same cannot be said for the shp
or dbf
.
The naming of shp
and shx
is an artifact of the VFILE
variable width direct access module of the PrImeOS operating system, first ported by Esri to Unix, VAX/VMS, Data General, and IBM, then to Microsoft Windows. The sbn
/sbx
spatial index pair shares the same naming convention (though these are not documented within the shapefile specification). Within the original VFILE
FORTRAN library, only the base file was named, and the offset file with an x
terminal character just appeared at file creation.
If you search for .shx in that document the first entry is "The suffix for the index file is .shx". It's not a link between the dbf and shp, but as I understand it more like a spatial index.
â HeikkiVesanto
Sep 4 at 11:02
1
And later:The index file (.shx) contains a 100-byte header followed by 8-byte, fixed-length records. Figure 4 illustrates the index file organization.
Logically it is analogous to database indexesa data structure that improves the speed of data retrieval operations
.
â user30184
Sep 4 at 11:06
No, theshx
is absolutely not a spatial index.
â Vince
Sep 4 at 11:41
1
"..., only a clone of the first hundred bytes and record number and ...". "... the shx does not tie the shp and dbf, only record number does that". First you say 'record number' is within .shx. Later you say .shx does not tie .shp and .dbf, but that 'record number' does. If 'record number' ties the two cited formats and it is part of .shx, then why can't it be said .shx ties .shp and .dbf? It is confusing to me this part of your answer. Can you clarify? Tks.
â Andre Silva
Sep 4 at 23:34
1
The record number is present in bothshp
andshx
. It is not present in thedbf
, only the implicit byte offset from the end of the header records (40 bytes for table, which includes a field count, and 40 additional bytes for each field) times the record size. I've written shapefile readers and writers in both 'C' and Java, and it is the loop counter variable of the program which links theshp
/shx
to thedbf
. Theshx
provides linkage of record number, by offset with a recno integrity check, to the start of theshp
record, nothing more.
â Vince
Sep 5 at 1:59
 |Â
show 1 more comment
up vote
15
down vote
accepted
The definitive reference on the shapefile format is the ESRI Shapefile Technical Description.
It is misleading to describe the shx
as being an "index." Instead, it is the direct access offset file. There is no data in the shx
, only a clone of the first hundred bytes and record number and offset to the starting byte of that record in the shp
. The only location for attributes is the dbf
(which is standalone -- despite "knowledge" to the contrary, the shx
does not tie the shp
and dbf
, only record number does that).
It is possible for shapefiles to have "gaps" in the shp
which make the shx
indispensible, but in practice Esri tools will rewrite the entire shp
and shx
so that any gap created by editing records is removed. Under most conditions, it is possible to recover the shx
contents if it goes missing; the same cannot be said for the shp
or dbf
.
The naming of shp
and shx
is an artifact of the VFILE
variable width direct access module of the PrImeOS operating system, first ported by Esri to Unix, VAX/VMS, Data General, and IBM, then to Microsoft Windows. The sbn
/sbx
spatial index pair shares the same naming convention (though these are not documented within the shapefile specification). Within the original VFILE
FORTRAN library, only the base file was named, and the offset file with an x
terminal character just appeared at file creation.
If you search for .shx in that document the first entry is "The suffix for the index file is .shx". It's not a link between the dbf and shp, but as I understand it more like a spatial index.
â HeikkiVesanto
Sep 4 at 11:02
1
And later:The index file (.shx) contains a 100-byte header followed by 8-byte, fixed-length records. Figure 4 illustrates the index file organization.
Logically it is analogous to database indexesa data structure that improves the speed of data retrieval operations
.
â user30184
Sep 4 at 11:06
No, theshx
is absolutely not a spatial index.
â Vince
Sep 4 at 11:41
1
"..., only a clone of the first hundred bytes and record number and ...". "... the shx does not tie the shp and dbf, only record number does that". First you say 'record number' is within .shx. Later you say .shx does not tie .shp and .dbf, but that 'record number' does. If 'record number' ties the two cited formats and it is part of .shx, then why can't it be said .shx ties .shp and .dbf? It is confusing to me this part of your answer. Can you clarify? Tks.
â Andre Silva
Sep 4 at 23:34
1
The record number is present in bothshp
andshx
. It is not present in thedbf
, only the implicit byte offset from the end of the header records (40 bytes for table, which includes a field count, and 40 additional bytes for each field) times the record size. I've written shapefile readers and writers in both 'C' and Java, and it is the loop counter variable of the program which links theshp
/shx
to thedbf
. Theshx
provides linkage of record number, by offset with a recno integrity check, to the start of theshp
record, nothing more.
â Vince
Sep 5 at 1:59
 |Â
show 1 more comment
up vote
15
down vote
accepted
up vote
15
down vote
accepted
The definitive reference on the shapefile format is the ESRI Shapefile Technical Description.
It is misleading to describe the shx
as being an "index." Instead, it is the direct access offset file. There is no data in the shx
, only a clone of the first hundred bytes and record number and offset to the starting byte of that record in the shp
. The only location for attributes is the dbf
(which is standalone -- despite "knowledge" to the contrary, the shx
does not tie the shp
and dbf
, only record number does that).
It is possible for shapefiles to have "gaps" in the shp
which make the shx
indispensible, but in practice Esri tools will rewrite the entire shp
and shx
so that any gap created by editing records is removed. Under most conditions, it is possible to recover the shx
contents if it goes missing; the same cannot be said for the shp
or dbf
.
The naming of shp
and shx
is an artifact of the VFILE
variable width direct access module of the PrImeOS operating system, first ported by Esri to Unix, VAX/VMS, Data General, and IBM, then to Microsoft Windows. The sbn
/sbx
spatial index pair shares the same naming convention (though these are not documented within the shapefile specification). Within the original VFILE
FORTRAN library, only the base file was named, and the offset file with an x
terminal character just appeared at file creation.
The definitive reference on the shapefile format is the ESRI Shapefile Technical Description.
It is misleading to describe the shx
as being an "index." Instead, it is the direct access offset file. There is no data in the shx
, only a clone of the first hundred bytes and record number and offset to the starting byte of that record in the shp
. The only location for attributes is the dbf
(which is standalone -- despite "knowledge" to the contrary, the shx
does not tie the shp
and dbf
, only record number does that).
It is possible for shapefiles to have "gaps" in the shp
which make the shx
indispensible, but in practice Esri tools will rewrite the entire shp
and shx
so that any gap created by editing records is removed. Under most conditions, it is possible to recover the shx
contents if it goes missing; the same cannot be said for the shp
or dbf
.
The naming of shp
and shx
is an artifact of the VFILE
variable width direct access module of the PrImeOS operating system, first ported by Esri to Unix, VAX/VMS, Data General, and IBM, then to Microsoft Windows. The sbn
/sbx
spatial index pair shares the same naming convention (though these are not documented within the shapefile specification). Within the original VFILE
FORTRAN library, only the base file was named, and the offset file with an x
terminal character just appeared at file creation.
edited Sep 4 at 14:24
answered Sep 4 at 10:50
Vince
14k32444
14k32444
If you search for .shx in that document the first entry is "The suffix for the index file is .shx". It's not a link between the dbf and shp, but as I understand it more like a spatial index.
â HeikkiVesanto
Sep 4 at 11:02
1
And later:The index file (.shx) contains a 100-byte header followed by 8-byte, fixed-length records. Figure 4 illustrates the index file organization.
Logically it is analogous to database indexesa data structure that improves the speed of data retrieval operations
.
â user30184
Sep 4 at 11:06
No, theshx
is absolutely not a spatial index.
â Vince
Sep 4 at 11:41
1
"..., only a clone of the first hundred bytes and record number and ...". "... the shx does not tie the shp and dbf, only record number does that". First you say 'record number' is within .shx. Later you say .shx does not tie .shp and .dbf, but that 'record number' does. If 'record number' ties the two cited formats and it is part of .shx, then why can't it be said .shx ties .shp and .dbf? It is confusing to me this part of your answer. Can you clarify? Tks.
â Andre Silva
Sep 4 at 23:34
1
The record number is present in bothshp
andshx
. It is not present in thedbf
, only the implicit byte offset from the end of the header records (40 bytes for table, which includes a field count, and 40 additional bytes for each field) times the record size. I've written shapefile readers and writers in both 'C' and Java, and it is the loop counter variable of the program which links theshp
/shx
to thedbf
. Theshx
provides linkage of record number, by offset with a recno integrity check, to the start of theshp
record, nothing more.
â Vince
Sep 5 at 1:59
 |Â
show 1 more comment
If you search for .shx in that document the first entry is "The suffix for the index file is .shx". It's not a link between the dbf and shp, but as I understand it more like a spatial index.
â HeikkiVesanto
Sep 4 at 11:02
1
And later:The index file (.shx) contains a 100-byte header followed by 8-byte, fixed-length records. Figure 4 illustrates the index file organization.
Logically it is analogous to database indexesa data structure that improves the speed of data retrieval operations
.
â user30184
Sep 4 at 11:06
No, theshx
is absolutely not a spatial index.
â Vince
Sep 4 at 11:41
1
"..., only a clone of the first hundred bytes and record number and ...". "... the shx does not tie the shp and dbf, only record number does that". First you say 'record number' is within .shx. Later you say .shx does not tie .shp and .dbf, but that 'record number' does. If 'record number' ties the two cited formats and it is part of .shx, then why can't it be said .shx ties .shp and .dbf? It is confusing to me this part of your answer. Can you clarify? Tks.
â Andre Silva
Sep 4 at 23:34
1
The record number is present in bothshp
andshx
. It is not present in thedbf
, only the implicit byte offset from the end of the header records (40 bytes for table, which includes a field count, and 40 additional bytes for each field) times the record size. I've written shapefile readers and writers in both 'C' and Java, and it is the loop counter variable of the program which links theshp
/shx
to thedbf
. Theshx
provides linkage of record number, by offset with a recno integrity check, to the start of theshp
record, nothing more.
â Vince
Sep 5 at 1:59
If you search for .shx in that document the first entry is "The suffix for the index file is .shx". It's not a link between the dbf and shp, but as I understand it more like a spatial index.
â HeikkiVesanto
Sep 4 at 11:02
If you search for .shx in that document the first entry is "The suffix for the index file is .shx". It's not a link between the dbf and shp, but as I understand it more like a spatial index.
â HeikkiVesanto
Sep 4 at 11:02
1
1
And later:
The index file (.shx) contains a 100-byte header followed by 8-byte, fixed-length records. Figure 4 illustrates the index file organization.
Logically it is analogous to database indexes a data structure that improves the speed of data retrieval operations
.â user30184
Sep 4 at 11:06
And later:
The index file (.shx) contains a 100-byte header followed by 8-byte, fixed-length records. Figure 4 illustrates the index file organization.
Logically it is analogous to database indexes a data structure that improves the speed of data retrieval operations
.â user30184
Sep 4 at 11:06
No, the
shx
is absolutely not a spatial index.â Vince
Sep 4 at 11:41
No, the
shx
is absolutely not a spatial index.â Vince
Sep 4 at 11:41
1
1
"..., only a clone of the first hundred bytes and record number and ...". "... the shx does not tie the shp and dbf, only record number does that". First you say 'record number' is within .shx. Later you say .shx does not tie .shp and .dbf, but that 'record number' does. If 'record number' ties the two cited formats and it is part of .shx, then why can't it be said .shx ties .shp and .dbf? It is confusing to me this part of your answer. Can you clarify? Tks.
â Andre Silva
Sep 4 at 23:34
"..., only a clone of the first hundred bytes and record number and ...". "... the shx does not tie the shp and dbf, only record number does that". First you say 'record number' is within .shx. Later you say .shx does not tie .shp and .dbf, but that 'record number' does. If 'record number' ties the two cited formats and it is part of .shx, then why can't it be said .shx ties .shp and .dbf? It is confusing to me this part of your answer. Can you clarify? Tks.
â Andre Silva
Sep 4 at 23:34
1
1
The record number is present in both
shp
and shx
. It is not present in the dbf
, only the implicit byte offset from the end of the header records (40 bytes for table, which includes a field count, and 40 additional bytes for each field) times the record size. I've written shapefile readers and writers in both 'C' and Java, and it is the loop counter variable of the program which links the shp
/shx
to the dbf
. The shx
provides linkage of record number, by offset with a recno integrity check, to the start of the shp
record, nothing more.â Vince
Sep 5 at 1:59
The record number is present in both
shp
and shx
. It is not present in the dbf
, only the implicit byte offset from the end of the header records (40 bytes for table, which includes a field count, and 40 additional bytes for each field) times the record size. I've written shapefile readers and writers in both 'C' and Java, and it is the loop counter variable of the program which links the shp
/shx
to the dbf
. The shx
provides linkage of record number, by offset with a recno integrity check, to the start of the shp
record, nothing more.â Vince
Sep 5 at 1:59
 |Â
show 1 more comment
up vote
12
down vote
Shx certainly has nothing to show on a map alone as you can read from the specification https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf.
You are indeed right in that it is possible to open shapefile by selecting the .shx part with QGIS 3.0.3 but I can't see any difference on the location. I believe that shapefile is still opened through the same path and the result is the same. If you can make a test case for reproducing the issue of different placement of the geometries please create a QGIS ticket about the issue.
If you delete .shp part you'll see that QGIS does not open .shx alone.
My mistake, I checked the same files again and it was indeed a mismatched projection. When I realigned these, the shx and shp versions of the same layer lined up and were identical as expected. Interestingly, QGIS allows both the .shx and .shp to be uploaded to the same project, and they display their own respective source path, but as pointed out by others, the output is the exact same geometries as these are indeed the same file.
â Maggie
Sep 5 at 7:29
add a comment |Â
up vote
12
down vote
Shx certainly has nothing to show on a map alone as you can read from the specification https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf.
You are indeed right in that it is possible to open shapefile by selecting the .shx part with QGIS 3.0.3 but I can't see any difference on the location. I believe that shapefile is still opened through the same path and the result is the same. If you can make a test case for reproducing the issue of different placement of the geometries please create a QGIS ticket about the issue.
If you delete .shp part you'll see that QGIS does not open .shx alone.
My mistake, I checked the same files again and it was indeed a mismatched projection. When I realigned these, the shx and shp versions of the same layer lined up and were identical as expected. Interestingly, QGIS allows both the .shx and .shp to be uploaded to the same project, and they display their own respective source path, but as pointed out by others, the output is the exact same geometries as these are indeed the same file.
â Maggie
Sep 5 at 7:29
add a comment |Â
up vote
12
down vote
up vote
12
down vote
Shx certainly has nothing to show on a map alone as you can read from the specification https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf.
You are indeed right in that it is possible to open shapefile by selecting the .shx part with QGIS 3.0.3 but I can't see any difference on the location. I believe that shapefile is still opened through the same path and the result is the same. If you can make a test case for reproducing the issue of different placement of the geometries please create a QGIS ticket about the issue.
If you delete .shp part you'll see that QGIS does not open .shx alone.
Shx certainly has nothing to show on a map alone as you can read from the specification https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf.
You are indeed right in that it is possible to open shapefile by selecting the .shx part with QGIS 3.0.3 but I can't see any difference on the location. I believe that shapefile is still opened through the same path and the result is the same. If you can make a test case for reproducing the issue of different placement of the geometries please create a QGIS ticket about the issue.
If you delete .shp part you'll see that QGIS does not open .shx alone.
answered Sep 4 at 10:30
user30184
26.9k22750
26.9k22750
My mistake, I checked the same files again and it was indeed a mismatched projection. When I realigned these, the shx and shp versions of the same layer lined up and were identical as expected. Interestingly, QGIS allows both the .shx and .shp to be uploaded to the same project, and they display their own respective source path, but as pointed out by others, the output is the exact same geometries as these are indeed the same file.
â Maggie
Sep 5 at 7:29
add a comment |Â
My mistake, I checked the same files again and it was indeed a mismatched projection. When I realigned these, the shx and shp versions of the same layer lined up and were identical as expected. Interestingly, QGIS allows both the .shx and .shp to be uploaded to the same project, and they display their own respective source path, but as pointed out by others, the output is the exact same geometries as these are indeed the same file.
â Maggie
Sep 5 at 7:29
My mistake, I checked the same files again and it was indeed a mismatched projection. When I realigned these, the shx and shp versions of the same layer lined up and were identical as expected. Interestingly, QGIS allows both the .shx and .shp to be uploaded to the same project, and they display their own respective source path, but as pointed out by others, the output is the exact same geometries as these are indeed the same file.
â Maggie
Sep 5 at 7:29
My mistake, I checked the same files again and it was indeed a mismatched projection. When I realigned these, the shx and shp versions of the same layer lined up and were identical as expected. Interestingly, QGIS allows both the .shx and .shp to be uploaded to the same project, and they display their own respective source path, but as pointed out by others, the output is the exact same geometries as these are indeed the same file.
â Maggie
Sep 5 at 7:29
add a comment |Â
up vote
2
down vote
.shx
is the index for a .shp
file.
You need both to be able to open the .shp
file. If you open a .shx
file in QGIS, it opens the .shp
file. If they are off, it is a projection issue.
A ShepeFile needs three components:
.shp
- stores the geometry.shx
- stores the index.dbf
- stores the attributes
A .prj
file is usually recommended, which stores the projection information. There can be other files associated with a ShapeFile, but these are not absolutely needed.
add a comment |Â
up vote
2
down vote
.shx
is the index for a .shp
file.
You need both to be able to open the .shp
file. If you open a .shx
file in QGIS, it opens the .shp
file. If they are off, it is a projection issue.
A ShepeFile needs three components:
.shp
- stores the geometry.shx
- stores the index.dbf
- stores the attributes
A .prj
file is usually recommended, which stores the projection information. There can be other files associated with a ShapeFile, but these are not absolutely needed.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
.shx
is the index for a .shp
file.
You need both to be able to open the .shp
file. If you open a .shx
file in QGIS, it opens the .shp
file. If they are off, it is a projection issue.
A ShepeFile needs three components:
.shp
- stores the geometry.shx
- stores the index.dbf
- stores the attributes
A .prj
file is usually recommended, which stores the projection information. There can be other files associated with a ShapeFile, but these are not absolutely needed.
.shx
is the index for a .shp
file.
You need both to be able to open the .shp
file. If you open a .shx
file in QGIS, it opens the .shp
file. If they are off, it is a projection issue.
A ShepeFile needs three components:
.shp
- stores the geometry.shx
- stores the index.dbf
- stores the attributes
A .prj
file is usually recommended, which stores the projection information. There can be other files associated with a ShapeFile, but these are not absolutely needed.
edited Sep 7 at 18:18
chicks
1376
1376
answered Sep 4 at 10:29
HeikkiVesanto
7,8061942
7,8061942
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f294868%2fshx-and-shp-explained%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
@Chris, have you seen this references ESRI Shapefile Technical Description, What are the shapefile files?, and What is a Shapefile?.
â Taras
Sep 4 at 10:25
2
Look at GeospatialPython.com:Generating Shapefile shx Files
â gene
Sep 4 at 14:58