[gdal-dev] Crash: [GDAL 1.10dev] empty shapefile with spatial index

Even Rouault even.rouault at mines-paris.org
Fri Apr 5 13:33:26 PDT 2013


Le vendredi 05 avril 2013 13:12:13, Dennis Gocke a écrit :
> Wow, that was fast, Thanks.
> 
> I just remembered something else I stumbled upon related to the shapefile
> driver.
> 
> It's more of an user/programmer error, but it might be interesting
> nonetheless.
> After deleting features we normally Execute the "REPACK LayerName".
> The problem is that when LayerName is not in the correct case sensitivity,
> it does not work.
> Which is understandable because on non-windows filesystems there might
> actually be different files.
> 
> The funny thing is, when you open the DataSource/Layer with incorrect case
> sensitivity in the filepath, it first seems that everything is fine, but
> when you call "REPACK " + layer.GetName() it does not work, because
> layer.GetName() will return the same wrong case sensitivity that was
> provided when the DataSource was opened.
> 
> And there is another thing. Once someone had managed to have the different
> files belonging to the same shapefile (shp, dbf) in different case
> sensitivies (e.g. data.shp and DATA.dbf). As above everything except the
> REPACK seemed to work fine, but the REPACK did not work. I think in this
> case "REPACK data"/"REPACK DATA" either did nothing like above or it even
> threw an error. That depended on how the datasource was opened with
> Open("DATA.shp", 1) or Open("data.shp", 1). But in this case neither
> combination worked.
> 
> Let me know if you would like more details on this.

Well, this mix of filename cases is certainly something that I would avoid 
because it will likely trigger a number of issues. That said, the fix for that 
particular case was easy so I've committed it. But it is only for Windows. On 
Linux, foo.shp and FOO.DBF in the same directory are going to be considered as 
two different layers.


More information about the gdal-dev mailing list