Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
14 views

Submit form in leaflet popup makes blank page

I have a problem with a leaflet popup. I made a form in it and when I try to send form with jquery & AJAX to postgis, data inserts correctly but blank page loads. How to update popup with response ...
1
vote
2answers
42 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
23 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
20 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
47 views

How to save marker and polyline in database?

I want to store marker and polyline in the database. In this script, I have 3 functions, that is to draw a polyline, marker and the point of destination. Can anyone fix my script below? var map; var ...
0
votes
0answers
16 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
22 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
25 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 ...
0
votes
0answers
70 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
57 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
32 views

How do I load geojson using php into postgres

Translated I am new to coding and for one of my classes I have to make a map with markers. I have a database but I can not make it a geojson code to be able to display this data on my map. When I ...
0
votes
0answers
41 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 ...
3
votes
1answer
109 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
38 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
24 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
35 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
266 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 ...
3
votes
1answer
307 views

How to compile/install php-mapscript with PHP7

So, this PR opens up mapscript support for PHP7. Since there is no ducomentation I gave it a try based on How compile/install php-mapscript on Ubuntu 16.04 (although I'm doing it in Debian 9 if that's ...
0
votes
0answers
81 views

Create a valid shapefile with phpmyadmin/Shapefile lib

I'm trying to create a shapefile with the PhpMyAdmin\ShapeFile library. I followed the example in the Github project repository, but I would like to create a shapefile within polygon elements, not ...
1
vote
1answer
231 views

Editing PostGIS layer in Lizmap?

I've got a freshly Lizmap 3.2 installation. I can display PG-Layers but I cannot edit them. My setting is: Ubuntu Server 18.04.1 PostgreSQL 10.6 Apache2 Lizmap 3.2 PHP 7.2 I followed this ...
-1
votes
1answer
51 views

Get some sample coordinates inside an area using its KML file [closed]

I have a KML file which defines an area. I want to get coordinates of some points inside that area using my KML file. I googled a lot, but I only found codes to check if a point is inside. My issue ...
0
votes
1answer
388 views

Automatically refresh Leaflet Markers from MySQL

I have a leaflet map that loads marker details from a MySQL database. I have a timer that clears and reloads the layers (and therefore markers); however; it doesn't seem to be refreshing the data. ...
1
vote
0answers
29 views

Which polygons intersect rectangle in PHP/Linux GDAL?

I'm developing a website where I want to test which polygons from a shapefile intersect a given rectangle. Using PHP, I thought about using exec() function, calling a GDAL program, like ogrinfo. ...
0
votes
1answer
159 views

Uploading shapefile to PostGIS database using PHP

I want to insert a shapefile into a PostGIS database using PHP. I go through the examples and I tried the following: $command = 'shp2pgsql -s 2100 -d /D:\CHECK DATA-group\2016\Ayomi\JULY\...
1
vote
1answer
856 views

Multiple markers on Google Maps using JavaScript, PHP and SQL

I am trying to query the MySQL database that has a table with firstname, longitude, latitude in it. I want to get the longitude and latitude and display them as multiple markers with the firstname as ...
1
vote
0answers
365 views

Google Maps API - Multiple Polygons

I'll be generating my JSON file using PHP and SQL for displaying around 200 polygons, on a map. I've managed to test the concept with two polygons but still struggling. I'm not experienced with JS or ...
0
votes
1answer
147 views

Spatial functions with MySQL, XAMPP, and Wordpress

I am trying to figure out how to using the ST_AsGeoJSON function in MySQL, but I keep getting an error that says that this function does not exist. I have found in the MySQL documentation that this ...
1
vote
0answers
172 views

openlayers-automatically adding the layers on clicking dynamic checkboxes without actually specifying all the published layers attributes

My tryonly.php looks like following I also have categories.php to add layers with a common category or create a new in the database There is no error in the code below, where i have been using ...
0
votes
1answer
276 views

Creating point with geometry to insert in database

I have a PostGIS table of points. With my php code and pdo, I want to add a point in it. I have the coordinates, I want to get the geometry, with ST_GeomFromText. Here is the code : $x = $_POST['x']; ...
1
vote
0answers
72 views

Which approach is faster for getting all POIs from MySQL/MariaDB with PHP/Laravel [closed]

Correct me if I'm wrong. There are three approaches to get the nearest homes, users have created in my website: To create a table with two columns(latitude, longitude) that both of them are float ...
0
votes
0answers
212 views

php_pdo_pgsql.dll not in php.ini file

I am trying to link a Postgis database to a leaflet map using PHP but all the tutorials say I have to uncomment: ;extension=php_pdo_pgsql.dll in the php.ini file. However this line is nowhere ...
1
vote
0answers
125 views

Unable to upload shapefile using geoserver REST API and php

I am not able to upload shapefile and create a store in Geoserver using its rest api and Php. below is my php code <?php // Open log file $logfh = fopen("GeoserverPHP.log", 'w') or die("can't ...
0
votes
1answer
140 views

TurfJS + PHP + MySQL

I have a PHP endpoint/service that receives Lat/Long data from a 3rd party. The data is then processed in PHP code and saved into a MySQL database. This process works fine without any issues. I need ...
1
vote
0answers
675 views

Response not working in AJAX/PHP

I am working on Google Maps API, where I have made a dynamic marker popup. Now I want to take the user information from the popup and save it to my MySQL database without reloading the page. So I am ...
-1
votes
1answer
482 views

Add coordinates after click into form

I would like to add the coordinates as a click to the map as a form entry, I do not know how the function structure should look like map.on('click', function(e) { var lat = e.latlng.lat; }); <...
1
vote
0answers
736 views

Parsing GeoJSON in PHP?

i am trying to parse GeoJson from database with php but somehow i got an error and i cannot found any error in my script. here my script $id = 1; $db = new mysqli("localhost","root","","skriboo"); $...
3
votes
1answer
376 views

Find if lat/long point is inside an area

I have got data using OpenStreetMaps Ways of many areas. I would now like to write a function which would return "true or false" if an single latitude/longitude point is found in that area or not. I ...
0
votes
1answer
336 views

The geometry_type of a spatial column cannot be changed (Requested changing type from “MULTIPOLYGON” to “GEOMETRY” for column “geom” in table X)

Using Symfony 2.8.24, Doctrine 2 and Jsor's doctrine-postgis library, the latter to make Doctrine get along with spatial types like geometry, geography, etc. So, I have a table with a column of type ...
2
votes
1answer
183 views

Open a Spatialite database in PHP

I need to open a Spatialite database by using php in a php's framework. I've already work on a basic php file to test how it work but it gave me some errors. I've already try to load extension by ...
1
vote
1answer
3k views

Adding markers using OpenLayers 4

adding markers works fine using OpenLayers 2 but now I need to add markers using OpenLayers 4, how can I do this? my code as follows: var markers = <?php echo json_encode($data)?>; var ...
0
votes
1answer
243 views

Zoom to centroid of polygon from form-input in Leaflet

I want to write the name of the polygon in a form and then click a button to zoom or to flyto to the centroid of the polygon. I've writen a request in PHP that give the centroid of the polygon. ...
-1
votes
1answer
233 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
167 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
264 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
415 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
146 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
608 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) ...
4
votes
0answers
105 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
148 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
843 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 ...