Hot answers tagged php
a simple algorithm would consist in checking that you are on the "good" side of the lines that build your polygon. For instance, the long of your point has to be larger than the long of the West side and smaller than the long of your East side at the lat of your point. e.g. Long_point > Long_LowerLeft + Lat_point * ( Long_UpperLeft - Long_LowerLeft)/ ...
PHP knows nothing about the SQL query sent to PostGIS. Therefore, it doesn't matter if you have nested queries or not. But it is very important for PostGIS, in order to perform the query, to receive a valid query, like you did when you have used PgAdmin. So, I think you need to revise your php $sql variable, like this: $sql = "SELECT name, ...
GDAL using a .vrt file could also be a solution. You vrt would look like: <OGRVRTDataSource> <OGRVRTLayer name="feature_name"> <SrcDataSource>your_csv.csv</SrcDataSource> <GeometryType>wkbPoint</GeometryType> <LayerSRS>EPSG:27700</LayerSRS> <GeometryField encoding="PointFromColumns" ...
Only top voted, non community-wiki answers of a minimum length are eligible