6

Mapfiles are good for making standard WMS, WFS and WCS services. They are mostly stable even some limited set of the mapfile parameters can be changed on-the-fly by using the variable substitution mechanism. Static mapfiles are enough for serving data to GIS clients like ArcGIS, QGIS, OpenJUMP etc. and also for browser applications made with OpenLayers or ...


5

I just faced the same problem and solved it by copy the mapscript.py and _mapscript.so into my virtual env. cd venv/lib/python2.7/site-packages cp /usr/lib/python2.7/dist-packages/_mapscript.so . cp /usr/lib/python2.7/dist-packages/mapscript.py . At least the following script in a python web-app worked fine, based on the mapserver demo files I got here. .....


4

For shapefiles you should write "mapserver style" filtering expressions, e.g. layer.setFilter("([id] = 1)") The syntax you are using would be OK for RDBMS backends only (passed to a SQL where clause)


3

Have you tried to use this gem in your Rails application? https://github.com/sourcepole/ruby_mapscript From the documentation: Ruby MapScript API extensions This gem extends the SWIG MapScript API of UMN MapServer with Ruby-like > iterators and other API methods.


2

I would suggest looking into several options: Google Fusion Tables. Great way to import spreadsheet data with coordinates (or addresses), and display on a map. Exporting to KML I believe is an option. MapBox. Lots of big data implementations currently in the wild. http://mapbox.com/showcase/#bigdata ArcGIS Explorer Online (ESRI). From a big commercial ...


2

Your layers projection in the mapscript is different from the msv layers projection in OpenLayers, could it be the problem? I would use epsg:4326 everywhere


2

I found that there actually is a method for querying by Index in the layerObj $layerObj->queryByIndex(???, $fid) where ??? is probably the tileIndex of a layer object. Maybe I missed it in the documentation, but I am pretty sure that it is not there. I only found a int queryByIndex(....) in the mapObj section, but none in the layerObj section of the ...


2

Since you posted your question MapServer for Windows (MS4W) have released a new version, which provides version 7 of MapServer, and MapScript support for PHP, Python, Java, and CSharp. An alternative source of Windows Binaries for MapServer (with Mapscript support) can be found from GISInternals


2

And as always predictably happens...... About an hour after I post the question, I end up answering it and finding a solution. It turns out, all I needed to add to my constructor was the following map.maxExtent = new OpenLayers.Bounds(0,0,700000,1300000); This was added just after setting the map projection as follows function init() { map = new ...


2

You need to load "phpmapscript extension", if you're using php 5.2, you can use dl() function before phpinfo(), if your php are 5.3 of newer you need search to enable or use it.


2

From a clean Ubuntu 12.04 Precise install I was able to get it to work with this: echo 'deb http://ppa.launchpad.net/ubuntugis/ppa/ubuntu precise main' | sudo tee -a /etc/apt/sources.list echo 'deb-src http://ppa.launchpad.net/ubuntugis/ppa/ubuntu precise main' | sudo tee -a /etc/apt/sources.list sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ...


2

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


2

Thanks to @interactivegis.com for answer on MS4W-mailing list Hi Kenneth, The example code we sent out earlier today actually helps with this as well. The IDs are now in the layer object, so after you get the $layer and get a shape using the layerObj Methods (like queryBy or nextShape or whatever from https://www.mapserver.org/mapscript/mapscript.html#...


1

I seems that there was some kind of "conflict". Although php-v command was showing this: PHP 5.6.31-4+ubuntu16.04.1+deb.sury.org+4 (cli) my systems was getting kind of confused. I removed version 7 and then retried to build and it worked. I also tried this patch: --- a/mapscript/php/php_mapscript_util.h +++ b/mapscript/php/php_mapscript_util.h @@ -59,7 ...


1

I simply add this line before the import print "Content-type: text/html\n\n"; as detailed in this topic in Perl : Link to Stackoverflow


1

Finally I got it, it seems that getAllLayerNames and getLayersDrawingOrder have the same order. So here is my code: $allLayers = $oMapFinal->getAllLayerNames(); foreach ($allLayers as $index => $evalLayer){ $layer = $oMapFinal->getLayerByName($evalLayer); if($layer == MY CONDITION) { $arrLayOrder = $oMapFinal->...


1

With PHP-MapScript, you can get all layer names as an array. You can make an array of the layers wish to enable, using the layer name. This is not the most elegant solution, and there is likely a better method supported through the API, but quick and dirty you can just step through the entire list of layers and disable them and only enable the ones you want....


1

I didn't find any compiled php_mapscript for any current PHP as well, so I tried to compile it myself. Took me long time and a lot of failures but I did it. Don't know if you need this any more since your post is more than one year old but I have php_mapscript.dll built against php-5.6.27-win32-vc11-ts-x86 and Mapserver-7.0-vc11-x86 (stable branch package ...


1

Installing PostGIS 2.1 and PostgreSQL 9.3 on Ubuntu 12.04 etc. from the PostgreSQL Apt Repository can be found here: http://trac.osgeo.org/postgis/wiki/UsersWikiPostGIS21UbuntuPGSQL93Apt


1

$layer = $map->getLayerByName('layername'); //set an attribute value $layer->set('data', '/path/to/my/shape/file.shp'); or $layer = $map->getLayer('layer_index'); //integer! //set an attribute value $layer->set('data', '/path/to/my/shape/file.shp');


1

The answer is no. Mapscript and the mapfile are executed on the server and they have nothing to do with the OpenLayers client-side JavaScript. What you are requesting with OpenLayers.Layer.WMS is a set of images and metadata and by the time these get to the browser there is not much you can manipulate. Mapscript can be useful if you need to do lots of ...


1

I cannot comment on the answer which is a great answer, but wanted to add that I believe with 7.0 now you have to add a $map var in the query like: $layer->queryByIndex($map, 0, $myFID);


1

You might want to look into FME Server (Safe Software) as well. It can upload, process, tranform, reproject, and download in to pretty much any common format. It also has some very cool functions such as email/sms notifications and on demand feature streaming. Good luck!


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