[gdal-dev] Slow performance observed while querying the shapefile
Jukka Rahkonen
jukka.rahkonen at mmmtike.fi
Tue Sep 4 23:23:58 PDT 2012
kedardeshpande87 <kedardeshpande87 <at> gmail.com> writes:
>
> Hi,
>
> I have downloaded the latest shapefiles from US Census Bureau TIGER
> Shapefiles containaing the ZipCode Tabulation Area (2010) information. I am
> reading the shapefile to retrieve the zip code for a given point having
> latitude/longitude. I open the shapefile to get the data source, get the
> zipcode layer from that and the set a spatial filter on it.
> But currently, I am getting very slow performance when doing this. It takes
> on an average 200 milliseconds to find a zip code for a given point.
> I had downloaded the ZCTA 2010 shapefile a few months ago and I was getting
> the latency of around 1 to 2 milliseconds on an average. I recently
> downloaded the same ZCTA 2010 shapefile from US Census Bureau web site and
> now I am getting latency of 200 milliseconds. The code that reads the
> shapefiles is the same.
>
> Has anyone else observed similar behavior ?
> What could be the cause of such a high latency ?
Perhaps there is something wrong with the spatial index. Drop and re-create the
index as described in http://www.gdal.org/ogr/drv_shapefile.html and check if
queries get faster.
-Jukka Rahkonen-
More information about the gdal-dev
mailing list