Skip to main content

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
0 votes
1 answer
36 views

Php or javascript libraries for GIS calculations

I am presently doing all my computing in QGIS. Once all complete I export my point, line and polygon data in geojson for ultimate use with MapBox and Leaflet. I would like to automate my calculation ...
spreaderman's user avatar
3 votes
1 answer
54 views

Aligning vehicle route with expected route in GIS with GPS variability

I have a PHP project where I am working with two polylines: one representing the expected route on streets and another representing the actual route taken by a vehicle. The expected route remains ...
Gustavo Botti's user avatar
0 votes
0 answers
62 views

How to set up Tileserver-PHP for OSM data with custom style

I downloaded the files from https://github.com/maptiler/tileserver-php and took them to my Ubuntu server (22.04 LTS) with Apache webserver into "tileserver" folder. After this i downloaded ...
BHadh's user avatar
  • 71
0 votes
0 answers
32 views

How to get SRID from .prj file in PHP using OGR2OGR in PHP

I'm writing a PHP script that uses the OGR2OGR command to open a .prj file and get its SRID. I'm using the following code: $prjPath=Storage::path(filename); $output = shell_exec("ogrinfo -al -so $...
Maryam Atabati's user avatar
0 votes
0 answers
56 views

Getting started with NOAA conus_bref_qcd calls

I'm trying to take advantage of the NOAA radar APIs to create a JPG/PNG image of the radar situation centered around a certain lat/lng coordinate. I've tried looking at the documentation here for the ...
Nate Baxley's user avatar
0 votes
0 answers
48 views

Openlayer map disappears after returning a PHP request through events

I generated an OpenLayers map using the 'QGIS2WEB' plugin in QGIS. I am working on a program that, depending on the coordinates where the user clicks, will send them to a PHP controller. The ...
Arnold Valente's user avatar
0 votes
1 answer
225 views

Converting EPSG:3346 to WGS84

I am trying to work with some coordinates which are in EPSG:3346 format. Now my understanding is that if I want to do something with these coordinates in Google Maps API, the format i need is WGS84 (...
galdikas's user avatar
  • 101
1 vote
1 answer
796 views

PHP library to get center of the polygon center

I have the folloging example GeoJSON data stored in a PostgreSQL PostGIS database: {"geoJSON":{"type":"Feature","properties":[],"geometry":{"type&...
Taras's user avatar
  • 123
1 vote
0 answers
101 views

Save WMS layer directly on the server every day

I use PHP, PostGRES and GeoServer with OpenLayers and I have a WMS layer that is loaded from an external URL in GeoServer. I would like to be able to somehow save the layer received from the external ...
CoderCoder42's user avatar
0 votes
0 answers
64 views

convert exif of a photo to a lower version?

I am using wordpress, and I found that the exif_read_data() PHP function cannot read the GPS info in exif from Images with Exif Version 2.32 , but it can read from Exif Version 2.20. Is there any ...
Maxwell Cheng's user avatar
0 votes
0 answers
151 views

Call current position in onEachFeature leaflet

How can I call my current location inside onEachFeature in Leaflet. It's working outside but I just want to call it inside L.Controler.Layers. var cauayan = L.geoJSON(cauayan, { onEachFeature: ...
Michael De Leon's user avatar
0 votes
0 answers
148 views

Create a PostGIS table through HTML, PHP and the GeoServer REST API through a specific script

I need to create a HTML page that allows for creating a new PostGIS table in a specific database, through the GeoServer API. So I'm specifically interested in the Creating a PostGIS table part of this ...
Vincent Dc's user avatar
0 votes
1 answer
297 views

Recovery GPS information with exif_read_data (php)

I am struggling to understand the EXIF feedback produced by my camera. Indeed in the Latitude and Longitude fields I receive a figure in this form: Latitude: 4294967295/341858021 Longitude: 4294967295/...
Alain's user avatar
  • 1
1 vote
1 answer
275 views

Access forbidden during the installation of the Lizmap server on Windows

How can I successfully install Lizmap? I have exhausted all the means of research without success. In fact, for more than a week I have tried to install lizmap on Windows. At the step of the Apache ...
yvemalongo's user avatar
1 vote
0 answers
171 views

Is it possible to "copy" one layer from WMS and create another WMS only with this layer automatically?

I'm using Lizmap and QGIS to create WMS service with multiple layers. Now I need to find a way to create WMS containing only one layer that the 'main' WMS contains. Is there any way to do it without ...
miszczep's user avatar
1 vote
0 answers
282 views

How to calculate the daylight saving time given a latitude and longitude [closed]

I've been using an algorithm (https://gist.github.com/assaflavi/fc8cf83c167558ebf3ab159b5c5b0df2) to calculate sunrise and sunset times given a latitude and longitude and it works fine but this ...
PotatuesFri's user avatar
3 votes
2 answers
355 views

"Unsupported GeoJSON type" from AJAX request to PostGIS database

I'm trying to use a GeoJSON to build a layer on an OpenLayers map of MultiPolygons from my PostGIS database. However the following error is thrown: Uncaught Error: Unsupported GeoJSON type: undefined ...
DandozWar's user avatar
0 votes
1 answer
214 views

GeoServer StoreDefinition - "Markup im Dokument nach dem Root-Element muss ordnungsgemäß formatiert sein."

I try to set up a GeoServer WFS-rerouting using a local PHP script that creates the GetCapabilities-document which should then be interpreted by the GeoServer. I get the following error: (german) &...
Felix's user avatar
  • 165
1 vote
1 answer
246 views

How to format PostgeSQL query results in PHP to return GeoJSON object?

I'm building a small map application with Leaflet and PostGIS. I'm having an issue similar to this post where using pg_fetch_all is returning the data I want, but buried in an associative array. When ...
nizz0k's user avatar
  • 324
1 vote
1 answer
137 views

Location Based KNN script on Leaflet works for Chrome but other browsers and mobiles cause parse error - invalid geometry

As many of you know I have been producing a Leaflet map with a KNN function to show the closest pubs to a user's location. Live example to test for yourself: https://ces-web2.southwales.ac.uk/students/...
WMTS's user avatar
  • 101
1 vote
2 answers
3k views

How to output GeoJSON file from MySQL database shapefile?

I have a MySQL spatial database ('mydb') of one table ('tst'), I mean by spatial. I need to output the GeoJSON file from this spatial MySQL table. I downloaded geoPHP library and also MySQL to GeoJSON ...
Kawtar's user avatar
  • 29
0 votes
0 answers
152 views

Getting a GeoServer created style to Leaflet markers via PHP

How can I use a point/marker style created on GeoServer within my Leaflet map when I am drawing data from the server using PHP. I am currently PHP to draw geodata from my GIS server, however I would ...
WMTS's user avatar
  • 101
-1 votes
1 answer
1k views

GeoJSON custom marker for different data sources

I need help how to show markers with two different colors for two different GeoJSON data sources. Here's first source geojson.php: { "type": "FeatureCollection", "...
faisal's user avatar
  • 3
0 votes
2 answers
701 views

Dynamically load data from a GeoJSON

I ask a new question about the problem I have, because I tried it but I don't know how to solve it. (I'm learning OpenLayers, and I see that it isn't that easy). Using a html select, I run a PHP query ...
user68481's user avatar
1 vote
1 answer
2k views

Unsupported GeoJSON type

I run a query and I get a GeoJSON file, but when I try to load the file into the map, I get the error that it's an Unsuported GeoJSON type. this is the PHP file that generate GeoJSON : $element = $...
user68481's user avatar
0 votes
1 answer
2k views

Saving data of Leaflet Draw using PHP into MySQL

How do I insert Leaflet Draw coordinates in the MySQL database with id longitude-latitude columns? <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&...
martin's user avatar
  • 1
1 vote
1 answer
902 views

Call marker color in Geojson to apply to leaflet.js in php

I have a geojson file which has marker-color properties in it. In this case I want to call the marker color contained in the GeoJSON file, to change the marker color. how to do this? GeoJSON data: ...
olif's user avatar
  • 15
1 vote
0 answers
185 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 ...
user68481's user avatar
3 votes
2 answers
608 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 ...
pilotman's user avatar
  • 133
0 votes
0 answers
118 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,...
mayank1234r56's user avatar
0 votes
0 answers
688 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 ...
Hubert Djéteinboua's user avatar
1 vote
0 answers
171 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 == ...
Maina David's user avatar
1 vote
1 answer
292 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 ...
Lieutenant Dan's user avatar
1 vote
0 answers
612 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 ...
Eze's user avatar
  • 93
2 votes
1 answer
280 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(); $name = $name . '.' . $...
Eze's user avatar
  • 93
1 vote
0 answers
576 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 ...
Andibadia's user avatar
1 vote
1 answer
504 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");&...
GIS Adviseur VI's user avatar
0 votes
1 answer
402 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 ...
Lars's user avatar
  • 31
2 votes
1 answer
570 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 ...
Teyhryu's user avatar
  • 55
1 vote
1 answer
16k 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 ...
Teyhryu's user avatar
  • 55
1 vote
0 answers
357 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 ...
Thulaksan Jayapal's user avatar
1 vote
1 answer
7k 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"; $...
Thulaksan Jayapal's user avatar
0 votes
0 answers
71 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 ...
Mdev2023it's user avatar
2 votes
2 answers
999 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....
pomdoe's user avatar
  • 21
1 vote
0 answers
57 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 ...
Clara's user avatar
  • 11
0 votes
0 answers
175 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 ...
AdamGIS's user avatar
  • 31
0 votes
1 answer
906 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 ...
Rayner's user avatar
  • 3,721
1 vote
1 answer
1k 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 ...
Moehrengulasch's user avatar
1 vote
1 answer
1k 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">...
AdityaDees's user avatar
1 vote
0 answers
79 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, "...
Asanda Lamba's user avatar

1
2 3 4 5
7