ThinkGeo.com    |     Documentation    |     Premium Support

WFS Support

Is there Web Feature Service support in Map Suite? I am working on an idea that exposes ArcSDE data via WFS or WMS and WMS is a lackluster choice I think but a WFS seems like a possibility. I didn't immediately see if available upon skimming through the Web API.


 


Thanks.



Nelson, 
  
   I see what you mean.  You have two choices for this.  The first choice is to have the client consume the WFS service directly.  I’m not sure if the API is exposed but I think we could make this happen.  The drawback there is that the styles you have are limited to the ones that the client, JavaScript, can provide.  These are a bit limited and it may be slower drawing since it is all script. 
  
   The second option and I think the better one is for us or you to design a WfsFeatureSource and WfsFeatureLayer.  These could read the WFS and then all the drawing could be done on the server and you would have the full power of our Styles and since it would be a Layer you could easily manipulate, query it etc. 
  
   I think the second option is the best.  Creating your own FeatureSource and FeatureLayer might be daunting but it isn’t that hard.  We have a video at the link below to walk you though the basics.  If you have the code to read the WFS service and get the Well Known Binary then it will be a snap.  In fact if you write that piece I would be willing to integrate that into a FeatureSource and Featurelayer for you and share back the code.  What you need to do is have a way to get back the features in Well Known Binary or Well Known Text when you pass in some sort of bounding box.  I think I may need a few other things but check the video out. 
  
 gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/16/aft/4769/afv/topic/Default.aspx 
  
 David

Nelson, 
  
 WFS is not supported in currently version. It’s defenitely on our list but so far not have a fixed schedule, I think most possibly, we will add it in the future. 
  
 Ben.

Nelson, 
  
   Ben didnt see I answered this post.  My offer still stands if you write the WFS calls I will wrap it for you. 
  
 David

I'm interested in this and appreciate your offer. I am listening in on the supplied webinar and will try to tackle my end of this. I'm sure I can get the hang of extending Map Suite generally so I will definitely keep you posted. I am not technically familiar with WFS as it is so now is as good a time as any to get with it! I think it's a pretty well documented OGC format so it should go well. Thanks again, guys.


 


Edit: I think with the new versions released today break the example source that goes along with this webinar. Also, there's not chance that a VB version exists is there? Thanks again.


 


Edit 2: The OGC spec sheet for this is quite huge and I think if it is not implemented in full and in adherence to the spec then it will be in vain. It's too bad because I had a lot of confidence that this approach would allow for exposing the data in a layered format. I will try it out on MapServer to compare. As a side note though, it looks like Open Layers incorporates the ability to access WFS so I'm curious as to why it wouldn't be incorporated into the MapSuite API.



Nelson,


  I updated the sample with the latest version and also converted things to VB.NET just for you. :-) We will be updating our post to reflect the changes tomorrow but for now find the code attached.  Note that it doesn’t have the dependencies directory that has the shape files etc.  I did this to save space on this post.  You can grab it from the C# samples.  When we update the post we will have a proper VB.NET version with the files included.


David



325-VB_ExtendingMapSuiteFeatureSource_-_NO_DEPENDE.zip (39.7 KB)

Nelson, 
  
 I will check on the API for the web in regards to WFS.  I am pretty sure the reason is that it has very limited drawing capabilities compared to our server side rendering.   
  
   I disagree that if you don’t implement the whole thing it will be in vain.  This is the problem with these OGC specs, so much crap to deal with when 99% of the time the app uses just a small subset of the spec.  I doubt there is any 100% compliant code of all versions.  Don’t forget they version these things so more crap to deal with.  The approach I would take would just be to find lots of samples if this stuff out in the wild and then go for the common denominators.  If you find stuff later that doesn’t fit then enhance it.   
  
 David

I have been given a somewhat brief period of time to try to get this little implementation a shot. I am not really very good with the xmlTextReader and am cautious about which information to omit but I think for first phase implementation just the spatial data will suffice. 
  
 I did have an offshoot to this question though. Per our previous thread (gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/5088/afv/topic/Default.aspx) you made a reference to OGR. This was in relation to SDE implementation but I was wondering if there is support currently for OGR in Map Suite? I beleive OGR can read compliant WFS and export it to a desired type. I’m not sure if it would be faster to have OGR export to WKT/WKB or dump direct to shape for this purpose but I thought I’d ask. I don’t think the implementation is currently there though.

Nelson, 
  
   I am pretty sure OGR does have this capability however OGR is a beast to work with.  It has something like 30 or 40+ dependency DLLs in the whole thing.  While it is great in that it generalizes many different interfaces to one standard it is also limited as well for things like spatial queries and using indexes.  For this reason we have stayed away from it and chosen to do our own implementations.  I can scout around for some open source MIT style implementations that might help you out.  I would really like to see support for this it’s just we are short handed now and have some high priorities.  One thing you could do if you are on a time line is to have this go through our professional services team.  Of course they would charge you but it could be finished way before we could get it on our plate.  Just wanted throw out that option.   
  
 Found this on the simple implementation. 
 ogcnetwork.net/node/178 
  
 If you find some sources and send me a sample of the output for getting features by bounding box then I can take a look at parsing the GML and see what I can come up with. What you need is a routine to go from GML to WKB. 
  
 David

