Shapefile spatial index and updates

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Shapefile spatial index and updates

Hugentobler  Marco
Hi gdal/ogr devs

In QGIS, there is a bug where updates to shapefiles are not displayed until the spatial index of a shapefile is recreated (http://trac.osgeo.org/qgis/ticket/1572).

It seems to me that OGR does not update the index automatically when calling e.g. OGR_L_CreateFeature and then OGR_L_SyncToDisk.

What I did is to check (in the ogr provider of qgis) if the shapefile already has an index file and, if yes, create a new spatial index. But this way, the whole index needs to be recreated, so I wanted to ask here on the list if you know about any more efficient and / or more elegant way to solve this problem.


Thanks for your help,
Marco
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Shapefile spatial index and updates

chaitanya_ch
Marco,

I have been working on this. http://trac.osgeo.org/gdal/ticket/2798

On Fri, Jul 31, 2009 at 6:12 PM, Hugentobler Marco <[hidden email]> wrote:
Hi gdal/ogr devs

In QGIS, there is a bug where updates to shapefiles are not displayed until the spatial index of a shapefile is recreated (http://trac.osgeo.org/qgis/ticket/1572).

It seems to me that OGR does not update the index automatically when calling e.g. OGR_L_CreateFeature and then OGR_L_SyncToDisk.

What I did is to check (in the ogr provider of qgis) if the shapefile already has an index file and, if yes, create a new spatial index. But this way, the whole index needs to be recreated, so I wanted to ask here on the list if you know about any more efficient and / or more elegant way to solve this problem.


Thanks for your help,
Marco
_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev


Best regards,
--
Chaitanya kumar CH.

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

AW: Shapefile spatial index and updates

Hugentobler  Marco
Hi Chaitanya

Thanks for this information. So I'm going to commit the workaround to QGIS for now and remove it later once your work is finished (and the corresponding OGR version found it's way into most standard distros).

Regards,
Marco

-----Urspr√ľngliche Nachricht-----
Von: Chaitanya kumar CH [mailto:[hidden email]]
Gesendet: Fr 31.07.2009 14:47
An: Hugentobler  Marco
Cc: [hidden email]
Betreff: Re: [gdal-dev] Shapefile spatial index and updates
 
Marco,

I have been working on this. http://trac.osgeo.org/gdal/ticket/2798

On Fri, Jul 31, 2009 at 6:12 PM, Hugentobler Marco <
[hidden email]> wrote:

> Hi gdal/ogr devs
>
> In QGIS, there is a bug where updates to shapefiles are not displayed until
> the spatial index of a shapefile is recreated (
> http://trac.osgeo.org/qgis/ticket/1572).
>
> It seems to me that OGR does not update the index automatically when
> calling e.g. OGR_L_CreateFeature and then OGR_L_SyncToDisk.
>
> What I did is to check (in the ogr provider of qgis) if the shapefile
> already has an index file and, if yes, create a new spatial index. But this
> way, the whole index needs to be recreated, so I wanted to ask here on the
> list if you know about any more efficient and / or more elegant way to solve
> this problem.
>
>
> Thanks for your help,
> Marco
> _______________________________________________
> gdal-dev mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


Best regards,
--
Chaitanya kumar CH.

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev