6

I am currently experimenting with Geoserver and it's capabilities within C#. One thing I would like to do is query the server for basic information (existing workspaces, layers, layer attributes, etc...)

I noticed that Geoserver does have a REST implementation, but is there a C# implementation for consuming this service? I am sure a library could easily be written, but I would hate to re-invent the wheel if one already exists. Thank you!

Edit

This can be done using C# WebRequests. However, what I would have created is a C# library for consuming the Geoserver REST implementation. It seems like something many people would use. Another way to ask the question would be, "Does a library full of C# WebRequests exist to consume Geoserver's REST implementation?"

It is much easier if a library already exists with classes such as these to consume the webservice, than it is to create an entire library. For Example:

var geoserver = new Geoserver("http://localhost:8080/geoserver/web");
var workSpaces = geoserver.Workspaces;
var layer = geoserver.Workspaces[0].Layers["Foo"];

The above code is the type of implementation I would really enjoy. If I was to create a library that consumed the Geoserver REST service. The above is what I would create for myself to use. If it wasn't created already, I would likely make an opensource project that others could use as well. So that in the future, if someone is wanting a library to easily consume the Geoserver service, they can contribute and use the one that already exists! :)

0

4 Answers 4

3

I haven't tested the library, but the GSRCC library looks promising place to start: https://code.google.com/p/gsrcc/

The GSRCC library is a C#.net Client to the Geoserver 2.1.x+ RESTful configuration extension. Using this library, one can access a remote Geoserver via HTTP and configure it.

The REST extension of Geoserver has to be installed on Geoserver.

This project uses .net framework 4.0 and has no extra dependencies!

This is a conversion from the http://code.google.com/p/gsrcj/, which is a Java Api. Since there was no C# .net API for accessing the REST Api for Geoserver.

The first version aims to implement the same thing in the java version, and latter to implement the full rest api.

2

I use RESTSHARP for communicating with many REST web services. Makes everything a lot easier.

0
2

I think it is a perfectly reasonable question to ask, no-one wants to reinvent the wheel. I had a similar requirement on a project and I too could not find a C# assembly that would make working with GeoServer easier.

In the end I created a class within my project to simplify the REST calls to/from GeoServer but it was specifically tuned to my needs. I would happily contribute to an Open Source project to create a C# management assembly for GeoServer.

0

For anyone looking for such a solution and somehow stumbles upon this post. Here is a working solution:

http://www.java2s.com/Open-Source/CSharp_Free_Code/API/Download_Geoserver_Rest_Net.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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