Opened 16 years ago
Closed 12 years ago
#2374 closed defect (fixed)
OGR : Shapefile driver : Possible bug in Coordinate Dimension
Reported by: | nbo | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.9.0 |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | shape |
Cc: |
Description
Hello, I have been checking the source code of the OGR shapefile driver.There is a problem with Measures types (Version 1.51). For example, a PointM and a PointZ are considered as 3 dimensions (OGRPoint is initialized with X,Y,Z on both cases,the problem is that PointM has no Z information).Point is considered as 2 dimensions. If we follow the simple feature architecture,Point & PointM are 2 dimensions and Point Z 3.
Attachments (1)
Change History (8)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Component: | default → OGR_SF |
---|---|
Keywords: | shape added |
Status: | new → assigned |
First, OGR is based on Simple Features 1.0, so it doesn't properly handle measures. Instead the shapefile driver (may) just wedge it into the Z and threat it as 3 dimensional. If that is the situation, I don't plan to make any changes till we upgrade to Simple Features 1.2 as our base model.
If you have a PointM file where the M is discarded but the dimension is still set to 3 then that might be something I could look into.
comment:3 by , 16 years ago
just a remark,for example : PointM shapefiles (no Z coordinate):
- The Z coordinate is put into OGRPoint (Z is,in that case always 0.00).
If we want to seek the Simple Features 1.0 spec,we should coords dimensions at 2 for Point and PointM.... Anyway,I have modified the driver in order to support Mesures with an overloaded class.
by , 12 years ago
Attachment: | shapefile-measure-support.patch added |
---|
comment:6 by , 12 years ago
Milestone: | → 1.9.0 |
---|
The attached patch adds read support for Shapfile measures.
Measures are read as Z values. This opens the possibility to work with M values in OGR clients like QGIS.
comment:7 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Patch committed in trunk (r23599) with a slightly different test case. It would be nice to support similar logic when creating xym geometries but I'll leave that for later.
Forgot to say that this is the same for Lines,polygons....