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 ...


2

You would need to georeference (that's the term) image with QGIS. See my answer to this question for tutorial links.


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

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

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 ...


2

You may try this project instead: https://github.com/klokantech/tileserver-php/ It is easier to install, tested on several free web hosting providers, it can run also without .htaccess (if really required) and there are sample viewers (Leaflet, OpenLayers, OL3, Google Maps API, etc) presenting a copy&paste ready JavaScript source code for how to use ...


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

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": [ { ...


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

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);


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

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

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

It depends on how many files you need to convert. If you have a lot, a simple solution is to install the free GeoServer and publish all the shapefiles as WMS or WFS (depending on use-case). Geoserver handles the delivery and you do not need to no any conversion. This will allow you to overlay them in most web map scenarios without overloading your client ...


1

Ok, this is not really a GIS related but rather a programming related question. Anyway, for your intended purpose you can use almost any language you like. Here is a very, very simple PHP script based on the example Mapfile from the documentation at http://www.mapserver.org/mapscript/php/by_example.html. In this script only the variable DATA is altered: ...


1

I suppose you have been reading this http://docs.geoserver.org/latest/en/user/tutorials/cql/cql_tutorial.html Here comes some sample requests which are sending queries for the demo server of Boundless but which should work similarly with your own server if you have demo layer topp:states installed. Select where STATE_NAME is Illinois ...


1

This sort of thing is what humans are good at but computers aren't good at. One approach that may help is sorting the points in clockwise order, this will give you mostly what you want but will still need some manual intervention with a software package like ArcGis or QGIS. In essence find the leftest point (lowest X), if two are colinear then the one with ...


1

It will give you just the names and a point near the center of the region (someone correct me on the location of the point if I'm wrong please), but what about GeoNames from the NGA? Note, however, that their coverage does not include the U.S. For that, you would want the Geographic Name Information System (GNIS) from the USGS. Link for GeoNames is: ...


1

So the answer was "by using exec() as in an example showed in the answer to question http://stackoverflow.com/questions/18259089/execute-gdal-translate-in-php-using-exec".


1

Ran, Where is your PostgreSQL database housed. On BlueHost or somewhere else. You might want to check out last chapter of 2nd edition of our book which covers these topics and provides examples in PHP -- you can download the code for free has examples of Leaflet and OpenLayers with PHP http://www.postgis.us/chapter_17_edition_2 (2nd edition currently in ...


1

Theres a "kind of" API (read: some features are available through HTTP requests) described at http://geonetwork-opensource.org/manuals/trunk/eng/developer/xml_services/index.html . From that document: Url: http://localhost:8080/geonetwork/srv/eng/xml.search Mime-type: application/xml Post request:s <?xml version="1.0" encoding="UTF-8"?> ...


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 can change the fill color of a polygon with the setStyle method (inherited from Path). polygon.setStyle({fillColor: '#0000FF'}); If you're having difficulty getting the geojson displayed properly you might take a look at the Leaflet GeoJSON docs.



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