MapML Formatter Plugin for pygeoapi
-
Install pygepapi
-
Copy
mapml.py
into pygeoapi/pygeoapi/formatter -
Add
'mapml'
to theFORMATS
array on line 79. -
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
-
Add
'MapML': 'pygeoapi.formatter.mapml.MapMLFormatter'
to the formatters array on line 55 in the pygeoapi/plugin.py file -
Build pygeoapi as you would before, now you can use
?f=mapml
to serve mapml features.