[mapserver-users] PostGIS / pgRouting error in mapfile

2017-01-06 Thread Stefanos Anastasiou
Hi list. Happy new year. :-)

I want to perform pgRouting with MapServer so I've create a function in postgis 
which I'll then be passing parameters with Runtime Substitution (or mapscript 
is a better idea?) which is the following:

CREATE OR REPLACE FUNCTION routing(source integer, target integer)
RETURNS TABLE(seq integer, path_seq integer, node bigint, edge bigint, cost 
double precision, agg_cost double precision, street text, geom text) AS
$$
   SELECT a.*, b.street, ST_AsText(b.geom) FROM 
   pgr_dijkstra('SELECT id, source, target, time AS cost FROM roads_noded', 
$1,$2, false) AS a
   INNER JOIN roads_noded AS b ON a.edge = b.id;
$$
LANGUAGE 'sql';

So, if I run this function by itself it returns all the results of dijkstra's 
algorithm PLUS the name of the street and the geometry in ST_AsText from of my 
road network.

I'm trying to put the query in the mapfile like this (minimal example): 

   CONNECTIONTYPE POSTGIS
   CONNECTION 'host=localhost port=5432 user=user password=somePass dbname=myDb'
   DATA "geom FROM (SELECT r.* FROM _a_router(1,24)) AS r INNER JOIN 
roads_noded as e ON e.id = r.edge using unique e.id using srid=2100"

but it won't work. The MS_ERRORFILE gives the following error:
  
   
msPostGISLayerWhichShapes(): Error (ERROR:  missing FROM-clause entry for table 
"r"
LINE 1: ..."geom"),'NDR'),'hex') as geom,"e.id" from (SELECT r.* FROM _...
 ^

I'm not following here... I have the from clause. How should I write the query?

Regards,
Stefanos

PS.: I hope this isn't off topic ...

Specs: 
MapServer version 7.0.1 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=XMP 
SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER 
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI 
SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL 
INPUT=SHAPEFILE


POSTGIS=2.3.1
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Mapserver data point on map

2017-01-06 Thread Carlos Ruiz
If you have PIXMAP symbols defined in your MAP file, be sure to assign them to 
the points by adding the following in your code:

$style->set("symbolname", "");

I remember that when adding points in a static MAP file I have to add a POINTS 
1 1 END symbol for the points to be drawn. Perhaps this is what is happening to 
you.

Best regards
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Mapserver data point on map

2017-01-06 Thread Lime, Steve D (MNIT)
Are the points displayed?

-Original Message-
From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On 
Behalf Of newmapserver
Sent: Wednesday, January 04, 2017 8:02 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Mapserver data point on map

Hello and happy new year ! 
Currently, I place points (lat / lon) on a map using a mysql query. At each
point is associated an image according to the type of places considered.

Today, I would like to retrieve my information either thanks to Mysql but
thanks to an API. I use the function "addPoints" to adding features to a
layer : 

*A part of script : *
$point = ms_newPointObj();
$line = ms_newLineObj();

$shape = 
ms_newShapeObj(MS_SHAPE_POINT);

$point->setXY( 
$lieu->longitude_metre, $lieu->latitude_metre); 
 
$line->add($point);



$shape->add($line);
$shape->set("text","ici");

$class = 
ms_newClassObj($layerprevision);
$class->setExpression("rot");
$style = ms_newStyleObj($class);
$style->color->setRGB(255, 0, 
0);   


$layerprevision->addFeature($shape);

I'm trying to set a simple "text" on each point but...nothing is displayed. 

Do you have an idea to solve this problem?
Thank you in advance !



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Mapserver-data-point-on-map-tp5301975.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users