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
vote
0answers
12 views

GeoJSON cluster, group points with the same id

I want to make a cluster with a GeoJSON, to obtain the file I query a table in PostgreSQL and I save the file. The same point can have several associated images, but according to the GeoJSON, it makes ...
2
votes
1answer
80 views

How to calculate Night Flight time for a given flight between 2 locations?

I am currently working on a project (web app) at university to be able to calculate the amount of time spent during night flying. Currently, I have, Departure Lat and Long and Departure Time in UTC ...
0
votes
0answers
27 views

OGR2OGR: Failed to reproject feature

So I have the following command line that runs in my php code First: I rename the layer_name with the id of the user who uploads his shp file, and save it with the kml extension ogr2ogr -f KML ...
0
votes
0answers
15 views

Plot something on lat long in PHP

Is there some sort of plotting system which lets you do this? (in PHP): ex. plot(lat,long,data_show_onhover) My CSV file that I want to plot on the map looks like this: something,something,something,...
0
votes
0answers
77 views

Installing QGIS Server on existing Apache/PHP on Windows 10

Using OSGeo4W installer, I installed QGIS server while having already Apache/PHP on my computer. And I got this message: The requested URL was not found on this server when I tested the QGIS Server ...
1
vote
0answers
10 views

Binding Popup from database to a marker

