Export created product as a map (image)

I would like to create maps which contains created product and some shapefiles (for example rivers) using Python script.
It would be nice to have such things as north arrow, scale or coordinates, but if it will be not possible, I will try to handle it.

As I can see there’s an option within the interface which allows to export view to image:

And even in different thread @antonio19812 provided some example of Python code for saving image (http://forum.step.esa.int/t/create-and-save-rgb-images-from-3-bands)

However, as I can see I have an option of importing vector data in shapefile format blocked:

Since that, I wonder if it will be even possible to create such map.

For doing this there is not jet a good API.
But we will consider this for the further development.

Probably this thread will help you:

It’s about Java but probably you can also use the information for Python.

With the org.esa.s1tbx.dat.layers.maptools.MapToolsLayer you can add a layer which can display a North Arrow

@marpet Thank you for response. Since you told me that there’s no good API for displaying maps,
I wrote a small function in Python which calls GDAL:

It works for small files (for example SMOS L3) - I am able to save map as an .png image.
However, there are some some crucial limitations (maybe you could suggest solution).

Issues:

  1. I am unable to plot big data (for example Sentinel file) - I guess that it is because of the following line which loads whole data set to memory (MemoryError):
    data = gdata.ReadAsArray()
  • I use ‘data’ only in one place - providing ‘data.T’ as parameters. Maybe there’s another way to do that?
    there are no coordinates displayed

  • I’m not sure how to add another shapefile. I think that it will be more correct to provide ‘shapefile’ as an array of shapefiles (path to shapefiles) and similarly to provide ‘raster’ as an array of raster file paths.

  • there’s a big, white border