4

Is there a way to implement a WMS server using only php or python cgi and mysql? I can't use geoserver or mapserver and postgres and any other software as they are not provided by the administrator.

3

Please check out https://github.com/klokantech/tileserver-php/ might be helpful for you.

| improve this answer | |
5

You could use TileMill to make tiles as MBTiles: https://www.mapbox.com/tilemill/

Then use something like python-mbtiles to serve it up: https://github.com/perrygeo/python-mbtiles.

| improve this answer | |
  • Just a quick clarification: This won't really be a WMS service. It's a tileset that can be accessed as a XYZLayer; However, it is probably OP's only option. – Devdatta Tengshe Dec 4 '13 at 3:04
  • Is this a cgi service cause I don't have access to shell. – neogeomat Dec 4 '13 at 3:29
  • @neogeomat, take a look at the docs for python-mbtiles. You can do either. Use TileMill to make (pre-render) tiles. Then use the python script to make a folder full of tiles that can be grabbed using a standard format (url/x/y/z or whatever) or the script can read straight from the SQLite database that TileMill generates. You could also use MapBox to host it all for you. – Alex Leith Dec 4 '13 at 22:02
2

If you have tiled map in MBTiles format, you can serve them using ordinary PHP script. All you need is php-sqlite module, which should be included by default. You can try this: mbtiles-php - I'm using similar script in production. With some kind of URL-routing library, you can even simulate standard TMS.

Actually, you also can write your own WMS implementation using PHP or Python and MySQL database as a backend, but the task is tedious, and it is likely that you will get banned for putting too much load on the server. Bear in mind that WMS is very resource-hungry service.

| improve this answer | |
0

You could also try Mapnik's OGCServer which is apparently a pure python wms server

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.