R/balises_qgis.R

balises_qgis <-
function(){
  canevas <- data.frame(V1=c('<!DOCTYPE qgis PUBLIC "http://mrcc.com/qgis.dtd" "SYSTEM">',
                                  '<qgis projectname="" version="2.8.5-Wien">',
                                  '<title></title>',
                                  '<mapcanvas>',
                                  '<units>meters</units>',
                                  '<extent>',
                                  '<xmin>XXXMIN</xmin>',
                                  '<ymin>YYYMIN</ymin>',
                                  '<xmax>XXXMAX</xmax>',
                                  '<ymax>YYYMAX</ymax>',
                                  '</extent>',
                                  '<projections>0</projections>',
                                  '\t\t<destinationsrs>',
                                  '<spatialrefsys>',
                                  '<proj4>PROJECTIONPROJET</proj4>',
                                  '</spatialrefsys>',
                                  '</destinationsrs>',
                                  '</mapcanvas>',
                                  '<legend updateDrawingOrder="false">',
                                  'BLOCLEGENDE',
                                  '</legend>',
                                  'BLOCCOMPOSER',
                                  '<projectlayers layercount="NOMBREDEFONDS">',
                                  'BLOCPROJECTLAYERS',
                                  '</projectlayers>',
                                  '</qgis>'))
  
  canevas_MEP <- data.frame(V1=c('<Composer title="MEP_NOMMEP" visible="1">',
                                      '<Composition printResolution="300" paperWidth="297" snapGridOffsetX="0" snapGridResolution="10" snapGridOffsetY="0" alignmentSnap="1" snapping="0" numPages="1" paperHeight="210" alignmentSnapTolerance="2" printAsRaster="0">',
                                      '<ComposerLabel valign="32" marginX="0" marginY="0" labelText="SSTIT" htmlState="0" halign="1">',
                                      '<LabelFont description="Arial 2,10,-1,5,50,0,0,0,0,0"/>',
                                      '<FontColor red="0" blue="0" green="0"/>',
                                      '<ComposerItem width="277" x="10" transparency="0" y="17" rotation="0" height="10.2606" positionMode="0" frame="false" outlineWidth="0.3" zValue="5" lastValidViewScaleFactor="3.36577" uuid="{18497c73-469f-4b55-a8e2-7f6d121e3d5c}" id="" background="false" blendMode="0" positionLock="false">',
                                      '<FrameColor alpha="255" red="0" blue="0" green="0"/>',
                                      '<BackgroundColor alpha="255" red="255" blue="255" green="255"/>',
                                      '</ComposerItem>',
                                      '</ComposerLabel>',
                                      '<ComposerLabel valign="32" marginX="0" marginY="0" labelText="copyright IGN-Insee AN" htmlState="0" htmlState="0" halign="4">',
                                      '<LabelFont description="Arial 2,10,-1,5,50,0,0,0,0,0"/>',
                                      '<FontColor red="0" blue="0" green="0"/>',
                                      '<ComposerItem pagey="102.681" page="1" id="" lastValidViewScaleFactor="-1" positionMode="3" positionLock="false" x="287" y="102.681" visibility="1" zValue="4" background="true" transparency="0" frameJoinStyle="miter" blendMode="0" width="45" outlineWidth="0.3" excludeFromExports="0" uuid="{c289f7e3-3867-4604-b919-f0424952ab2b}" height="6" itemRotation="90" frame="false" pagex="287">',
                                      '<FrameColor alpha="255" red="0" blue="0" green="0"/>',
                                      '<BackgroundColor alpha="255" red="255" blue="255" green="255"/>',
                                      '</ComposerItem>',
                                      '</ComposerLabel>',
                                      '<ComposerLabel valign="32" marginX="0" marginY="0" labelText="SOURCE" htmlState="0" halign="4">',
                                      '<LabelFont description="Arial 2,10,-1,5,50,0,0,0,0,0"/>',
                                      '<FontColor red="0" blue="0" green="0"/>',
                                      '<ComposerItem pagey="195.819" page="1" id="" lastValidViewScaleFactor="2.29858" positionMode="6" positionLock="false" x="10" y="195.819" visibility="1" zValue="3" background="false" transparency="0" frameJoinStyle="miter" blendMode="0" width="277" outlineWidth="0.3" excludeFromExports="0" uuid="{a3245887-fd21-4ce7-a608-b41ca3448592}" height="4.181" itemRotation="0" frame="false" pagex="10">',
                                      '<FrameColor alpha="255" red="0" blue="0" green="0"/>',
                                      '<BackgroundColor alpha="255" red="255" blue="255" green="255"/>',
                                      '</ComposerItem>',
                                      '</ComposerLabel>',
                                      '<ComposerLabel valign="32" labelText="TITRE" htmlState="0" halign="0" margin="0">',
                                      '<LabelFont description="Arial 2,14,-1,5,75,0,0,0,0,0"/>',
                                      '<FontColor red="0" blue="0" green="0"/>',
                                      '<ComposerItem width="277" x="10" transparency="0" y="10" rotation="0" height="9.97584" positionMode="0" frame="false" outlineWidth="0.3" zValue="6" lastValidViewScaleFactor="3.36577" uuid="{4e213bc9-08e0-4e1e-b1c0-a67086fc5d57}" id="" background="false" blendMode="0" positionLock="false">',
                                      '<FrameColor alpha="255" red="0" blue="0" green="0"/>',
                                      '<BackgroundColor alpha="255" red="255" blue="255" green="255"/>',
                                      '</ComposerItem>',
                                      '</ComposerLabel>',
                                      '<ComposerLegend symbolWidth="4" title="" boxSpace="2" splitLayer="0" equalColumnWidth="0" map="0" symbolHeight="4" wrapChar="" fontColor="#000000" columnSpace="2" columnCount="1">',
                                      '<styles>',
                                      '<style marginBottom="2" name="title" font="Arial 2,16,-1,5,50,0,0,0,0,0"/>',
                                      '<style marginTop="2" name="group" font="Arial 2,14,-1,5,50,0,0,0,0,0"/>',
                                      '<style marginTop="2" name="subgroup" font="Arial 2,12,-1,5,50,0,0,0,0,0"/>',
                                      '<style marginTop="2" name="symbol" font="Arial 2,8.25,-1,5,50,0,0,0,0,0"/>',
                                      '<style marginTop="2" marginLeft="2" name="symbolLabel" font="Arial 2,12,-1,5,50,0,0,0,0,0"/>',
                                      '</styles>',
                                      '<Model autoUpdate="1">',
                                      'BLOCLAYERITEM',
                                      '</Model>',
                                      '<ComposerItem width="60.6" x="12" transparency="0" y="130" rotation="0" height="63.4" positionMode="0" frame="false" outlineWidth="0.3" zValue="2" lastValidViewScaleFactor="3.36577" uuid="{7a2b6e79-76cb-4933-8068-9058342234a6}" id="" background="true" blendMode="0" positionLock="false">',
                                      '<FrameColor alpha="255" red="0" blue="0" green="0"/>',
                                      '<BackgroundColor alpha="255" red="255" blue="255" green="255"/>',
                                      '</ComposerItem>',
                                      '</ComposerLegend>',
                                      '<ComposerMap keepLayerSet="false" overviewFrameMap="-1" id="0" previewMode="Cache" drawCanvasItems="true">',
                                      '<overviewFrame overviewBlendMode="0" overviewFrameMap="-1" overviewInverted="false">',
                                      '<symbol alpha="0.3" type="fill" name="">',
                                      '<layer pass="0" class="SimpleFill" locked="0">',
                                      '<prop k="border_width_unit" v="MM"/>',
                                      '<prop k="color" v="255,0,0,255"/>',
                                      '<prop k="color_border" v="0,0,0,255"/>',
                                      '<prop k="offset" v="0,0"/>',
                                      '<prop k="offset_unit" v="MM"/>',
                                      '<prop k="style" v="solid"/>',
                                      '<prop k="style_border" v="no"/>',
                                      '<prop k="width_border" v="0.26"/>',
                                      '</layer>',
                                      '</symbol>',
                                      '</overviewFrame>',
                                      '<Extent ymin="YYYMIN" xmin="XXXMIN" ymax="YYYMAX" xmax="XXXMAX"/>',
                                      '<LayerSet/>',
                                      '<Grid gridStyle="0" crossLength="3" intervalX="0" offsetX="0" intervalY="0" offsetY="0" gridFrameStyle="0" gridFrameWidth="2" gridBlendMode="0" show="0">',
                                      '<symbol alpha="1" type="line" name="">',
                                      '<layer pass="0" class="SimpleLine" locked="0">',
                                      '<prop k="capstyle" v="flat"/>',
                                      '<prop k="color" v="0,0,0,255"/>',
                                      '<prop k="customdash" v="5;2"/>',
                                      '<prop k="customdash_unit" v="MM"/>',
                                      '<prop k="joinstyle" v="bevel"/>',
                                      '<prop k="offset" v="0"/>',
                                      '<prop k="offset_unit" v="MM"/>',
                                      '<prop k="penstyle" v="solid"/>',
                                      '<prop k="use_custom_dash" v="0"/>',
                                      '<prop k="width" v="0.3"/>',
                                      '<prop k="width_unit" v="MM"/>',
                                      '</layer>',
                                      '</symbol>',
                                      '<Annotation rightDirection="0" bottomDirection="0" format="0" topPosition="1" precision="3" leftDirection="0" rightPosition="1" bottomPosition="1" frameDistance="1" show="0" font="Arial 2,8.25,-1,5,50,0,0,0,0,0" leftPosition="1" topDirection="0">',
                                      '<fontColor red="0" blue="0" green="0"/>',
                                      '</Annotation>',
                                      '</Grid>',
                                      '<ComposerItem width="277" x="10" transparency="0" y="22" rotation="0" height="168" positionMode="0" frame="false" outlineWidth="0.3" zValue="1" lastValidViewScaleFactor="3.36577" uuid="{1aac5ac9-b6b7-4dfd-a5e7-383ac82c2309}" id="" background="true" blendMode="0" positionLock="false">',
                                      '<FrameColor alpha="255" red="0" blue="0" green="0"/>',
                                      '<BackgroundColor alpha="255" red="255" blue="255" green="255"/>',
                                      '</ComposerItem>',
                                      '</ComposerMap>',
                                      '</Composition>',
                                      '</Composer>'))
  
  bloc_leg <- data.frame(V1=c(        '<legendlayer drawingOrder="-1" open="true" checked="Qt::Checked" name="NOMDELACOUCHE" showFeatureCount="0">',
                                      '<filegroup open="true" hidden="false">',
                                      '<legendlayerfile isInOverview="0" layerid="ID_COUCHE" visible="1"/>',
                                      '</filegroup>',
                                      '</legendlayer>'
  ))
  
  blocprojectlayers <- data.frame(V1=c(        '<maplayer minimumScale="0" maximumScale="1e+08" geometry="GEOMETRIE" type="vector" hasScaleBasedVisibilityFlag="0">',
                                               '<id>IDCOUCHE</id>',
                                               '<datasource>CHEMINCOUCHE</datasource>',
                                               '<layername>NOMDELACOUCHE</layername>',
                                               '<srs>',
                                               '<spatialrefsys>',
                                               '<proj4>PROJECTIONDELACOUCHE</proj4>',
                                               '</spatialrefsys>',
                                               '</srs>',
                                               '<transparencyLevelInt>255</transparencyLevelInt>',
                                               '<provider encoding="latin1">ogr</provider>',
                                               '<vectorjoins/>',
                                               '<renderer-v2 ATTR symbollevels="0" type="TYPEANALYSE">',
                                               'BLOCCATEGORIES',
                                               '<symbols>',
                                               'BLOCSYMBOLS',
                                               '</symbols>',
                                               '<rotation field=""/>',
                                               '<sizescale field="" scalemethod="area"/>',
                                               '</renderer-v2>',
                                               '<customproperties/>',
                                               '<displayfield></displayfield>',
                                               '</maplayer>'))
  
  blocsymbolsPolygon <- data.frame(V1=c(                    '<symbol alpha="1" type="fill" name="NAME">',
                                                            '<layer pass="0" class="SimpleFill" locked="0">',
                                                            '<prop k="border_width_unit" v="MM"/>',
                                                            '<prop k="color" v="COULEURFOND"/>',
                                                            '<prop k="color_border" v="COULEURBORDURE"/>',
                                                            '<prop k="offset" v="0,0"/>',
                                                            '<prop k="offset_unit" v="MM"/>',
                                                            '<prop k="style" v="REMPLISSAGEFOND"/>',
                                                            '<prop k="style_border" v="STYLEBORDURE"/>',
                                                            '<prop k="width_border" v="EPAISSEURBORDURE"/>',
                                                            '</layer>',
                                                            '</symbol>'
  ))
  
  blocsymbolsPoint <- data.frame(V1=c(                    '<symbol alpha="1" type="marker" name="0">',
                                                          '<layer pass="0" class="SimpleMarker" locked="0">',
                                                          '<prop k="angle" v="0"/>',
                                                          '<prop k="color" v="0,0,0"/>',
                                                          '<prop k="color_border" v="0,0,0"/>',
                                                          '<prop k="name" v="circle"/>',
                                                          '<prop k="offset" v="0,0"/>',
                                                          '<prop k="offset_unit" v="MM"/>',
                                                          '<prop k="outline_width" v="0"/>',
                                                          '<prop k="outline_width_unit" v="MM"/>',
                                                          '<prop k="scale_method" v="area"/>',
                                                          '<prop k="size" v="2"/>',
                                                          '<prop k="size_unit" v="MM"/>',
                                                          '</layer>',
                                                          '</symbol>'
  ))
  
  blocsymbolsLine <- data.frame(V1=c(                    '<symbol alpha="1" type="line" name="NAME">',
                                                         '<layer pass="0" class="SimpleLine" locked="0">',
                                                         '<prop k="capstyle" v="square"/>',
                                                         '<prop k="color" v="COULEURBORDURE"/>',
                                                         '<prop k="customdash" v="5;2"/>',
                                                         '<prop k="customdash_unit" v="MM"/>',
                                                         '<prop k="joinstyle" v="bevel"/>',
                                                         '<prop k="offset" v="0"/>',
                                                         '<prop k="offset_unit" v="MM"/>',
                                                         '<prop k="penstyle" v="STYLEBORDURE"/>',
                                                         '<prop k="use_custom_dash" v="0"/>',
                                                         '<prop k="width" v="EPAISSEURBORDURE"/>',
                                                         '<prop k="width_unit" v="MM"/>',
                                                         '</layer>',
                                                         '</symbol>'
  ))
  
  bloccategories <- data.frame(V1=c(                    '<category symbol="SYMBOL" value="VALUE" label="LABEL"/>'))
  
  bloclayerItem <- data.frame(V1=c('<LayerItem layerId="ID_COUCHE" userText="NOMDELACOUCHE" style="STYLELEG" text="NOMDELACOUCHE" showFeatureCount="0">',
                                   'BLOCVECTORCLASSIFICATION',
                                   '</LayerItem>'))
  
  blocvectorClassification <- data.frame(V1=c(                        '<VectorClassificationItemNg userText="" text="TEXT">',
                                                                      '<symbols>',
                                                                      'BLOCSYMBOLS',
                                                                      '</symbols>',
                                                                      '</VectorClassificationItemNg>'))

  return(list(canevas,canevas_MEP,bloc_leg,blocprojectlayers,blocsymbolsPolygon,blocsymbolsPoint,blocsymbolsLine,bloccategories,bloclayerItem,blocvectorClassification))
}

Try the oceanis package in your browser

Any scripts or data that you put into this service are public.

oceanis documentation built on July 5, 2019, 5:03 p.m.