[Gdal-dev] How determine if lat\lon point falls within a shapefile

Tom Kazimiers 2voodoo at gmx.de
Sat Feb 23 11:45:36 EST 2008


Jim St.Cyr schrieb:
> I have a shapefile and a list of lat\long's that I would like to process in
> order to determine if they fall within the shapefile.  GDAL-1.5-py2.5 is
> loaded on a windows XP machine and is correctly configured.  I would
> appreciate it if someone could point me to a python script or appropriate
> documentation to get me strted.  At this point I can't even determine which
> part of the GDAL package to use....
>
> Thanks much.
>
> Jim
>   
Is the data of the shapefile also referenced with lat\long values of the 
same geographic coordinate system or do you need to translate them?
I think you could open the shapefile, get the bounding box stored in the 
file (maybe you have to go through all the shapes as the stored bounding 
box in the file must not be correct - at least I do this when loading 
shapefiles) and then compare it to your value.

bye,
Tom


More information about the gdal-dev mailing list