How can I add GML files to a GeoServer 2.2.2 instance?

How can I edit them "on the fly" and save the results back to the server using OpenLayers?

I'm adding a vector layer. in which we want to use gml. we want to add feature like point ,line etc. to gml. when we do editing on line that features will be saved on this layer. i want to insert that feature using openlayers on line like in wfs layer we do using transanction. similar type i want to do using gml ....

  • Welcome to gis.SE. To help provide you with a proper answer, can you please try to explain your situation in more detail? What are you trying to do? What sort of GML do you have? What type of detail do you need to edit? What have you already tried? What worked and what didn't work? You can just click "edit" above to add this information. – BradHards Mar 5 '13 at 8:04
  • 2
    Why would you want to store your data in gml? Seems a pretty bad choice. – johanvdw Jan 10 '14 at 7:51
  • You should try to avoid using GML format: It is still under development and far from being interoperable. – julien Apr 2 '14 at 14:16

As noted in the comments, XML (and thus GML) is not best used to store data, you would be far better using a spatial database to store your data.

Let's assume you have your data in such a spatial database, and have connected to this data source using GeoServer. If you set up a Web Map Service (WMS), then one of the output formats for the GetFeatureInfo requests is GML. Similarly you can set up a simple feature Web Feature Service (WFS), that provides GML as the (or one of the ~ depending on WFS version used) output formats. That's all standard functionality without the need to install any extension.

If you want to output a complex feature WFS (to conform to a particular application schema of GML), then there is also the `app schema' extension; but again the data itself is stored in a database.

WMS and WFS services are able to be consumed by an OpenLayers client application.


There is a gml extension to geoserver which allows you to load gml files. This manual explains how to do it, however it states that it is currently not supported in geoserver. Well, I think you can try it anyway.

As for editing the data: as soon as you are able to publish your data as WFS, you should be able to edit it as WFS-T with OpenLayers, just as e.g. shape files.

  • 1
    is there another way to do this – user15058 Mar 8 '13 at 7:15
  • unfortunately you cannot load gml files into geoserver without the extension. why is it a problem? – ylka Mar 8 '13 at 8:27
  • where do we find gml extension for geoserver 2.2.2 version. the older version of GML it is not supported.... – user15058 Mar 8 '13 at 8:51
  • 1
    sorry I don't know either, but found a topic where this issue is discussed: mail-archive.com/geoserver-users@lists.sourceforge.net/… – ylka Mar 8 '13 at 9:09
  • could we can edit gml and then save it to hard disk... using openlayers.... – user15058 Mar 11 '13 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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