After a good start many months ago of getting into GIS through QGIS, I had to drop what I was doing and did not touch it for quite some time. I am now able to get back into it and have a need to load GML vector maps. It strikes me that they have the same properties as Shapefiles, but there must be a difference.

Can someone give a simple explanation of the difference and the advantages either way?

I see that one can be converted into the other, so if there must be a reason to do so.

  • 3
    They serve somewhat different purposes. Can you explain a bit more about your specific circumstances so we can provide more directed answers?
    – BradHards
    Jan 11, 2013 at 23:58

4 Answers 4


You can't really choose either because as a GIS Professional data will come at you in a million different formats and you need to handle everything. This is why GDAL/OGR has so many translation algorithms. More importantly, neither format is a 'beautiful' way of managing and storing GIS data. For real GIS data management you want to use one of the spatially enabled database formats. Shapefiles and GML are now really formats of convenience and should both be treated as such.

A few more random thoughts:

  • The shapefile format is very old and often poorly implemented leading to poor data in some cases. On this note I was once even been told by one senior ESRI (the original developers of the shapefile) staff member that they wish the shapefile format would die but it is so prevalent as the data transfer format that it has a life of its own. GML is more recent... and often equally poorly implemented...
  • The Shapefile has been the lingua Franca of vector GIS since the 1980s and so is more widely accepted than GML which is why it remains one of the most common data transfer formats.
  • Shapefiles are binary and GML is text so as data volumes increase the shapefile can be smaller, though GML responds well to compression (especially when you strip redundant white-space) and is human readable (which I've never found to be a huge advantage in practice).
  • The GML format can be verbose and is not universally liked by GIS specialists. Anecdotal evidence comes from many conversations I've had on this topic with people including senior ESRI developers who have stated they prefer the KML format to GML (having opened THAT can of worms I shall step away from the argument!).
  • GML is a single file and less likely to lose bits along the way (I can't count the number of times I have been given just the '.shp' part of a shapefile - an understandable mistake given the name).
  • GML has no special advantage on the web as most web mapping systems are just as happy with a database or a shapefile and for a heavy-duty app, the database is the way to go.

I could ramble on with other pros and cons but really my first paragraph says it all. I would treat both formats as a means of sharing data rather than part of a GI-data archive management system.

  • Thanks to everyone for their answers. It has answered what I needed to know, that really it doesn't matter what I use for my purposes. I am using a map background and plotting archaeological finds data onto the map. My needs from GML or ShapeFiles id limited at this stage to be able to turn on and off layers as in most cases I will only need boundaries and contours. As Sylvester suggests, I will be getting map data from all sorts of sources, including raster files of old maps. Jan 12, 2013 at 16:41

Shapefiles have the restriction of 8 characters in field names, and only ASCII characters for them as well. I would prefer GML to avoid this.


What you're dealing with is two different formats of vector data - ESRI Shapefiles are the native vector format for ArcGIS which is a GIS package with a very long heritage (so thats why you're probably finding quite a lot of GIS data available out there in this format). GML is a Geographic Markup Language, extension of XML. QGIS can handle both formats (and many more) - as has been suggested above, it would be really helpful to know what your trying to do with the files.

  • 1
    I would not consider GML to be an extension of HTML. Did you mean XML?
    – BradHards
    Jan 12, 2013 at 7:32
  • Yup,sorry about that!
    – Andy TIce
    Jan 13, 2013 at 7:51

There is an existing comparison of vector formats that includes these two in Wikipedia. If you uncover any clear Pros and Cons here, I recommend you update that, and/or add a link there which comes to here.

  • 1
    Thats not much of an answer when the comparison table of Features doesn't actually have GML entries.
    – BradHards
    Jan 12, 2013 at 7:34
  • Granted - but it looks like a Work In Progress so hopefully subsequent contributions will make it improve with age as an answer.
    – PolyGeo
    Jan 12, 2013 at 8:40

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