The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [php]

PHP is a Server-Side Scripting language designed initially for web programming, but is also used as a general-purpose programming language.

Filter by
Sorted by
Tagged with
-1
votes
1answer
266 views

OSM - Nominatim - ERROR: Scripts must be run from build directory

i'm trying to setup my own nominatim server in a CentOS 7 VirtualMachine. I'm using this guide which is followed here for data import. This line gives me trouble when trying to import data: ./utils/...
2
votes
0answers
200 views

improve the parser on a OSM Data parsing to get the nodes with child [closed]

The following is a little OSM Overpass API example with PHP SimpleXML I've compiled The first part shows how you can query an Overpass Endpoint with standard PHP. For you the second part is more ...
1
vote
1answer
330 views

Return boolean type in PostgreSQL [closed]

I am using ST_Intersects() to know whether two geometries intersect or not. This is my code: $var_name = pg_query($conn,"SELECT ST_Intersects(p1.column_name, p2.column_name) FROM table_name AS p1, ...
0
votes
0answers
522 views

MySQL GeoJSON query for polygons format error

Trying to take MySQL polygons to GeoJSON. My SQL query is Okay and works in PhpMyAdmin and I'm trying to modify some code that works for points. I think I'm close but stuck. In PhpMyAdmin the ...
1
vote
0answers
179 views

Pure PHP Library for Geometry Operations 7

I am working on a php project on a shared webhost. so I am limited into mysql and php. I want to do some geometry operations in php side. In fact it is a routing algorithm which works in php. I need a ...
3
votes
1answer
737 views

How to georeference an image dynamically

I am looking for dynamic approach how to georeference an image of a radar. This is a data that is going to be fetch every hour. Of course I will only need radar data (without base layer and borders) ...
5
votes
0answers
120 views

Position of vehicles relative to lead vehicle

I have a set of vehicles (think railway) that are in a (semi)fixed formation. I know the lead vehicle and I know the GPS coordinates of the lead vehicle at any given time. Sometimes, I can rely on the ...
0
votes
2answers
159 views

Mapbender3 error add new application

I'm a newbie to mapbender and need some help. I installed apache 2.4.27, php 7.1.10, mapbender 3.0.6.3 succesfully and connect to my DB oracle 12g works fine. I used this manual> https://doc....
0
votes
2answers
1k views

Uploading shapefile to GeoServer?

I successfully created workspace in GeoServer using cURL in PHP following the GeoServer REST Guide. But I am having problems when trying to upload Shapefile. I followed the instructions on Uploading ...
2
votes
0answers
262 views

dynamic zoom linked to a drop-down menu

I would like to get a dynamic zoom linked to a drop-down menu. For example I have a list connected to my database with all the regions and I would like that when the user choose a region that a zoom ...
1
vote
1answer
323 views

Plotting coördinates on an image in php

For a personal website I would like to plot coordinates of for example historic events etc. on an existing image. This can be a photograph of an area of which I look up the coordinates of the 4 ...
1
vote
0answers
437 views

Password protected WMS in Openlayers 4

I would like to use OpenLayers to access a Wms, which is protected by a password. Unfortunately, I find no solution to this problem. My problem is in particular that I want to prevent that password ...
0
votes
0answers
227 views

Mapbender3 Fatal Error

I'm trying to get Mapbender3 to work with Apache2.4 and PHP5.6. I have Apache and PHP talking to each other and installed correctly. I have followed the instruction to install Mapbender3 found here: ...
0
votes
1answer
2k views

How to make auto zoom when GeoJSON file is added on Leaflet map

I want it to auto zoom / zoom to center when any GeoJSON file is loaded on a Leaflet map. Help please. $.getJSON("{{asset("storage/upload/shapefiles/districts/atd_district_level.geojson")}}",function(...
1
vote
1answer
355 views

Calling Python ogr2ogr from PHP doesn't work as expected?

I have a HTML page that takes and uploaded zip file and then calls a PHP page as a form action. That PHP then calls two Python scripts in my Apache cgi-bin. The first Python script runs with no issue ...
1
vote
1answer
394 views

change PHP to generate dynamic SQL

I'm catching features from my PostGIS database with PHP, which generates dynamic sql requests. Since I can't manage to wrap my response into an ol.layer.Image I thought about using ST_UNION or ...
2
votes
0answers
560 views

Multiple tables from PostGIS to Leaflet with PHP and jQuery

I recently found this example: https://northlandia.wordpress.com/2015/04/20/connecting-postgis-to-leaflet-using-php/comment-page-1/#comment-627 It is very helpful and it works fine for one PostGIS ...
1
vote
0answers
42 views

Cannot connect to current version of enterprise database (PostgreSQL) through PHP

Very new to PHP, and working on a simple edit page. I'm connecting to multiversioned Postgresql database that I set up in ArcMap using a PHP/HTML file. I'm using the pg_connect command with host/...
0
votes
0answers
63 views

ArcPy Script returns empty error messages

I'm attempting to run an arcpy script from PHP, but it fails every time, giving me no error messages. The only message displayed is: Failed at Fri Apr 21 13:25:50 2017 (Elapsed Time: 0.00 seconds) ...
0
votes
1answer
201 views

Lizmap editor won't save edits to pgsql

So I have successfully installed Lizmap, Qgis-server, Apache, and a BigSQL postgreSQL database and published a map with a working WFS pointed at a PostGIS enabled table in my database. When I try to ...
1
vote
0answers
103 views

Rearranging a list of coordinates within a list of pair simultaneously while running a php code

The question is related to rearranging a list of coordinates within list of pair while running a php code simultaneously. I am new with php language and managed somehow to parse a kml file in php. The ...
2
votes
1answer
4k views

To enable SQLite Extension (Spatialite), in PHP launched form command line

I've this PHP code (on Ubuntu 15.10) to test Spatialite in a file named testSpatialite.php ... <html> <head> <title>Testing SpatiaLite on PHP</title> </head> <body&...
1
vote
1answer
763 views

Spatialite: 'no such function: GeomFromText' error

I've this PHP code on my Ubuntu 15.10 virtual machine <?php $lon = 4.221542; $lat = 32.21115; $db_data_sessions = new SQLite3('./DataBase/MyDB.sqlite'); # Loading SpatiaLite as an ...
2
votes
0answers
97 views

How to project coordinates in spatialite using PHP?

I'm using a spatialite database in a PHP program and I need to simulate an "identify" on a polygon layer (EPSG 32632), using point whose coordinates are dinamically generated. I know that this query ...
1
vote
0answers
143 views

Pgrouting PHP don't work with Openlayers and GeoExt

I'm working with this source code. Html file (Openlayers + GeoExt) seems to work fine - everything shows up correctly but when I click on map nothing happend. I use my OSM data loaded to postregsql by ...
1
vote
0answers
222 views

Leaflet: from postgre via PHP to geojson to website [closed]

I'm still looking for a best way to lunch pgrouting extension on my website as a rookie .Can anybody tell me is it possible? I have OSM data into postrgesql and want to do some routing machine. I want ...
2
votes
1answer
496 views

Nearest Neighbor in PostGIS [closed]

I would like to write a php script that takes a coordinate as input and finds the nearest vertex of the road_network. Is this possible with ST_ClosestPoint? Or do I need nearest neighbor method? ...
0
votes
1answer
1k views

Setting Zoom option in openlayers3?

I want to zoom to specific location while onchange of select to particulat lat and long. I have tried the code like below <!doctype html> <html lang="en"> <head> <link rel=...
1
vote
1answer
1k views

leaflet zoom map while clicking outside of the map

I know this may be a duplicate question. I'm new in this field.I am developing a website in php here I have one leaflet map for Kerala state. I'm drawing this using the goejson using leaflet. So my ...
3
votes
4answers
3k views

How compile/install php-mapscript on Ubuntu 16.04

I need to upgrade from Ubuntu 14.04 to 16.04 but php5 is not officially supported on Ubuntu 16. I install php5.5 by ondrej repo https://askubuntu.com/a/756186/483814 but when I try to install php5-...
1
vote
1answer
767 views

Adding a new Shapefile to GeoServer through REST API

I'm trying to interact with GeoServer's REST API using PHP's cURL and I'm having an issue when uploading a new Shapefile... This is my uploadShapefile method: public function uploadShapefile($zip, $...
1
vote
1answer
132 views

Performing ST_Within method in an SQL statement returns false although it shouldn't

I have a POSTGIS database with a table "space" that has two columns "id" and "geometry". I also have a PHP script that accesses the database and returns data. My program is running on mobile devices ...
1
vote
1answer
380 views

Postgis calculating distances between polypoints on big dataset

I have a table that looks like this: CREATE TABLE public.gps_data ( gpstimestamp timestamp with time zone, geom geometry(Geometry,27700), elevation double precision, accuracy double precision,...
1
vote
0answers
1k views

Can I retrieve row_to_json from PHP for a table in PostgreSQL?

I am able to retrieve JSON from a PostgreSQL database using this command: SELECT row_to_json(fc) FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features FROM (SELECT '...
1
vote
1answer
286 views

Use PHP to convert Texas State Plane to decimal

I'm trying to find a PHP function to convert a state plane coordinate to decimal. For example, NAD_1983_stateplane_texas_south_fips_4205_feet (EPSG:102741) to WGS84 (EPSG:4326)... or NAD83
2
votes
0answers
1k views

How to calculate all distance from GPS route using date time and coordinates for php?

I have big GPS data which have 4 columns for id, date time, lat, long. I wanna implement Haversine's formula to get distance between 2 nodes. But if I want to find all distance from start to last ...
1
vote
0answers
89 views

coords of the previous drawned polylines are sent to PostGIS with a form when sending coords of a new drawned polyline

I have a leaflet map in which I can draw some polylines and send their data and coordinates in a PostGIS database with Ajax and Php. When I've created a polyline and send their information in my ...
0
votes
1answer
489 views

Converting points from MySql database to WKT lines using PHP?

In MySql database I have points (pairs of latitudes and longitudes represented as doubles) like this: LATITUDE | LONGITUDE ---------|---------- 45.045664| 46.084528 26.938933| 60.903848 ..... ...
0
votes
1answer
633 views

Loading raster in postgis via raster2pgsql

I need to import data file to my database. I created a web interface in order to upload file but I have already an error Warning: pg_query(): Query failed: ERROR: rt_raster_from_wkb: wkb size (0)...
1
vote
1answer
600 views

Loop over GeoTIFF image pixels, extract coordinates and pixel color

I have a very large GeoTIFF image (~650MB) with color-coded landcover data from here. I need to extract the latitude, longitude, and pixel color for each pixel in the image, so I can import it into a ...
0
votes
2answers
635 views

Convert NAD27 to WGS84 with programming function like PHP

I am looking for a programming function that can convert NAD27 coordinates to WGS84. I know QGIS could do the conversion, but I need a function for my purposes.
0
votes
1answer
763 views

get feature id on click

In my database table there are four fields(lat,lon,sensid,value).i am displaying a vector layer(point feature) by retrieving the lat, lon values from database. Now i want to display the value, ...
0
votes
1answer
237 views

vector layer popup data from database

I have added vector layer(features) on the map. when i click on the feature , in the back end it has to take the latlon values and retrieve the data from database(using php) and display the values in ...
1
vote
2answers
766 views

inserting points in postgis with pdo (php)

I have a problem with sql insert statement using PDO (php, postgis, postgres). I have tried to use different combinations, but none of them work. Here is what I ve got: $latitude= 46.07175; $...
1
vote
0answers
159 views

Markers display with leaflet and javascript

I have a problem displaying data relating to schools on a div 'info' when click the marker with leaflet and javascript: here's the error: Uncaught TypeError: layer.setStyle is not a function
1
vote
1answer
97 views

I am using an example fracnsites to make a similar map but I don't under stand the ajax code?

I am using an example fracnsites to make a similar map but I don't under stand the ajax code? The example has js code: var map, fields = ["gid", "createdby", "featname", "feattype", "status", "acres"...
1
vote
1answer
265 views

Why can't PHP insert new geometry on PostGIS?

(Copied this question from stackoverflow, since it may have more answers here.) I'm using ogr2ogr to upload a GPX file to PostGIS. When I do it on command line (Ubuntu 14.04), it works fine. ...
2
votes
1answer
1k views

Leaflet: Map tile request, hidden key/secret via proxy

I would like to request a Leaflet tilelayer without exposing my API key and secret. For example, using the UrtheCast API (but would apply to other similar APIs that embed api_key and api_secret in the ...
0
votes
1answer
250 views

CartoDB - inserting polygons

I am new to using PostGIS and CartoDB, and I am doing some test SQL inserts into both using PHP. I've had no problem with points, but polygons are proving to be a bit tricky - my SQL insert works ...
0
votes
1answer
676 views

HTML form to load points on Google Maps using API?

I am creating a web page with a Google Map embedded in it. I want to create a form to allow a user to type which London tube zone they wish to see and, when submitted, this will map the tube stations ...