Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

This question is related to "Options for displaying PostGIS vectors in OpenLayers?", but I need SVG output on server. OpenLayers must render SVG directly.

We are using Mapserver6, and thinking on WFS server mode (can be other?)... Need TinyOWS to faster output or easier configuration?

There are tutorials (?) for the problem of multiples minscale/maxscale on Mapfile layers -- for use something like st_union and st_simplify PostGIS functions to reduce trafic and complexity on big vectors.

For display we think to use some like,

map.addLayer( new OpenLayers.Layer.Vector(
    "Setores",
    {   strategies: [new OpenLayers.Strategy.BBOX()],
        protocol: new OpenLayers.Protocol.WFS({
            url: conf_url_wfs,
            featureType: "setores_vector", 
            featureNS: "http://www.openplans.org/topp"
            }),
        renderers: ["SVG"]
},
    {isBaseLayer:false,visibility: true}
));

There are a Mapserver example like this simple GeoServer example? Examples with Mapfile also (and connectiontype=postgis).

share|improve this question
add comment

2 Answers

You can look here an example of mapserver settings for svg...in mapserver for svg support with wms is not supported yet. You can read here. FORMATOPTION “COMPRESSED_OUTPUT=TRUE” is set MapServer will produce a compressed SVG file (svgz) maybe you will need this too..

and in openlayers showing svg file pls read SVGWeb which has lots of examples for you....

MAP
  NAME 'japan'
  EXTENT 122.935414 24.040589 153.986285 45.554518
  STATUS OFF # we don't want a raster map
  UNITS DD
  SHAPEPATH "/usr/local/apache/htdocs/japan/data/"
  WEB
    HEADER '../header.svg'
    FOOTER '../footer.svg'
    QUERYFORMAT 'image/svg+xml'
  END


LAYER
  CONNECTIONTYPE postgis
  NAME "z9_road"
  STATUS DEFAULT
  CONNECTION "user=postgres dbname=gsi2500 host=10.10.10.100 port=5432"
  DATA "the_geom from (select gid,the_geom from z9_road) as foo using unique gid using SRID=4301"
  TYPE QUERY
  HEADER ../z9_road_header.svg
  FOOTER ../z9_road_footer.svg
  TEMPLATE ../z9_road_template.svg
END
END

i hope it helps you....

share|improve this answer
    
Thanks a lot! Do you have also the OpenLayers Javascript fragment, or link, that use this Mapfile? (featureType parameter is "z9_road" or "japan"?) I will test all your clues this week (!). –  Peter Krauss May 16 '12 at 13:58
add comment

You dont want to go for mapserver because you have the postGIS database. setup tinyOWS server and you can access it using openlayers like other WFS-T services. see tinyOWS configuration. its simple and easy. Also you can find a sample OpenLayers Example with WFS-T.

Happy GIS ing

share|improve this answer
    
Sounds as good news, thanks a lot (!)... Perhaps little problem: the OpenLayers example not use SVG image, only JPG, "{layers: 'osm', format: 'image/jpeg'}". Do you have a (complete) SVG example? –  Peter Krauss Nov 5 '12 at 7:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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