Tag Info

Hot answers tagged

5

This only a partial answer and lacks all python but too long to fit into a comment field. Your data is rather easy to convert into WKT: capture the coordinate part switch commas to spaces and spaces to commas close inside WKT polygon: POLYGON ((...)) POLYGON ((39.655756 -4.034769,39.655757 -4.034769,39.655758 -4.034769,39.655800 -4.034788,39.655885 ...


4

In line $polywrite = "<script>document.write(polygon)</script>" you are trying to use javascript code while it is imposible in php side. All php scripts run before javascript. You can use proj4php as mentioned in the comments. Another solution is to fill the polywrite variable at javascript side and create an Ajax request sending `polywrite' to a ...


3

It seems you try to persist your entity and its id remains null. That's why your get a constraint violation error. To simply solve this error I suggest you to try create your database table using auto-incrementation option on your SHAPE field. It should solve your problem, I guess. OR Reading the documentation on LAST_INSERT_ID() I would suggest that the ...


3

This is quick and dirty. Most of this was adapted from the following website: http://www.movable-type.co.uk/scripts/latlong.html I haven't tested this too much but it seemed to work after initial testing. It will return a list of lat, long coordinate pairs along a line at a specified interval. I wrote it in python since I don't know php very well. from ...


2

If you're looking for geojson support, I would go for builtin PostgreSQL capabilities instead of parsing it with PHP. It's available since version 9.3 and it works like charm with Leaflet library. You'd also probably need to do some routing if you want to build a RESTful app and you might find any of these PHP framework handy.


2

I think the best approach is to go with Mapserver or Geosever (since you are new, Geoserver will look a lot easier) Once you set a WMS service with geoserver, you can add the resulting WMS to your OpenLayers project. Geoserver automatically returns only the information in the extent of the current view, also you can set the range of visible scales on your ...


2

This article on the marching squares algorithm outlines the general algorithm. Here is a good implementation, in various languages, though sadly not Python. Having said that, the algorithm basically just operates on arrays in loops, so ought to be reasonably easy to port. I have used the Java version to do contours and can confirm that it works, in the ...


2

The popup is printing the text just as you have written it. Use javascript variables in marker.bindPopup, not php: marker.bindPopup(data[i].name + "<br>" + data[i].user_date + "<br>" + data[i].user_time + "<br>" + data[i].address + "<br>" + data[i].icon_name).addTo(map);


2

In the javascript code the array is treated as a string so try to parse this sting as json before using , then assign the result to coordinates . So if your result in success function is result , parse its coordinates attribute before using it this is example how to do so : result = { "type": "FeatureCollection", "features": [ { ...


2

Yes. You have to send your data from the client to the server and let server-code handle the database-insert. You should look into HTTP POST through jQuery or other libraries as a way to asynchronously send your data from the client to the server.


2

Yes, you can do it. Just render the HTML you need in the view and "inject" that code in the visualization infowindow template. For example: ... layer.infowindow.set('template', document.getElementById('infowindow_template')); ...


2

As @tmcgee points out in the linked answer, the list of basic base maps that can be passed to the constructor are set in the esriConfig defaults object. It's not that the error message needs to be updated, it's that the constructor can only be passed a value in this list and that doesn't include an entry for the Terrain with Labels basemap. I've handled ...


1

As mentioned by TsvGis, you'll probably need to embed the font in the document. You appear to be using reportlab for this, check the FAQ on their site, they have an example of how to embed fonts - section 2.6.2 Be aware that there might be licensing issues on some commercial fonts (they may not embed properly). If this is the case there are plenty of ...


1

If you have access to the Geocortex Site, then the easy way to consume your data is by using a Workflow to make the web request from the Geocortex Essentials server, which can then create a new Graphics Layer and add it to their map. If you don't, then making a WMS server is one option. However, it would be simpler to generate a GeoRSS feed of your points ...


1

While your PHP looks to be creating an array, I'm not sure that you're going to have consistent luck getting JS to read it that way (an arrant space here or there, etc.). At least I've tried that in the past, only to realize that while it LOOKS like a good array, it isn't. I think you're better off just returning your MySQL as a true array and then using ...


1

You could issue a AJAX request to your PHP service. In Javascript, add an event listener to your radio buttons that listens for change events. In the listener, issue the AJAX request to your PHP service. Handle the response of the PHP server in the AJAX callback and update your map.


1

I recommend using an IDE such as Eclipse rather than Notepad++. Once you've ascended the IDE learning curve, you will be more productive, and more employable (if that's a consideration). I'm developing an Android Smartphone navigation application using Java and Eclipse, a combination which works well for me. It should be possible to develop a GIS web ...


1

If you plan to use Mapserver and PostGIS, you may edit the spatial database using WFS-T provided by TinyOWS add-on: link to the docs There is also a project called dirt-simple-postgis-http-api (former PostGIS RESTful Web Service Framework), but it's read-only. For full CRUD capabilities, you will have to create a backend service from scratch. ...


1

I think the application server will be doing very little so I would just go with whatever web framework you are already familiar with. You can configure GeoServer completely using their REST API and you can manipulate/query the data directly from GeoServer using WMS/WFS (preferably with JSONP) without having to touch PostGIS directly. All the application ...


1

How can I pass the value from the HTML/JavaScript to the PHP file where I have the connection with database? If you use jQuery, you can use an AJAX call like this: $.ajax({ data: {lat : lat, lng: lng}, type: "POST", url: "script.php", success: function (e) { alert(e); }, error: function (er) { ...


1

What are looking for is an OpenLayers strategy. You do not use this directly, but one of the subclasses, such as BBOX or Cluster or Fixed. The cluster strategy does as it says and combines point that are close together into clusters, based on a threshold, which will lead to much faster rendering times when you have many points in view. Unfortunately, the ...


1

You shouldn't need to re-implement the wheel, there are lots of geospatial libraries out there. As you've noticed, PostGIS includes a buffer function, unfortunately MySQL has sub-standard spatial support and therefore doesn't include one. If possible you may wish to consider switching to PostGIS if spatial functionality is important to you. There are ...


1

Glad you got it sorted out. It is worth clarifying that the basemaps from the BasemapGallery have no relationship to the basemap ids of the map object. The mechanics as I understand them are as follows: The widget retrieves the basemaps it uses from ArcGIS Online from a specific map group. First it searches for the group based on title/owner: ...


1

there is a php extension called php-gdal I found some install instructions: https://www.drupal.org/node/2133103 the main site: https://github.com/geonef/php5-gdal helpful? http://dl.maptools.org/dl/php_ogr/php_ogr_documentation.html I looked at scruss' suggestion: ( How to read GeoTIFF using PHP? ) and downloaded the code to take a look at. I'm not ...


1

Here are a couple of thoughts on what you can do to boost performance: Send a BBox to server and return only points within it Use a library like turf.js http://turfjs.org/ on the client to only draw points within the maps current BBox Marker Clustering https://github.com/Leaflet/Leaflet.markercluster Use SVG icons instead of images Only return geometry and ...


1

You get this error when there are no results, so the query returns 0 records, and row[0] does not exist. Using another postgres query method you can avoid this error: $result = pg_exec($dbconn, $query); $numrows = pg_numrows($result); // Loop through rows in the result set for($i = 0; $i < $numrows; $i++) { $row = pg_fetch_array($result, $i); ...



Only top voted, non community-wiki answers of a minimum length are eligible