Loading ...
Sorry, an error occurred while loading the content.

Re: Serving maps with svg

Expand Messages
  • neumannandreas
    Hi, I am doing this with Postgis (postgis.refractions.net) - an extension to the OS database PostgreSQL. I store both the OpenGIS geometry (which allows for
    Message 1 of 13 , Jun 2, 2003
    • 0 Attachment
      Hi,

      I am doing this with Postgis (postgis.refractions.net) - an extension
      to the OS database PostgreSQL. I store both the OpenGIS geometry
      (which allows for spatial queries and simple analysis) and a separate
      column with a compressed/optimized SVG geometry, which is actually
      sent to the client. To keep the two columns in sync if you change the
      OpenGIS geometry, you can use triggers in the database.

      Once the application is loaded the user can zoom and pan using a
      reference map. All the map layout elements and GUI stays in the
      browser, but additional data is requested using the getURL()/parseXML
      mechanism. This a non-standard Adobe Extension, but meanwhile also
      works on Batik and the Corel Viewer.

      Unfortunately I can't post a link to my application, since it is
      inhouse and with licensed data, which I am not supposed to share. But
      to get an idea on the client-side functionality you can have a look at
      http://www.carto.net/papers/svg/tuerlersee/ - whith the difference
      that the SVG data is served by the postgis database. Maybe we will
      post some more info on that on carto.net, later on.

      Andreas
    • vasile@geo.unibuc.ro
      ... I think is just a type error. the correct address is http://www.roitsystems.com/cgi-bin/gis/GISMax.cgi Regards, Vasile
      Message 2 of 13 , Jun 2, 2003
      • 0 Attachment
        >> http://www,roitsystems.com/cgi-bin/gis/GISMax.cgi
        >for I am a student in China ,I must use a proxy to visit the foreign
        >site .Unfortunately,ur website is unreachable.

        I think is just a type error. the correct address is

        http://www.roitsystems.com/cgi-bin/gis/GISMax.cgi


        Regards,
        Vasile
      • ronan@roasp.com
        Hi Asalei, First of all, my apologies, I had a typo in the url. http://www.roitsystems.com/cgi-bin/gis/GISMax.cgi Please see inline comments below in answer to
        Message 3 of 13 , Jun 2, 2003
        • 0 Attachment
          Hi Asalei,

          First of all, my apologies, I had a typo in the url.

          http://www.roitsystems.com/cgi-bin/gis/GISMax.cgi

          Please see inline comments below in answer to your questions

          > I think there is two ways to manipulate the map at client side .
          > 1 use a browser plugin,such as adobe's svgviewer,and javascript or
          > the embedded ecmaScript to control the map and execute Gis
          > operations,for example,drawing a contour map.
          > 2 use the batik viewer ,and use java programe to implement the
          > functions.

          Right.

          But also, for clientside. you can use anything Batik with ECMAScripting.

          > And in server side ,there are also two means:
          > 1 use batik svg Generator
          > 2 use sql server to return a xml query result,and together with a xsl
          > file to generate the svg graphics.
          >

          By sql server, I presume you mean 'any sql compliant server'. IE 'any
          database'.
          Any program can interface with any database and generate SVG.
          This is quite simple technologically.

          I would not particularly suggest using XSLT, although that opinion may change
          over time/exposure. But XSLT processors are too slow by my taste and
          insufficiently flexible (for example, try to use an xslt processor to merge
          database (RDBM)-generated svg with existing svg documents. I find this very
          hard to do and far easier to parse the SVG documents and embed the parts I want
          them within a <defs></defs> segment.
          I find it far too constrained for most of the mappings that I need to do, and
          it only works on the initial drawing.
          I have heard that Corel have done some excellent XSLT transforms work in their
          Smart Graphics server, but have not seen much quality xslt work that replaces
          dynamic server-driven graphics.

          My preference is to use serverside SVG generation with the business logic on
          the server, and clientside SVG rendering and simple manipulation (drag and drop
          can not be done server-side). I try to keep all state data serverside so that
          it can be shared between users.

          I use Perl to generate the SVG, although I am becoming increasingly impressed
          by php for its easy learning curve (and it is really just a simple version of
          perl in many ways).

          I stay away from Batik server-side because it is far too slow for my needs and
          much too cumbersome to use for prototyping by my yardstick.


          > And a bad news,I can't see you work at
          > > http://www,roitsystems.com/cgi-bin/gis/GISMax.cgi
          > for I am a student in China ,I must use a proxy to visit the foreign
          > site .Unfortunately,ur website is unreachable.
          >
          > I will mail u once I get a pace.
          >
          > asalei
          >
          > --- In svg-developers@yahoogroups.com, "Ronan Oger" <ronan@r...>
          > wrote:
          > > Hi Asaleitong,
          > >
          > > I've been working on a similar project - gis system with serverside
          > map
          > > storage and generation with simple clientside handling.
          > >
          > > You would certainly be able to do this using a jsp program. I am
          > not sure
          > > why you want to use an applet rather than a java program or one of
          > the
          > > plugins available for the browsers.
          > >
          > > The only thing you might be careful with is the slowness of the
          > batik
          > > solution. Serverside Batik is very slow.
          > >
          > > Here is the system I am working on:
          > >
          > > (to begin, you neet to click on 'fetch' and drag a rectangular
          > area, then
          > > you can manipulate the individual sprites by selecting an action and
          > > clicking on one of their round control points)
          > >
          > > It's really just a proof of concept, but is coming along slowly.
          > >
          > > http://www.roitsystems.com/cgi-bin/gis/GISMax.cgi

          typo fixed above
          --Ronan

          > >
          > > The technology is perl using the SVG.pm module serverside, and some
          > > cgi-generated javascript clientside.
          > >
          > > Ronan
          > >
        • Andrew Coats
          If you have the option, using the PostGIS database, as Andreas does, is a very elegant solution. Some related links that will help you implement some GIS
          Message 4 of 13 , Jun 2, 2003
          • 0 Attachment
            If you have the option, using the PostGIS database, as Andreas does,
            is a very elegant solution. Some related links that will help you
            implement some GIS functionality (very Java centric).

            Tools in Java for doing operations such intersection
            http://www.vividsolutions.com/projects/jts.html

            Tools in Java for just about everything GIS related including
            projections. Well worth a lot before you do any development
            yourself.
            http://www.geotools.org/

            Tools in C# that do spatial operations such as intersection,
            projections, shapefile reader etc…….
            http://sourceforge.net/projects/geotoolsnet

            Website for Open GIS. WKB is great way to store your polygon
            information in the database (as Andreas mentioned).
            http://www.opengis.org/

            Andrew Coats



            --- In svg-developers@yahoogroups.com, "neumannandreas"
            <neumann@k...> wrote:
            > Hi,
            >
            > I am doing this with Postgis (postgis.refractions.net) - an
            extension
            > to the OS database PostgreSQL. I store both the OpenGIS geometry
            > (which allows for spatial queries and simple analysis) and a
            separate
            > column with a compressed/optimized SVG geometry, which is actually
            > sent to the client. To keep the two columns in sync if you change
            the
            > OpenGIS geometry, you can use triggers in the database.
            >
            > Once the application is loaded the user can zoom and pan using a
            > reference map. All the map layout elements and GUI stays in the
            > browser, but additional data is requested using the getURL
            ()/parseXML
            > mechanism. This a non-standard Adobe Extension, but meanwhile also
            > works on Batik and the Corel Viewer.
            >
            > Unfortunately I can't post a link to my application, since it is
            > inhouse and with licensed data, which I am not supposed to share.
            But
            > to get an idea on the client-side functionality you can have a
            look at
            > http://www.carto.net/papers/svg/tuerlersee/ - whith the difference
            > that the SVG data is served by the postgis database. Maybe we will
            > post some more info on that on carto.net, later on.
            >
            > Andreas
          • Vladimir Belomestnov
            Hey, everyone, cool thread! I am working on GIS solutions for five years now and tried it all ... First thing implemented was a truckload of bitmaps generated
            Message 5 of 13 , Jun 2, 2003
            • 0 Attachment
              Hey, everyone, cool thread!

              I am working on GIS solutions for five years now and tried it all
              :-)))

              First thing implemented was a truckload of bitmaps generated from
              MapInfo and appropriate HTML image maps that were highliting the
              active elements. The thing of beauty - fast, cheap, still works for
              some government agency and they don't dream of anything better!

              The development project used similar bitmaps for the underlying
              cosmetic layers and VML for active features and thematic maps.
              MSAccess for the backend - served about 20 simultaneous web
              connections to IIS in a blink. Very simple in the client-side
              scripting.

              Then we got serious. MSSQL for the backend - I used SQLXML extension
              to generate pure SVG and serve it. So far this was the simpliest and
              the easiest to manage solution at the server side. Performance was
              good too. If someone is not aware of SQLXML - give it a try - it's
              hillarious as a concept! Platform dependance is a defenite drawback
              though.

              In the end to solve our platform independence requirements we had to
              switch to Java. We use Turbine-Torque-Velocity-XSLT framework and the
              backend is pluggable (Oracle and MSSQL so far).

              Initially I was goiing to use Batik to generate SVG. And then I
              realized that it is not required. All I do now is filling up the
              Velocity template which produces a pefect SVG of any complexity. In
              the next release we are switching from Velocity to JSP. I use Batik
              to render bitmaps from parametrically defined objects built up using
              AWT (not really useful for GIS but perfect for engineering graphics).
              Thus used Batik is fast and light on resources.

              Client-side scripting is a real pain. Right now I am bound to IE5.5+
              but would love to switch to ECMA (ASV3 in particular). Two problems
              there: ECMA does not interact with browser's scripting engine (as far
              as I know :) and I could not find production-quality libraries to
              generate standard widgets in SVG (SVGUI is great but not there yet
              :-((((). And the comlexity of interaction that I have to provide
              restrains me from switching to anything else (over 2000 lines of JS
              to rewrite...)

              Performance. My initial designs were based on a comlete relational
              hierarcy starting from presentation level then going through layers-
              features (a separate table for each kind of primitive and
              corresponding attributes) and ending up with nodes. It was good for
              SQLXML but importing the GIS data in such structure and especially
              binding it to business data is unnecessarily complex. Also with
              Tomcat as application server the recursive tree scanning (for spatial
              queries) is sensibly expensive. Now I am on the route to simplify the
              data structure and query mechanism (e.g. instead of querying the
              database as many times as many layers I have getting it all in one
              shot and sorting layers out in the template engine - Velocity or
              JSP). The only doubt is whether I have to put node coordinates in
              raw format as a column in features table. This will improve
              performance up to 20% in my test environment (according to the
              profiler estimates) but will complicate GIS data synch with sources.
              I will leave this as the last resource.

              I hope somebody will find this review useful ;-))))
            • Randy George
              Hi Very interesting. I ll throw in my opinion. I agree with Ronan that Batik is powerful but overkill for SVG generation and/or filtering for many
              Message 6 of 13 , Jun 2, 2003
              • 0 Attachment
                Hi

                Very interesting. I'll throw in my opinion.

                I agree with Ronan that Batik is powerful but overkill for SVG generation
                and/or filtering for many applications. Batik though allows very powerful
                client side tool development, a browser for very vertical markets.

                I think the most elegant and powerful approach is Andreas's GeoSpatial
                database on the backend. It is interesting to note he advocates a parallel
                SVG column instead of generating SVG on the fly. I assume this is for
                performance but complicates synch life.

                Java on the server side would appear to be the most powerful and flexible
                but the nice thing about SVG is that it can be generated easily by whatever
                tools you are familiar with.

                The lack of SVG GUI widgets XForms etc makes hybrid interfaces (HTML
                iframes with SVG src's) more practical for the present. But I assume this
                will change rapidly. There is a lot of stifled creativity that could be
                unleashed with SVG based forms and widgets.

                SQLXML - Hopefully XMLQuery will provide a more portable approach? But in
                the meantime JDBC is very simple and portable. XML databases seem to have
                become victims of troubled economies.

                Further note: SVG with JAI makes for very interesting hybrid GIS systems.
                TIFF imagery on the server with png/jpg to the browser which allows
                Satellite imagery to coexist in GIS web applications very simply.

                Randy

                -----Original Message-----
                From: Vladimir Belomestnov [mailto:izobretatel@...]
                Sent: Monday, June 02, 2003 8:14 AM
                To: svg-developers@yahoogroups.com
                Subject: [svg-developers] Re: Serving maps with svg


                Hey, everyone, cool thread!

                I am working on GIS solutions for five years now and tried it all
                :-)))

                First thing implemented was a truckload of bitmaps generated from
                MapInfo and appropriate HTML image maps that were highliting the
                active elements. The thing of beauty - fast, cheap, still works for
                some government agency and they don't dream of anything better!

                The development project used similar bitmaps for the underlying
                cosmetic layers and VML for active features and thematic maps.
                MSAccess for the backend - served about 20 simultaneous web
                connections to IIS in a blink. Very simple in the client-side
                scripting.

                Then we got serious. MSSQL for the backend - I used SQLXML extension
                to generate pure SVG and serve it. So far this was the simpliest and
                the easiest to manage solution at the server side. Performance was
                good too. If someone is not aware of SQLXML - give it a try - it's
                hillarious as a concept! Platform dependance is a defenite drawback
                though.

                In the end to solve our platform independence requirements we had to
                switch to Java. We use Turbine-Torque-Velocity-XSLT framework and the
                backend is pluggable (Oracle and MSSQL so far).

                Initially I was goiing to use Batik to generate SVG. And then I
                realized that it is not required. All I do now is filling up the
                Velocity template which produces a pefect SVG of any complexity. In
                the next release we are switching from Velocity to JSP. I use Batik
                to render bitmaps from parametrically defined objects built up using
                AWT (not really useful for GIS but perfect for engineering graphics).
                Thus used Batik is fast and light on resources.

                Client-side scripting is a real pain. Right now I am bound to IE5.5+
                but would love to switch to ECMA (ASV3 in particular). Two problems
                there: ECMA does not interact with browser's scripting engine (as far
                as I know :) and I could not find production-quality libraries to
                generate standard widgets in SVG (SVGUI is great but not there yet
                :-((((). And the comlexity of interaction that I have to provide
                restrains me from switching to anything else (over 2000 lines of JS
                to rewrite...)

                Performance. My initial designs were based on a comlete relational
                hierarcy starting from presentation level then going through layers-
                features (a separate table for each kind of primitive and
                corresponding attributes) and ending up with nodes. It was good for
                SQLXML but importing the GIS data in such structure and especially
                binding it to business data is unnecessarily complex. Also with
                Tomcat as application server the recursive tree scanning (for spatial
                queries) is sensibly expensive. Now I am on the route to simplify the
                data structure and query mechanism (e.g. instead of querying the
                database as many times as many layers I have getting it all in one
                shot and sorting layers out in the template engine - Velocity or
                JSP). The only doubt is whether I have to put node coordinates in
                raw format as a column in features table. This will improve
                performance up to 20% in my test environment (according to the
                profiler estimates) but will complicate GIS data synch with sources.
                I will leave this as the last resource.

                I hope somebody will find this review useful ;-))))



                -----
                To unsubscribe send a message to: svg-developers-unsubscribe@yahoogroups.com
                -or-
                visit http://groups.yahoo.com/group/svg-developers and click "edit my
                membership"
                ----

                Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
              • neumannandreas
                ... GeoSpatial ... parallel ... for ... I just chose this approach for my application, yes for performance reasons. It might not be elegant in other
                Message 7 of 13 , Jun 2, 2003
                • 0 Attachment
                  > I think the most elegant and powerful approach is Andreas's
                  GeoSpatial
                  > database on the backend. It is interesting to note he advocates a
                  parallel
                  > SVG column instead of generating SVG on the fly. I assume this is
                  for
                  > performance but complicates synch life.

                  I just chose this approach for my application, yes for performance
                  reasons. It might not be elegant in other situations. You can either
                  store plain SVG coordinates (using relative coordinates and no
                  white-spaces) in a separate database column or gzip the svg pathes
                  already and send binary data. Most modern databases support blobs. I
                  store all my image tiles (pngs and jpegs) and partially the svg
                  geometry in blobs. I don't know whether performance is better with
                  blobs in a database or plain files for image tiles.

                  Regarding keeping geometry in synch:
                  PostgreSQL (and I assume other databases) allow to write extensions in
                  many languages (C, Perl, PLPGSQL, etc.) - one of these extensions
                  might be a translation function that converts OpenGIS geometry
                  datatypes (Multipolygons, Multilinestrings, etc.) automatically to SVG
                  geometry. A database trigger can initiate the conversion function each
                  time a database record had a change in the OpenGIS geometry.

                  In my case my apps are more or less readonly. Unfortunately I don't
                  have live links from PostGIS to our GIS system (which is currently
                  ARC/Info). I heard that this is possible with GRASS. So, in my current
                  situation I have pretty static geometry and can load ESRI shapefiles
                  from time to time. PostGIS comes with a Shapefile loader.

                  All the best,
                  Andreas
                • Klaus Foerster
                  ... if you re interested - i ve done one of these: http://geo4.uibk.ac.at/~klaus/svg/postgis/postgis_inout_assvg.c it let s you query your postgis geometry and
                  Message 8 of 13 , Jun 2, 2003
                  • 0 Attachment
                    neumannandreas wrote:
                    > PostgreSQL (and I assume other databases) allow to write extensions in
                    > many languages (C, Perl, PLPGSQL, etc.) - one of these extensions
                    > might be a translation function that converts OpenGIS geometry
                    > datatypes (Multipolygons, Multilinestrings, etc.) automatically to SVG
                    > geometry.

                    if you're interested - i've done one of these:
                    http://geo4.uibk.ac.at/~klaus/svg/postgis/postgis_inout_assvg.c

                    it let's you query your postgis geometry and deliver AsSvg(the_geom)
                    instead of AsText(the_geom). for paths and polygons it returns the d
                    attribute, for points you get circle's cx="" cy="" - well, not that
                    elegant but one posibility. a little more information on this implementation
                    can be found at http://geo4.uibk.ac.at/~klaus/svg/postgis/

                    hope this helps

                    klaus foerster

                    --
                    O-.
                    /_ )
                    | (U
                    klaus* /|
                    / /
                    ~ ~
                  • Vladimir Belomestnov
                    * svg has a y-down coordinate system so y-coords have to be * multiplied by -1 It was one of my mistakes... Now I use the view box negated by Y and put
                    Message 9 of 13 , Jun 2, 2003
                    • 0 Attachment
                      * svg has a y-down coordinate system so y-coords have to be
                      * multiplied by -1

                      It was one of my mistakes... Now I use the view box negated by Y and
                      put geometry in the group with transform="scale(1,-1)". This way the
                      original Y coordinates are preserved all the way through. If one
                      wants to put text as a GIS feature in such setup - it will be
                      vertically mirrored. To solve that I convert TTF fonts to SVG, add
                      transform="scale(1,-1)" to each glyph and it works just fine! May be
                      not the most elegant solution but sure the cheapest :-)))
                    • Gordon Bowman
                      Hi, If you are not already familiar with the new Corel Smart Graphics Studio (http://www.corel.com/servlet/Satellite?
                      Message 10 of 13 , Jun 4, 2003
                      • 0 Attachment
                        Hi,

                        If you are not already familiar with the new Corel Smart
                        Graphics Studio (http://www.corel.com/servlet/Satellite?
                        pagename=Corel/Products/productInfo&id=1042152819585), you may wish
                        to check it out. As well as
                        providing an IDE for creating data-driven graphics, we've designed a
                        markup language we call dSVG (Dynamic SVG), which features a full
                        suite of UI controls whose appearance is "completely" customizable,
                        as well as behaviours (including posting for forms), constraints and
                        expressions. The result is that you can create full-blown,
                        interactive, data-driven, SVG-based web applications with little or
                        no need for scripting. We hope that dSVG will one day be an endorsed
                        standard, but for now the dSVG markup is namespaced and implemented
                        with script so that it conforms to the existing SVG standard and can
                        work on any browser. There are some demos available at
                        http://www.corel.com/servlet/Satellite?
                        pagename=Corel/Products/resources&id=1042152819585, which show it in
                        action.

                        Gordon Bowman
                        Corel Corporation


                        > The lack of SVG GUI widgets XForms etc makes hybrid
                        interfaces (HTML
                        > iframes with SVG src's) more practical for the present. But I
                        assume this
                        > will change rapidly. There is a lot of stifled creativity that
                        could be
                        > unleashed with SVG based forms and widgets.
                      Your message has been successfully submitted and would be delivered to recipients shortly.