|
From: AbdElhadi <abd...@gm...> - 2009-08-10 19:32:25
|
Edwin, How much effort did it take you/your company to make the proxy? It is a very attractive idea to let the WMS server deal with styles and colors and let your code only deal with the rules. Also, and this for Cameron, you might not need going through building a proxy yourself. If the number of map scenarios is limited, you can pre-generate the SLDs and manage the logic that chooses which one to use in your code. The time you might save could be substantial. You only need a proxy if you don't know beforehand what kind of theme the user is going to try to create, like in a web app that allows the user to change the colors and the thresholds used for theming dynamically in the UI and be able to see the results right away. Cheers, On Sun, Aug 9, 2009 at 10:08 PM, Edwin Commandeur < com...@gm...> wrote: > Hi Cameron, > > First, a correction. I checked and the WFS class was already in OpenLayers > 2.7 and OL versions before that. Although it is true that there were many > enhancements relating to WFS in OpenLayers 2.8. > > Anyway, I remember why it is relevant to know about the proxy. For > instance, I work on Windows, and the proxy is a python script that is set up > to run under Linux. The problem is: when the proxy doesn't work, the WFS > stuff doesn't work. > > You need a proxy to do WFS requests, because of cross-domain restrictions > on Ajax requests. There are solutions for doing cross-domain GET requests, > but doing cross-domain POST requests can only work with a proxy as far as I > know. > > Furthermore, the proxy that comes with OpenLayers is not very sophisticated > and may even present a security risk when it is accessible outside your app. > See also the comments in the proxy.cgi file. > > For GWT-OL it makes sense to have a proxy servlet in java. I may need to > look into that. Preferably, I want to keep GWT-OL client-side. Maybe, it is > necessary to start a "GWT-OL server" project that provides server side > components, such as a WFS proxy and a print servlet. > > Due to the cross-browser restrictions issue I had not looked deeply into > the WFS. > > Now onto what you describe. If you want to shade the map based on what > software version clients are using then you need SLD's. You probably want to > proxy the WMS call that OpenLayers does, and let the proxy do a WMS call > with an SLD that shades the map based on the version of the software. This > is not trivial unfortunetaly. We are using GeoTools for the SLD building in > a custom proxy that is proprietary. > > Why would you want to manually loop through polygons on the map? If for > instance the polygons are the states of the USA and they all have a property > CAPITAL, then you would want to store the polygons in a spatially enabled > database (PostGis or Oracle Spatial are the most common ones). A WMS server > could draw a map from those polygons. When someone clicks the map you either > do a getFeatureInfo request on the WMS to get the property, or you pass the > coordinate to the database and let a spatial query sort out in which polygon > the coordinate falls. > > I am not reading any use cases for WFS in your mail. WFS is also a bit > tricky, because you can kill the browser if the geometries of your features > are complicated, or if you have to draw a lot of features (that is really a > lot). I have seen that happen, that a getFeature request returns several mb > of reponse, killing the browser. > > As an aside, you can also draw your own geometries on the map in a Vector > layer. > > Greetings, > Edwin Commandeur > > P.S. In case you are wondering: With WMS it is possible to overcome cross > browser restrictions by using the image tag in WMS layers. The src attribute > of the image tag can point at any url. > > P.S. P.S. GWT and GWT-OL let you abstract from javascript and html, but > that doesn't mean you don't have to learn javascript and html (or other > browser related technologies). GWT solves many issues, such as using plain > java OO versus a javascript framework specific type of OO, compressing and > optimizing your javascript, make it possible to create modules etc. But > eventually, the code runs in the browser and it helps to know about browser > specific technologies. Especially CSS, but also javascript and html. > > > ---------- Forwarded message ---------- > From: Cameron Hunt <CH...@ci...> > Date: 2009/8/10 > Subject: RE: WFS Operations > To: Edwin Commandeur <com...@gm...> > > > Thanks Edwin, > > > > I’m happy to beta test anything you want. Just to give you some background > we are just in the early stages of an in house web application to track and > present customer information via a map. We are actually very new to web > development and also Java. We’ve come from a background of Delphi and used > TatukGIS VCL component in our old app which was especially easy to use but > now we are entering a different world. > > > > We would like to do things like shade the map based on what release of our > software customers are on. Also accessing external database information via > a common field (even if this is just manually retrieving from the DB once we > identify the associated polygon on the map). In fact all of our info will be > stored in an external database so rendering the map based on attributes will > be attributes coming from the DB so I’m hoping to be able to do things like > manually loop through the map polygons etc. > > > > GWT-OL certainly looks like the easiest way we’ve found so far without > having learn Javascript and HTML as well. > > > > I’m still coming to terms with understanding WMS and WFS so please forgive > me if I ask any dumb questions. > > > > So when your new changes come through instead of creating a WMS layer I > would create a WFS layer? > > > > Cameron > > > ------------------------------ > > *From:* Edwin Commandeur [mailto:com...@gm...] > *Sent:* Monday, 10 August 2009 08:59 AM > *To:* gwt...@li... > *Cc:* Cameron Hunt > *Subject:* WFS Operations > > > > Hi Cameron, > > Like the WMSGetFeatureInfo, the WFS support is also new in OpenLayers 2.8. > > The WFS support is high on my list to get working with GWT-OpenLayers, but > currently it is not in GWT-OL. I am just reworking the GWT-OL code and > showcase a little bit (removing warnings and deprecated AddClickListener > stuff), but after that I think the WMSGetFeatureInfo Control and the WFS > layer will be my primary goals. Having good WMS/WFS support is first on the > list, and getting a good Google Maps example a good second. > > Would be nice to have you as beta tester of the WMSGetFeatureInfo and WFS > support, when I get to it. I hope so this week. > > OpenLayers 2.8 does WFS requests via a cgi proxy to get past the > cross-domain restrictions. As a user you should not concern yourself with > that to much, but for your information... > > Greetings, > Edwin > > ---------- Forwarded message ---------- > From: *Cameron Hunt* <CH...@ci...> > Date: 2009/8/10 > Subject: RE: [Gwt-openlayers-users] Some general beginners questions > To: Edwin Commandeur <com...@gm...> > > Thank you Edwin, > > > > I am using Geoserver so I will look into the WFS operations. Should I be > able to perform these operations easily enough using GWT-Openlayers? > > > > Thanks. > > > > Regards > > Cameron > > > ------------------------------ > > *From:* Edwin Commandeur [mailto:com...@gm...] > *Sent:* Monday, 10 August 2009 07:20 AM > *To:* AbdElhadi > *Cc:* Cameron Hunt; gwt...@li... > *Subject:* Re: [Gwt-openlayers-users] Some general beginners questions > > > > Hi Cameron, > > *GetFeatureInfo*: Abdelhadi is right about the feature info on a WMS. You > would need a WMS server that supports GetFeatureInfo. GeoServer supports > GetFeatureInfo requests for example, as does MapServer. Be careful: the > GetFeatureInfo response has not been standardized by the OGC. > > Since OpenLayers 2.8, OpenLayers has WMSGetFeatureInfo control that > abstracts over several different GetFeatureInfo response formats. I will add > support for that control to GWT-OL. > > *Thematic mapping*: That is something I think you would have to achieve > using SLD's (Styled Layer Descriptors). Since SLD's can get quite big, in > our company we wrote a proxy for performing GetMap POST requests with custom > SLD's. That proxy is closed source however. You will have to roll your own > variant. > > *Printing*: Printing is always a bit problematic in my experience. You > will probably want to build a PDF server side with the information on the > map. If the map consists only of pictures (WMS layer, Legend graphics) then > you can get quite far with some server side code and a PDF generation > framework. There is one open source printing solution that I know of, and > that is the MapPrintService in the MapFish framework. At the core it is a > Java servlet and right now I am guessing it uses some Java PDF generation > library. Printing vector features is a little more challenging. > > A simple solution for printing is to provide a separate page with a clone > of the map in you app, and use the browser to print that. In my experience > the vector features get printed also, but you have little control over the > printing process itself. > > Greetings, > Edwin Commandeur > > 2009/8/7 AbdElhadi <abd...@gm...> > > Hi Cameron, > > I don't think you can get the feature info from a WMS layer unless the WMS > Server supports the GetFeatureInfo. a WMS is basically just an image. > > AS for Thematics, I don't think OL supports that but I am not sure. > > Cheers, > -Abdelhadi > > On Thu, Aug 6, 2009 at 11:34 PM, Cameron Hunt <CH...@ci...> wrote: > > Hi, > > > > I’ve just started using GWT-Openlayers and so far it looks great. Having > said that I’ve only done a few basic things. I would very much appreciate it > if somebody could give me a couple of quick pointers in the right direction > for the following tasks please? > > > > - Finding out the information about an object (e.g. polygon) when user > clicks on map (based on shapefile loaded in as WMS layer) > - Thematic mapping (e.g. shading all polygons based on an attribute). > - Printing. How do people provide basic printing to their users? > > > > Thank you. > > > > Regards, > > Cameron Hunt > Software Developer > Civica Solutions Pty Limited > > Ph: (07) 46393633 > Fx: (07) 46393632 > ch...@ci... > www.civica.com.au > > > > -- > > This email is from Civica Pty Limited and it, together with > any attachments, is confidential to the intended recipient(s) > and the contents may be legally privileged or contain > proprietary and private information. It is intended solely > for the person to whom it is addressed. If you are not an > intended recipient, you may not review, copy or distribute > this email. If received in error, please notify the sender > and delete the message from your system immediately. Any > views or opinions expressed in this email and any files > transmitted with it are those of the author only and may > not necessarily reflect the views of Civica and do not create > any legally binding rights or obligations whatsoever. Unless > otherwise pre-agreed by exchange of hard copy documents > signed by duly authorised representatives, contracts may not > be concluded on behalf of Civica by email. Please note that > neither Civica nor the sender accepts any responsibility for > any viruses and it is your responsibility to scan the email > and the attachments (if any). All email received and sent by > Civica may be monitored to protect the business interests of > Civica. > > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > > > > -- > Abdelhadi > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > > > -- > > This email is from Civica Pty Limited and it, together with > any attachments, is confidential to the intended recipient(s) > and the contents may be legally privileged or contain > proprietary and private information. It is intended solely > for the person to whom it is addressed. If you are not an > intended recipient, you may not review, copy or distribute > this email. If received in error, please notify the sender > and delete the message from your system immediately. Any > views or opinions expressed in this email and any files > transmitted with it are those of the author only and may > not necessarily reflect the views of Civica and do not create > any legally binding rights or obligations whatsoever. Unless > otherwise pre-agreed by exchange of hard copy documents > signed by duly authorised representatives, contracts may not > be concluded on behalf of Civica by email. Please note that > neither Civica nor the sender accepts any responsibility for > any viruses and it is your responsibility to scan the email > and the attachments (if any). All email received and sent by > Civica may be monitored to protect the business interests of > Civica. > > > > -- > > This email is from Civica Pty Limited and it, together with > any attachments, is confidential to the intended recipient(s) > and the contents may be legally privileged or contain > proprietary and private information. It is intended solely > for the person to whom it is addressed. If you are not an > intended recipient, you may not review, copy or distribute > this email. If received in error, please notify the sender > and delete the message from your system immediately. Any > views or opinions expressed in this email and any files > transmitted with it are those of the author only and may > not necessarily reflect the views of Civica and do not create > any legally binding rights or obligations whatsoever. Unless > otherwise pre-agreed by exchange of hard copy documents > signed by duly authorised representatives, contracts may not > be concluded on behalf of Civica by email. Please note that > neither Civica nor the sender accepts any responsibility for > any viruses and it is your responsibility to scan the email > and the attachments (if any). All email received and sent by > Civica may be monitored to protect the business interests of > Civica. > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Gwt-openlayers-users mailing list > Gwt...@li... > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users > > -- Abdelhadi |