Tag Info

Hot answers tagged

9

This can be done quite easy in SQL All the below examples can be tested directly on http://postgisonline.org/map.php. Just paste the query and press Map1 SELECT GENERATE_SERIES(FLOOR(ST_YMin(the_polygon))::int , CEILING(ST_YMax(the_polygon))::int,200) y_value, ST_XMin(the_polygon) x_min, ST_XMax(the_polygon) x_max from (SELECT the_geom AS ...


5

As both a GDAL and MapServer developer, I would consider the C# bindings of both projects "mature". Tamas Szekerest does a great job working to keep feature parity between the Python and C# bindings of GDAL/OGR. While the basics of both the C# and Python bindings are essentially the same in GDAL/OGR, niceties around the edges can and often are quite ...


3

According to http://mapserver.org/mapscript/mapfile.html, creating a layer object works differently: test_map = new mapscript.mapObj() new_layer = new mapscript.layerObj() li = test_map.insertLayer(new_layer)


3

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


3

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 a look at the PRIORITY option for LABELS - http://mapserver.org/mapfile/label.html It is unclear how you are generating your map, and what client you are using to view images, but it often makes sense to store labels as separate layers in the MAP file, and switch them on and off through the client application (OpenLayers, WMS client etc.)


3

I am a mapserver developer and I have just committed a patch that should solve this issue. See changeset r12309 for the details.


3

You are doing it right and 1 is the status code (SUCCESS). Below is a complete (working) example of queryByShape implemented in Java mapscript (for a vector layer). Translating the sample into python should be a piece of cake, but I'm not sure how it works with raster layers. /** * query a single layer by specifying a shape (in map coordinates). * * ...


2

I use a similar approach in Python with MapScript on Windows and it works fine. Careful with the following code: pathVariable += MY_PATH_VARS Environment.SetEnvironmentVariable("PATH", MY_PATH_VARS) I believe it should be: pathVariable += MY_PATH_VARS Environment.SetEnvironmentVariable("PATH", pathVariable) I'd look at the C# sourcecode for ...


2

EPIC FAIL: I apologize, I just found out that the documentation I mentioned is not up to date. The correct API (taken from the swig interface file) is the following: shape=layer.getShape(result) where result is the resultObj returned by getResult. Opened ticket and updated documentation (will go live soon). DOCUMENTATION mentioned in the answer below ...


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


1

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


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

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


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!


1

You do not need mapscript to achieve what you want. Simply use the mapserv cgi to publish the layers as WMS and then consume the WMS services from a OpenLayers-powered web page.


1

Its basically telling you whats wrong- you have not 'opened' the layer Try this: if (resultado.numresults > 0) { // Open layer layerUtbs.open(); // here i got a error (you shouldn't now);. layerUtbs.getFeature(resultado.getResult(0).shapeindex, resultado.getResult(0).tileindex); ...


1

I hope this helps: http://www.paolocorti.net/2006/09/20/mapserver-tutorial-for-c-mapscript-asp-net/


1

I'm a mapscript developer and I'm afraid that's not possible with the stock mapscript. You should implement the Memento pattern in your code as described here or you could use the clone() method to obtain a snapshot of the mapObj state to which you can eventually revert to. Safest option is to implement Memento. clone() might not work of even crash your ...


1

I've been having the same problem when trying to create a new CLASS object. I've logged it as a bug as the SWIG wrappers seem incorrect for both layerObj and classObj. The args variable is defined in neither: def __init__(self, map = None): this = _mapscript.new_layerObj(map) try: self.this.append(this) except: self.this = this if 1: ...


1

I have worked on Mapscript dll with C# with no problems at all. And also, if any new version of MapServer comes in you can rebuild the binaries easily. It should not be an issue.



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