I try to do Reverse Geocode from my shapefile on the database.
I'd already try with Spatialite and PostGIS to put shapefile (.shp) into it. But I'm still can't delivered my objection about reverse geocode from my shapefile on the database.
My shapefile (.shp) is content with district polygon, all I want is simple: Pass some coordinate, and check that coordinate is in what district polygon from shapefile, then return the district name. That's all.
Does anybody know the SQL Query to do that reverse geocode in PostGIS or Spatialite?
Thanks before. 🙁
Best Answer
Suppose your district table looks like this
Then you would select the district a point falls into using
Replace lon and lat with your values.
If your districts are in a different projection than WGS84, use ST_Transform.