Hot answers tagged

3

Basically you just need a PHP script that acts as a middle man and does the fetching for you, then returns what it gets directly to the client. I converted your JS snippet above into the relevant parts below. Notice that the url in your Leaflet tileLayer example has been changed to a PHP endpoint with URL parameters: ?s={s}&z={z}&x={x}&y={y} ...


2

I did port the Python code to php: <?php function parseFloat($ptString) { if (strlen($ptString) == 0) { return false; } $pString = str_replace(" ", "", $ptString); if (substr_count($pString, ",") > 1) $pString = str_replace(",", "", $pString); if ...


1

ST_GeomFromText takes a WKT parameter, which is a text string of WKT. However, you can't use database parameters to format text within an SQL statement. (You would need to use PHP's text formatting utilities, like sprintf, but I don't think this is a good approach). A better way is to use PostGIS geometry constructors that take numeric parameters, e.g. ...



Only top voted, non community-wiki answers of a minimum length are eligible