I am trying to add popup to markers from database. Markers are showing unable to add title to popup. function add_markers(coordinates) { var geojson = (saved_markers == ...
1
vote
1answer
69 views

SELECT * will not work with table containing geodata

The following will not run... I get ORA-00932 error every time.. $sql = 'SELECT * FROM app.table_1'; however, this will work (specifying a column name, i.e. objectid): $sql = 'SELECT objectid FROM ...
1
vote
0answers
48 views

Ogr2ogr: how to add values ​to a database column

So I have my table named ppb_curp with the following columns ogc_fid | name | description | wkb_geometry |curp | zip_code Then I insert the KML file in my PostGis base with ogr2ogr ogr2ogr -f ...
0
votes
0answers
13 views

Checking location in which polygon

I have KML file for country polygon. I can read the KML file in PHP and see all boundaries. What I want now is when I put a marker on point showing me the title of the polygon. Does anyone have any ...
1
vote
1answer
30 views

ogr2ogr error loading kml file in postgis with php

So I have a kml file that I want to save to my postgis database, Currently I have the following code using php: $file = $request->file("item"); $name = time(); ...
1
vote
0answers
18 views

Loading google maps API from php file [closed]

I've been trying to load some GeoJSON data into a map, using Google Maps API. When I save my file as .html the map shows up just fine, and it shows the data I want to see (a Linestring). I'm using ...
1
vote
1answer
43 views

Open QGIS project using PHP command

We are using a intranet geoloket (html). I would like to share some QGIS projects using PHP. This is the code I start with: header("Content-disposition: attachment; filename=MapInQgis.qgz");&...
0
votes
1answer
66 views

Getting meters from pgr_dijkstra

I imported http://download.geofabrik.de/europe/germany/baden-wuerttemberg.html into my PostgreSQL database which supports PostGIS. Now I wrote a PHP script which gets two points (lon, lat, which are ...
2
votes
1answer
113 views

Updating PostgreSQL database with PHP language

I want to update the text information contained in my database for a specific layer. This layer is called via a WFS stream. At first I displayed my layer with an Overlay with OpenLayers, and with a ...
1
vote
1answer
2k views

PHP: Call to undefined function pg_connect() with MS4W for PostgreSQL

I am trying to add dynamic interactions with my PostgreSQL 12 database to my web page with the PostGIS extension that I use with PgAdmin 4. I use an Apache web server that I installed with MS4W. For ...
0
votes
0answers
31 views

How to add key value on JSON to send PHP?

I created a table to loop every coordinate I click from my map. var gps = new Array(20);//créer un tableau de 2d array for (var i = 0; i < gps.length; i++) { gps[i] = new Array(2); ...
1
vote
0answers
36 views

how to put the data on the map from database

I wanted to display a polygon with the coordinated on my map and each time i click the button. This is my database: I get the data from the database with php $sql = "SELECT * FROM ...
0
votes
0answers
11 views

Convert and store map layers

I have a lot of square PNG with layers which correspond to bbox. and I'm interested how I can convert them and save. My think is to convert all dots and lines to something like this [dot{id:2,lat:111,...
1
vote
1answer
483 views

How to display the GeoJSON from PHP on the map?

I am using MapboxGLJS. I retrieve the coordinates from my database and I put it in GeoJSON format on PHP which look like this: <?php $sql = "SELECT * FROM waypoint"; $...
0
votes
0answers
27 views

Looping jsongeo array

I have the following code: $i=0; $sql=mysql_query("SELECT * from table"); $tot = mysql_num_rows($sql); $feature = array( 'type' => 'FeatureCollection', 'features' =...
0
votes
0answers
30 views

Reading GeoJSON from external file in Leaflet [duplicate]

I found the following script on the web but I don't know how to change the way to read JSON code. In the script the JSON code is included in a var called sitec but I need to read that code from an ...
1
vote
2answers
130 views

Loading points from an array given by PHP query from MySQL db to OL

New to OpenLayers and JS in general. I have some coords stored as lat long, then PHP script which load these points from MySQL db and simply print it as follows: var points = [[49.66356869941062, 16....
1
vote
0answers
40 views

CARTO update existing table from external MySQL database

I would like my Carto data to be updated, using external data (MySQL database, I run and manage locally using PHP scripts), so that the Carto table gets updated with the most recent data, whenever the ...
0
votes
0answers
53 views

Using PHP on Webservers and PostgreSQL

I'm creating a general webapp that is displaying data from a Postgres database hosted on Digital Ocean. My problem is that I can't get the PHP script to run on my webserver(hosted by Hostgator) to ...
0
votes
1answer
196 views

Use PHP form to insert geometry from WKT into SQL Server 2017

I have a PHP 7.3 form that asks the user for a Name, a WKT and an SRID. I would like to upload the WKT and SRID to SQL Server 2017 so that it creates a geometric object in Upload_WKT_Test using ...
1
vote
1answer
233 views

Openlayers: Using PHP and npm

I've got a rather large MySQL database containing polygons (coordinates) and their additional properties (e. g. text labels in different languages). I would like to use PHP to connect to my database ...
1
vote
1answer
144 views

On change filter Leaflet

I want to make dynamic filter on Leaflet, but I got a little problem. so first this my dropdown: <select id="selc"> <option value="baik">baik</option> <option value="sedang">...
1
vote
0answers
29 views

Count points that are within certain radius within a polygon

I have 4 table, I want to count police that are within 5km of a point (dam), schools and clinics within 3km same dam. So far I do get the results if I'm focusing on one table $str = pg_query($conn, "...
1
vote
0answers
119 views

Problem with loading big data (GeoJSON) via PHP

I have a problem with loading (big) data via PHP from a spatial database. I let run this project on a localhost Apache Server. From a data count of about 30.000 edges I get an error VM885:1 Uncaught ...
1
vote
0answers
51 views

Display all trajectories location along with dummy location

I'm trying to display the all trajectory location on Google map along with dummy location. I have tried to display dummy locations with sample location and it works fine, but when I try to connect to ...
1
vote
1answer
231 views

Leaflet Foreach point in GeoJSON check Distanceto

So I was wondering how I can get the points from the GeoJSON located here. and then for each of them separately check if the distance of Markers is within 5 meters range of these. I have tried but ...
0
votes
0answers
58 views

ArcGIS map with basemap toggle and simplemarker pointer

I am using ArcGIS map which gives me an error: Below is my function which i am using to implementing the map on my application: function handlerForVariableB (latt, longt, complaintid) { // ...
2
votes
1answer
527 views

Show points (layer) from PostgreSQL database on OpenLayers map

I have this code, I want to load a collection of points stored in a table in PostgreSQL database, I retreive the GeoJSON format succesfully, but the points never show up on the map! The three files ...
0
votes
0answers
72 views

How to setup my Tileserver-php

I have downloaded "xampp-windows-x64-7.3.6-3-VC15-installer.exe" and installed only Apache and PHP. My Apache server is running. I have download "tileserver-php-master" and paste the folder in path ...
1
vote
1answer
431 views

ArcGIS Feature layer data update using API in PHP

I'm facing an issue with update data on the ArcGIS feature layer using API in PHP. Data is updating on the feature layer as expected, But data on the map is not representing. Every time when I'm ...
0
votes
0answers
136 views

Generating random locations nearby my location in PHP and MySQL

I'm using a method to generate a random locations around my location with given the initial position(lat,long) and radius this method is used From the reference post here, but unfortunately the ...
1
vote
2answers
189 views

MySQL, geoPHP, select sites near the current site

I'm working with archaeological sites, stored as polygons in a MariaDB 10.3 table, and I have PHP 7.2 with GEOS and geoPHP available. I'm creating a page that displays all the related information for ...
0
votes
0answers
109 views

Creating GeoServer layers from GeoJSON generated by PHP script

I have few layers on my map rendered with ol.format.GeoJSON. I generated GeoJSON from pgsql database with PHP scripts. The size of layers ranges from 1MB to 5MB so to speed up the process I want to ...
0
votes
1answer
82 views

phpmapscript on Debian Stretch

I installed MapServer 7 and I need phpmapscript. Is there any binary package for phpmapscript for Debian Stretch? I could install PHP 5.6 from binaries (https://stackoverflow.com/questions/46378017/...
0
votes
0answers
371 views

Query and display MySQL DB data from HTML

I want to link MySQL DB to the HTML and get the data according to the query below. SELECT * FROM feature1 WHERE place = 'feature2' php seems one of the way to do this, since I am one day old with ...
0
votes
0answers
37 views

Remove tolerance in PostGIS requests

I just read the problems similar to mine on this forum, but no solution helped me. To put it simply, I use ST_Touches in an algo in PHP that allows me to test if two points touch. Here is the query: ...
2
votes
1answer
86 views

Get values from shapeObj MapScript

I'm using Mapserver 7.4.0-dev and MapScript PHP. In previous versions of MapServer and MapScript (https://mapserver.org/mapscript/php/index-5.6.html#shapeobj), I could query a shapeObj after its ...
1
vote
0answers
449 views

GeoServer returns 401 unauthorized when requesting data via openlayers

When using the line crossOrigin: 'anonymous',, it returns 401 unauthorized response. When commenting out that line it works, but I have to be log in to the GeoServer. Update: I have changed the ...
0
votes
0answers
175 views

Converting NZTM2000 projection to Lat-Long system using PHP

Is there a way to convert coordinates from New Zealand Transverse Mercator to Google compatible longitude and latitude using PHP? I have tried PHP-COORD library, but it does not have the NZTM option.
0
votes
0answers
50 views

Sending parameters to ArcGIS script through web interface

I have written a simple script in ArcGIS environment and I want to run the script through a PHP program. At present, I am trying this within localhost. In my script, I have defined two parameters. My ...
4
votes
1answer
692 views

Add Line Layer from PostGIS to Leaflet

I have a line layer in PostGIS that I would like to add to a Leaflet map. I have the PHP setup, but I can't seem to get the Javascript correct. I know my issue is converting the line to geoJSON. The ...
0
votes
0answers
47 views

Leaflet var to php

I have a function when I click on the marker: function onMarkerClick (e) {          id1 = "something";          $ .post ("content.php", {id_a: id1}, function (result) {              alert (result);   ...
0
votes
1answer
42 views

Why is this happening? I show GeoJSON some coordinates with OpenLayers by request Ajax

I want to display a GeoJSON on OpenLayers with a request from Ajax from the database: I store in the geojson variable all the information and I icercated in two ways: 1. Directly from the already ...
0
votes
1answer
115 views

PHP MapScript - Query GDB Geodatabase?

I'm trying to use/learn some PHP MapScript on a GDB file and cannot get anything from it. The PHP below works great if I use countries.sqllite (via countries.map) file I have and shows me an array of ...
0
votes
0answers
1k views

How to convert geometry in the GeoJSON from PHP and insert polygon in PostGIS

I'm a beginner in PostGIS and GeoJSON. I need to extract every geometry from GeoJSON and store them in the PostGIS database as polygons. For each entry in GeoJSON I would like to be able to store ...

1
2 3 4 5
7