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
1answer
611 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
21 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, "...
4
votes
1answer
241 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 ...
1
vote
0answers
33 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
1answer
1k 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 ...
6
votes
3answers
8k views

Convert WKT to GeoJSON with Leaflet

I have a point type WKT geometry column in a MySQL table storing the location of some stores. I want to display it on a Leaflet map on my website. I've found plenty of tutorials to doing this on ...
1
vote
1answer
69 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
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 ...
0
votes
1answer
46 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/...
1
vote
0answers
22 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
3answers
719 views

Storing shapefile in PostgreSQL database as a table using PHP?

I want to create a table from a shapefile in PostgreSQL. To do that, I can run this command in cmd: shp2pgsql -s 4326 -W LATIN1 E:\Any\THA_adm public.test123 | psql -h localhost -d DATA -U postgres -...
2
votes
3answers
2k views

Load a shapefile in PostgreSQL database with PHP

I am trying to load a shapefile in a PostGIS database using the exec() command. I have read the format I have to follow from here and I checked several similar questions from the forum. Based on the ...
0
votes
2answers
1k views

Convert a shapefile to GeoJSON with PHP

Is there a method in PHP to covert a shapefile to GeoJSON? I need to upload shapefile and load it into a PostgreSQL table. I tried PHP exec(), but it didn't work.
1
vote
0answers
20k views

Getting multiple dynamic custom markers on map using MapBox in MySQL and PHP? [closed]

Can anyone help me to get multiple custom markers on mapbox using lat/long from the database MySQL? I want to use 2 types of markers on the map, for which I have two separate table of lat/longs in ...
0
votes
1answer
235 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\...
3
votes
1answer
486 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 ...
2
votes
1answer
90 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
23 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) { // ...
1
vote
1answer
4k 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 ...
1
vote
1answer
129 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
30 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 ...
0
votes
0answers
50 views

MySQL Query for Getting Records within Radius

Coordinates in the table are stored in 3 separate columns x, y and zone and are formatted in UTM. Here is the idea: I get the current position of the user (in lat long but I can convert it to UTM if ...
0
votes
0answers
35 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 ...
0
votes
0answers
40 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
1k views

PHP MapScript get feature / shape by index in layer

I upgraded my MapServer version from 5.6.x to 6.2.0 (yes, big version jump here!) and I am stuck with getting a shapeObj from a layer by simply using its Index (or FID for shapefiles or GID in case of ...
1
vote
2answers
75 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
48 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 ...
1
vote
0answers
173 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
200 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 ...
2
votes
1answer
36 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
83 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
27 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: ...
0
votes
0answers
107 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
35 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 ...
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"...
0
votes
2answers
158 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
0answers
43 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
546 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
45 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
59 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
1answer
32 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
0answers
486 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
vote
1answer
479 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 ...
0
votes
0answers
190 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
votes
1answer
84 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 ...
4
votes
2answers
5k views

Using PHP with a web application?

I have been working on creating a web mapping application using ArcServer 10 and the JavaScript API. Recently I was told that queries need to be run using PHP due to prior work by another team. The ...
0
votes
1answer
203 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 ...
0
votes
1answer
448 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 ...
3
votes
1answer
991 views

Put LeafletJS geoJSON's into a MySQL database through PHP

I'm doing a project that will let users manipulate a map through LeafletJS, creating circles and polygons on top of the map. I need to gather these inputs for later analysis, using a MySQL database ...
1
vote
0answers
43 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. ...