I was provided with a INTERLIS 2.3 model as .ili file, and nothing else.

As far as I understand it, I should:

  • create a .imd meta file using ili2c.jar or the interlis Import/Export plugin by Pirmin Kalberer, i.e. the "Ili Model -> IlisMeta" tool
  • export an XML-file from the meta file (i.e. .xtf or .xml), encapsulating the data structure but no content yet using ili2pg.jar
  • import this structure into a postgreSQL / PostGIS database
  • create shapefiles (point, line, and polygon) using ogr2ogr.jar, which are (probably) already linked to the PostGIS DB
  • create the features (i.e., points, lines, polygons) and
  • use QGIS forms to fill the linked database with attributes

I already fail at the first point. Java delivers a .NullPointerException, and the plugin doesn't create any output without a warning or an error.

How do I produce the necessary files properly?

I'm completely new to INTERLIS, and might have misunderstood some concepts, but would be happy if someone could point me to the right ressources to get to productive GIS layers from an .ili file. I'm running QGIS 2.14.8-Essen (LTR), and the INTERLIS model in question is not (yet) published.

  • Since noone comments or answers to this question: I ended up creating three shapefiles (points, lines, polygons) with the attributes as described in the .ili file (but I can't have text fields >255 chars, as specified in the model). I furthermore created and added tables without geometries to populate the attribute table using value relations via foreign keys.
    – aae
    Commented May 9, 2017 at 11:46
  • You should post your comment as an answer and accept it :)
    – Joseph
    Commented Jun 29, 2017 at 9:34
  • @Joseph, it's a crude workaround, not really an answer. I don't like it, and I already lost data due to the field length problem. But its as far as I got.
    – aae
    Commented Jul 4, 2017 at 11:41

1 Answer 1


Check at https://github.com/claeis/ili2db its a tool to import/export/create db schemas from interlis files to relational databases like postgres.

After import your *.ili model into the PostGIS DB you can use QGIS to edit and fill your DB

Another solution is to use https://github.com/AgenciaImplementacion/projectgenerator Currently only works for QGIS 2.99 under development!

  • Thank you, that looks quite promising! If anybody tries, please leave comments / a minimal example, so I can accept the answer. (I hope I'll find the time to try this soon, right now I'm struggling with other issues arising from not having created a proper PostGIS / SpatiaLite DB and fell back to simple shapefiles. )
    – aae
    Commented Jul 27, 2017 at 8:06

Your Answer

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

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