views:

55

answers:

1

Hi!

I have the all the shapefiles (shp, dbf, ...) for my country's counties. I have a list of points (latitude/longitude) and need to reference each point with corresponding county.

I have looked into these tools and libraries. They can read, write and edit SHP files, but don't seem to be able to search stuff on them. I have converted the DBF file into MySQL (using this) but this data is just meta-data, not the actual polygons.

Do we need to convert SHP geometry units to lat/lng? Is there any tool/lib/package to do it? Rather new to geo-stuff. ;)

thanks! cheers

A: 

The shape file defines some vectorized two dimensional area(s). Once you have the file loaded, the problem is one of simple geometry. You will need to use some generic geometry library (or custom code) to determine whether a particular point falls within the defined shapes.

Sparr
yes, thanks. But how do I convert from lat/lng to 2D shape units? How do I know the x/y from a lat/lng, in a given shapefile?
sopppas
for reasonably small areas, lat/lng ARE x/y. only two caveats are spherical distortion for really large areas (or areas very close to the poles), or the +180/-180 longitude line.
Sparr