Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.19 KB

README.md

File metadata and controls

27 lines (20 loc) · 1.19 KB

pygeoapi-mapml-formatter

MapML Formatter Plugin for pygeoapi

Installation

  1. Install pygepapi

  2. Copy mapml.py into pygeoapi/pygeoapi/formatter

  3. Add 'mapml' to the FORMATS array on line 79.

  4. Copy the below snipping into lines 1090 and 1248 of pygeoapi/api.py. Appending to the existing if else if blocks,

    elif format_ == 'mapml':
      formatter = load_plugin('formatter', {'name': 'MapML', 'geom': True})
      content = formatter.write(
          data=content,
          options={}
      )
    
      headers_['Content-Type'] = '{}; charset={}'.format(
          formatter.mimetype, self.config['server']['encoding'])
    
      return headers_, 200, content
  5. Add 'MapML': 'pygeoapi.formatter.mapml.MapMLFormatter' to the formatters array on line 55 in the pygeoapi/plugin.py file

  6. Build pygeoapi as you would before, now you can use ?f=mapml to serve mapml features.