-
Retalla: Layers clipping
This program allows you to clip IMG, JPG, WMS, and structured and not
structured vectors.
Clipping by envelope:
This program clips from an envelope (the coordinates (UTM, etc.) must be done in the clipping file units).
Clipping by mask:
This program clips from a polygonal object.
In files raster, the program extracts the window nearest to the requested
one and that wraps it completely.
In raster files, a clipping alternative way, more visual, is to use
MiraMon (File | Save as IMG/JPEG). In vectors, you can digitize a small file
that delimits the area and use it as clipping file.
With this module it is possible to save a clipping of a WMS server layer
(only the display part, equivalent to the GetMap request) or a
clipping of a WMTS server layer (the display part
equivalent to several GetTile requests or to several accesses to resources
RESTful from the layer display templates).
The WMS/WMTS layer to be clipped can be from any server that follows the
OGC WMS/WMTS standards (from the server URL) or it can be
any local server from the REL5 file (this last possibility
is much faster since the original tessellation of the layer can be taken directly). The result is always a REL5 and a layer prepared at different zoom levels. As in the other options, the clipping can be done by envelope or by mask
vector. When clipping is done by scope (option 1), and for each level of
zoom, the prepared pieces of the original layer that fall
totally or partially within the chosen scope are replicated. In the case of
irregular mask (option 2) the program replicates the minimum necessary number of
pieces, in addition, if a mask is provided, the areas external to the mask will be removed
(this last option adds a process that slows down obtaining the result).
Syntax:
- Retalla 1 InputFile OutputFile Xmin Xmax Ymin Ymax [/MULTIBANDA] [/PREFIX] [/TESSELLA_COMPLETA] [/PIRAMIDE_ZOOMS] [/NCOL_TESSELLA] [/NFIL_TESSELLA] [/TIPUS_CAPA] [/SERVICE_MD_URL] [/ID_CAPA_DEMANAR] [/TILE_MATRIX_SET] [/ALGORISME] [/SIMPLIFICA_VERTEXS]
- Retalla 2 InputFile OutputFile MaskFile [/COND#_FIELD] [/COND#_OP] [/COND#_VALOR] [/COND#_NEXE] [/COND#_PRIOR] [/MULTIBANDA] [/PREFIX] [/TESSELLA_COMPLETA] [/PIRAMIDE_ZOOMS] [/NCOL_TESSELLA] [/NFIL_TESSELLA] [/TIPUS_CAPA] [/SERVICE_MD_URL] [/ID_CAPA_DEMANAR] [/TILE_MATRIX_SET] [/ALGORISME] [/SIMPLIFICA_VERTEXS]
Options:
- 1:
The envelope to clip is indicated with MinX MaxX MinY and MaxY.
- 2:
The envelope to clip is indicated with an irregular mask MaskFile (only for vectorial and WMS/WMTS files). The external objects to the mask are eliminated.
Parameters:
- InputFile
(Input File -
Input parameter): Is the preexisting file to clip. This is the name of the REL 5 file in case of clipping WMS layers. In the case of clipping WMS layers from external servers it is a 'GetMap' request (which follows any of the versions of the standards), which at least includes the URL of the server application, the identifier of the layer to be clipped and its displaying style, the identifier of the reference system and the format in which the images are to be requested. (For example: http://www.maps.cat/MiraMon.cgi?VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:23031&LAYERS=MCSC&FORMAT=image/gif&TRANSPARENT=TRUE&STYLES=SEMITRANSPARENT). In the case of clipping a WMTS layer in GET/KVP, it is a 'GetTile0' request, which at least includes the URL of the server application, the identifier of the layer to be trimmed and its display style, the identifier of the cut pattern which follows the layer and the format in which the images should be requested. (For example: http://www.opengis.uab.es/cgi-bin/TiledWorld/MiraMon.cgi?VERSION=1.0.0&SERVICE=WMTS&REQUEST=GetTile&LAYER=AdminBoundaries&STYLE=default&FORMAT=image/png&TILEMATRIXSET=World84-90_90 .90). In the case of clipping WMTS layers in RESTful it is the URL template that allows access to the layer's display resources in the requested format; eg: www.opengis.uab.es/SITiled/world/AdminBoundaries/default/World84-90_CRS_84/{TileMatrix}/{TileRow}/{TileCol}.png. The gif and png formats are only supported in the clipping of WMS/WMTS layers.
- OutputFile
(Output File -
Output parameter): Is the name of the resulting clipped file. This is a directory in case of a multiband clipping. This is the name of a REL 5 file in case of WMS layers. (local and external servers).
- Xmin
(X minimum -
Input parameter): It is the X minimum coordinate of the output envelop. If these coordinates do not fit with the pixel grid defined by the first input image, they are adapted by excess.
- Xmax
(X maximum -
Input parameter): It is the X maximum coordinate of the output envelop. If these coordinates do not fit with the pixel grid defined by the first input image, they are adapted by excess.
- Ymin
(Y minimum -
Input parameter): It is the Y minimum coordinate of the output envelop. If these coordinates do not fit with the pixel grid defined by the first input image, they are adapted by excess.
- Ymax
(Y maximum -
Input parameter): It is the Y maximum coordinate of the output envelop. If these coordinates do not fit with the pixel grid defined by the first input image, they are adapted by excess.
- InputFile
(Input File -
Input parameter): Is the preexisting file to clip. This is the name of the REL 5 file in case of clipping WMS layers. In the case of clipping WMS layers from external servers it is a 'GetMap' request (which follows any of the versions of the standards), which at least includes the URL of the server application, the identifier of the layer to be clipped and its displaying style, the identifier of the reference system and the format in which the images are to be requested. (For example: http://www.maps.cat/MiraMon.cgi?VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:23031&LAYERS=MCSC&FORMAT=image/gif&TRANSPARENT=TRUE&STYLES=SEMITRANSPARENT). In the case of clipping a WMTS layer in GET/KVP, it is a 'GetTile0' request, which at least includes the URL of the server application, the identifier of the layer to be trimmed and its display style, the identifier of the cut pattern which follows the layer and the format in which the images should be requested. (For example: http://www.opengis.uab.es/cgi-bin/TiledWorld/MiraMon.cgi?VERSION=1.0.0&SERVICE=WMTS&REQUEST=GetTile&LAYER=AdminBoundaries&STYLE=default&FORMAT=image/png&TILEMATRIXSET=World84-90_90 .90). In the case of clipping WMTS layers in RESTful it is the URL template that allows access to the layer's display resources in the requested format; eg: www.opengis.uab.es/SITiled/world/AdminBoundaries/default/World84-90_CRS_84/{TileMatrix}/{TileRow}/{TileCol}.png. The gif and png formats are only supported in the clipping of WMS/WMTS layers.
- MaskFile
(Mask file -
Input parameter): Is the name of the file that defines an irregular polygon (only for WMS and vectorial layers). In this case, it is possible to indicate optionally a set of parameters that define the selection (for instance: /COND1_CAMP=). To know more about the values of these parameters continue the considerations of the general syntax document.
Modifiers:
/COND#_FIELD=
(Field of condition #)
Field name of # condition of selection. It may be made up to 100 simple queries and 100 field names (COND#_CAMP) starting at index 1. (Input parameter) /COND#_OP=
(Operation of condition #)
Opertation of # condition of selection. It may be made up to 100 simple queries and 100 operations (COND#_OP) starting at index 1. (Input parameter) /COND#_VALOR=
(Value of condition #)
Value of # condition of selection. It may be made up to 100 simple queries and 100 values (COND#_VALOR) starting at index 1. (Input parameter) /COND#_NEXE=
(Nexus linking of condition #)
Nexus to use for linking the successive selections. In this case to linking between condition # and condition #+1. It may be made up to 100 simple queries and 99 nexus (COND#_NEXE) starting at index 1. (Input parameter) /COND#_PRIOR=
(Priority of nexus linking of condition #)
Priority of nexus use to linking for the successive selections. In this case to linking between condition # and condition #+1. It may be made up to 100 simple queries and 99 priorities (COND#_PRIOR) starting at index 1. This is an optional parameter. If it is not indicated the priority is just the order. (Input parameter) /MULTIBANDA (Multiband raster) In the case that the raster file is part of a multiband raster, all the bands are clipped. (Input parameter) /PREFIX= (Raster bands prefix) In the case that the raster file is part of a multiband raster, it is necessary to indicate a prefix that will be used for the bands that will be generated in the output directory. It does not apply in the case of WMS/WMTS clipping or vector layers. (Input parameter) /TESSELLA_COMPLETA (TESSELLA_COMPLETA) This parameter is specific to WMS layers. In case of clipping of local layers (REL 5) only apply to irregular mask. In the case of external server layers, it applies to both types of clipping, by scope and by irregular mask; in case of clipping by scope, it serves to obtain all the tiles of the same size, making an excess cut if necessary. In the case of WMTS, complete tiles of the same size are always obtained, the tiles that remain outside the scope or of the irregular mask are masked to NoData value. So, in the case of WMTS there is no possibility to choose and this parameter does not apply. (Input parameter) /PIRAMIDE_ZOOMS (PIRAMIDE ZOOMS) List of zoom levels, separated by comma, in which the WMS layer of an external server is wanted to be obtained; or, list of identifiers of "tileMatrix", separated by comma, in which the WMTS layer is wanted to be obtained.
It is about building a pyramidal structure of tiles or fragments of the image, in which each level of the pyramid has the layer at a certain zoom level (or pixel size). In the case of WMS, this zoom level must be indicated in the units of the reference system in which the layer is being requested. The list should contain the most common zoom levels considering the scope of the layer and its resolution. In the case of WMTS, each tileMatrix has an associated zoom level. This parameter is mandatory for external WMS/WMTS servers and will not be indicated in all other cases. (Input parameter) /NCOL_TESSELLA= (NCOL TESSELLA) / NCOL_TESSELLA = (NCOL TESSELLA) Number of columns that each of the tiles requested from a WMS server must have in order to clip one of its layers. This parameter is mandatory for external WMS servers and should not be indicated in the other cases. This parameter does not apply in WMTS since the width of the tile is determined by the "TileMatrix". (Input parameter) /NFIL_TESSELLA= (NFIL TESSELLA) Number of rows that each of the tiles requested from a WMS server must have in order to clip one of its layers. This parameter is mandatory for external WMS servers and should not be indicated in the other cases. This parameter does not apply in WMTS since the high of the tile is determined by the "TileMatrix". (Input parameter) /TIPUS_CAPA=
(TIPUS CAPA)
Type of WMS/WMTS layer to clip. It will be indicated 'I' if it is an image, 'P' if it is a layer of polygons, 'L' if it is a layer of lines or 'S' if it is a layer of symbols. This parameter can only be indicated for clipping layers of external WMS/WMTS servers. All these layers are a pictorial representation (therefore they are in raster format) but the objects they represent can be of different types. This parameter is only written to the output REL5 file, without affecting the execution of the module. This parameter it is used for a better visualization when interpolations between the prepared zoom levels must be made. (Input parameter) /SERVICE_MD_URL= (SERVICE MD URL) URL of the service metadata. It only applies to the clipping of WMTS layers in RESTful, in this case it is mandatory since in this data there is the description of the cut pattern in which the layer has to be requested. (For example: /SERVICE_MD_URL=http://www.miramon.uab.cat/ogc/wmts/OSM/1.0.0/WMTSCapabilities.xml). (Input parameter) /ID_CAPA_DEMANAR= (ID CAPA DEMANAR) Identifier of the WMTS layer to request. It only applies to clipping WMTS layers in RESTful, in this case it is mandatory. (Input parameter) /TILE_MATRIX_SET= (TILE_MATRIX_SET) Identifier of the tileMatrixSet (or pattern of cuts) of the WMTS layer to request. It only applies to clipping WMTS layers in RESTful, in this case it is mandatory.(Input parameter) /ALGORISME=
(Algorisme) This parameter is used to determine the type of algorithm that the application will use to cut the vectors during topological structuring. - ESCOMBRATGE: based on the intersection of Bentley-Ottmann segments.
- DIRECTE: based on the exploration of all segments against all to determine the intersections between vectors in the topological structuring.
- AUTOMATIC: The program automatically decides which of the two algorithms will be used.
It only applies to vector files. (Input parameter) /SIMPLIFICA_VERTEXS (Simplifica vèrtexs) Simplify the intermediate vertices of the arcs, as long as this do not mean a change in the topology. (Input parameter)