Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#5702 closed defect (fixed)

Shp wit (nan,ana) extent are not shown (in QGIS)

Reported by: pcav Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: OGR_SF Version: 1.10.1
Severity: normal Keywords:


See the attached file

Attachments (1) (252.9 KB) - added by pcav 7 years ago.
Invisible shapefile

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by pcav

Attachment: added

Invisible shapefile

comment:1 Changed 7 years ago by Even Rouault

trunk r27879 "Shape: GetExtent?(): don't trust extent in header if it contains Not-A-Number values (#5702)"

I've fixed GetExtent?(), but that shapefile is broken in many other ways. Line geometries contain NaN values as coordinates too ! And ogr2ogr unfortunately doesn't sanitize this.


  ID (Real) = 0
  Ouptutraste (Real) = 0.0000000000
  LINESTRING (nan nan,nan nan,nan nan....nan nan)

  ID (Real) = 1
  Ouptutraste (Real) = 0.0000000000
  LINESTRING (nan nan)

  ID (Real) = 2
  Ouptutraste (Real) = 1.0000000000
  LINESTRING (nan nan,nan nan,nan nan,nan nan,nan nan,...
1694591.583145826822147 4698073.881762228906155,1694340.230359232518822 4698214.610078467987478,1693840.692357746884227 4698529.708806237205863,1693779.789891807362437 4698573.419763714075089,1693341.154356261249632 4698885.806227066554129,...1568456.653984861215577 4777344.220494321547449)

comment:3 Changed 7 years ago by pcav

Apparently that shp has other issues as well: the length of the column name in the DBF file is not valid. The maximal length of column name is 10 chars in the DBF, "Ouptutraste" is 11 chars long. Thanks Siki for pointing this out. Should I open different ticket as feature request for OGR being able to handle these malformed characteristics?

comment:4 Changed 7 years ago by Even Rouault

Regarding field name width, I'm not sure if something has to be done. mentions a possible length of 11 bytes, that OGR can deal with when reading. However when writing shapefiles, OGR limit itselfs to 10 characters (perhaps an historical limit of ESRI products?) and puts a null byte at the 11th byte in the field description structure, accordingly to (but the information there is perhaps derived from shapelib implementation!).

Regarding invalid geometries, that could be a -sanitize option of ogr2ogr, or something like that. But we likely wouldn't want to do that by default for use cases where maximum performance is sought.

comment:5 Changed 7 years ago by Even Rouault

Milestone: 2.0
Resolution: fixed
Status: newclosed

Closing that ticket. Issue raised has been fixed.

comment:6 Changed 6 years ago by Even Rouault


Milestone renamed

Note: See TracTickets for help on using tickets.