[mapserver-users] Postgis and Mapserver
Stephen Woodbridge
woodbri at swoodbridge.com
Sat Apr 19 15:19:15 PDT 2008
Hans Castorp wrote:
>
>
> Hi to all,
>
>
>
> In the past days I have been answering some questions about it but, by
> now, I haven’t achieved my goal. I will try to explain what I have and
> what I want (need, in fact):
>
>
>
> I’m displaying some cartography: lines and polygons from shape files and
> points from a Postgis table (without filtering).
>
> At the same time, I have a form to query the postgis table applying some
> filters. I am making these queries using PHP and SQL in the usual way. I
> don’t use mapscript queryByAttibutes, because SQL queries are more
> flexible and powerful (I think). Due to these facts what I have is: on
> one side, a map showing all the points (with no filter) and, on the
> other side, a filtered list of these same points.
>
>
>
> What I’m looking to do is:
>
>
>
> - Zoom to all my selection, changing simbology in order to
> show some points with the default simbology (map file) and others (the
> result of my selection) with a special simbology.
>
> - Zoom to one chosen point in my selection. By now, I’m doing
> it using zoomToExtents, passing as parameters x and y of the point
> (retrieved in the sql query). This works fine but I need to change the
> simbology of the selected point in order to make it clearly visible
> between the others.
One way might be to create a LAYER in your mapfile the is a postGIS
connection and when you want to change the symbology turn it on and use
the same SQL as you use to get your filtered set, but this LAYER would
be drawn after the general layer and would have your highlited symbology.
-Steve W.
> What I’m trying in order to change simbology for selected points is
> something like this:
>
>
>
> $oMap = ms_newMapObj($szMapFile);
>
>
>
> $oLayer = $oMap->getLayerByName("EMPRESAS");
>
>
>
> $oClass = $oLayer->getClass(0);
>
>
>
> $oEstilo = $oClass->getStyle(0);
>
>
>
> $oLayer->setFilter($sql);
>
>
>
> $oEstilo->set("symbolname", "MARKER_EMPRESA_ALT");
>
>
>
> But I have no results (at least no errors, too J )
>
>
>
> Some help will be welcomed.
>
> Thanks in advance to everyone.
>
>
>
>
>
>
>
>
>
> Hans Castorp
>
>
>
>
> No virus found in this outgoing message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 269.23.0/1379 - Release Date:
> 15/04/2008 18:10
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
More information about the MapServer-users
mailing list