Why convert SHP to GML?
GML (Geography Markup Language, OGC standard published 2000, also ISO 19136) is an XML-based format required by INSPIRE-compliant data submissions in Europe and accepted by government portals and spatial databases that mandate OGC formats. Converting from Shapefile to .gml is common for interoperability with such systems.
How to convert SHP to GML
QGIS FREE
Add the Shapefile as a vector layer, right-click it in the Layers panel, choose Export > Save Features As, and set the format to GML.
ogr2ogr OPEN-SOURCE
Run ogr2ogr -f GML out.gml in.shp; add -t_srs EPSG:4326 to reproject to WGS 84 if the target system requires latitude/longitude.
Programs that convert SHP
About these formats
A .shp file is almost always an Esri Shapefile - geospatial vector data (points, lines, polygons) used by GIS software. It is one piece of a set: it needs its sibling files (.shx, .dbf, and…
Open .SHP details →A .gml file is a Geography Markup Language file - an XML format defined by the Open Geospatial Consortium (OGC) for storing map and GIS data such as points, lines, polygons, and coordinate…
Open .GML details →Quality & what to watch
- Both QGIS and ogr2ogr produce a companion
.xsdschema file alongside the.gml; some systems require both files - do not delete the.xsd. - GML is XML and the output file can be significantly larger than the source Shapefile - sometimes 10x for large datasets; GeoJSON is a more compact alternative for web use.
- The
.prjsibling file must be present for the coordinate reference system to transfer correctly; without it, the GML will have no spatial reference defined.
Frequently asked questions
Do I need all the Shapefile sibling files for the conversion?
.shp, .shx, and .dbf are required; without .dbf the output GML will have no attributes, and without .prj the coordinate system will be undefined.Will the conversion satisfy INSPIRE GML requirements?
Can I reproject the Shapefile to WGS 84 during conversion?
-t_srs EPSG:4326 to the ogr2ogr command, or set the target CRS in QGIS before exporting.