I’m working on a way of taking the GML and parsing to WKT since I haven’t found any good sources immediately for WKB. I suppose if I can translate to WKT then WKB should be similar. I am sticking to WFS 1.0.0 as the GML seems to be a little easier to handle for a newbie like me. When I get something like this going, I’ll send the sample your way. I think the easy part may actually be the second half of wrapping it up in to a FeatureSource and FeatureLayer! I may give this a shot on my own after I send it your way anyways since it’s something I’d like to learn at any rate, but it would certainly help to have a version that is implemented correctly! Thanks once again David. 
  
 In regards to the OGR support, yea it is quite interdepndant on various other dll’s. I’ve actually ran into many “dll-hell” related nights when I first started getting into GIS solutions. I suppose a lot of OGR’s functions seem to be present in Map Suite anyways so I doubt that it necessarily would bring a profound amount of functionality. I just had noticed you guys squeezed PROJ in there so I wasn’t sure. 
  
 At any rate, I am working on this and will attach the source to the thread if something worthwhile materializes. 
  
 Oh, on the offer for the proffesional help, what I had meant to say by my short time line was that I pitched the idea of exposing SDE over WFS and they gave me a truncated amount of time to attempt this otherwise we are going the ESRI path for now and their WebADF is crap compared to MapSuite! You guys have really put a lot of effort into this product and it shows.  
  
 Thanks again guys.

Nelson, 
  
   We will do what we can.  I admit that my promise to implement the second half was knowing that was the easier part. :-)  We would love to do the WFSFeatureLayer but we have so many other things going on right now it’s crazy.  Send me the samples and I can wrap it and you can also and we will compare notes.  If you get it into WKT then WKB be easy.  In fact I think we have a static method floating around that does that.  Just worry about the parsing now and I can see about the conversion. 
  
   OGR seems like this panacea but I know from experience as soon as we implement it people won’t like the performance and we will have to support it and write our own implementation to satisfy people.  From years here I know if we write it then we can support it well and adapt it to our customers needs.  This is a big plus for us.  As for Proj4 we are having issue with that now in IIS and I suspect we will be writing our own in managed code soon. :-( 
  
   With the 3.0 platform that we are on we are in a great position to write new Layers and add functionality.  We just had to spend over a year to design this new framework and get all of our products on it.  Expect lots of enhancements to this over the next year and beyond. 
  
   On the time line side of things.  I bet if you contacted sales and talked with them about your situation maybe they could agree to trade you professional service work for an agreement to purchase a license or two.  This would be good for both of us.  We get you as a client and you enjoy the advantage of Map Suite.   
  
 David

Can I have a list of all the WKT currently supported by Map Suite. I have something that works for MultiPolygons but I am relatively unfamiliar with WKT but I'm pretty sure the approach will need to be modified based on the GMl feature type.


 


Thanks.



Nelson, 
  
   Here is the list.  The top part is the ones you see 99% of the time.  We might support PointZ & PointM and just convert them to point but not sure.  I think if we had to we could add support for the others. 
  
 Supported: 
  
  POINT(6 10) 
  LINESTRING(3 4,10 50,20 25) 
  POLYGON((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2)) 
  MULTIPOINT(3.5 5.6,4.8 10.5) 
  MULTILINESTRING((3 4,10 50,20 25),(-5 -8,-10 -8,-15 -4)) 
  MULTIPOLYGON(((1 1,5 1,5 5,1 5,1 1),(2 2, 3 2, 3 3, 2 3,2 2)),((3 3,6 2,6 4,3 3))) 
  
 Unsupported or of Unknown Support: 
  
  GEOMETRYCOLLECTION(POINT(4 6),LINESTRING(4 6,7 10)) 
  POINT ZM (1 1 5 60) 
  POINT M (1 1 80) 
  POINT EMPTY 
  MULTIPOLYGON EMPTY 
  
 David

Nelson, 
  
 This is a pretty good reference for WKT. 
  
 en.wikipedia.org/wiki/Well-known_text 
  
 This one for WKB. 
  
 publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/opt/rsbp4121.htm 
  
 Doesn’t matter though I can deal with the WKT to turn it into WKB easily. 
  
 Also did you ever check out the VB code I posted for the Extending Map Suite?  Posted it a few days ago.   
  
 David

Very good. I'm able to get an entire parcels layer to render, although this is in the Desktop edition. And hopefully I haven't accidentally omitted any features! I'll keep you up to date.


I haven't had a chance to check the VB code for Extending Map Suite yet as I suppose before I can get to that I need to have this first part implemented but I really appreciate it and will let you know how that runs as soon as I do.


Also, thank you for the references. This will help out a lot.



Nelson, 
  
   Glad I could be of service.  I am forwarding on the materials you sent in your e-mail.  You should hear from somone soon. 
  
 David

Thanks, Dave.



Nelson, 
  
   My pleasure. 
  
 David