User:Damouns/orthographic maps

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Todo list: simplify and optimize File:Orthographic gradient.svg, and set up a procedure to generate orthographic projected svg maps of Category:Locator maps (green and grey globe scheme) with Natural Earth datasets.

Useful : en:Wikipedia:WikiProject Maps/Conventions/Orthographic maps

Method:

Get shapefiles from Natural Earth:

Choose a country and a latitude & longitude for the centre. Here I use FR (France) and 3°E, 46°N.

Use ogr2ogr to transform these shapefiles:

ogr2ogr -t_srs "+proj=ortho +lon_0=3.0 +lat_0=46.0" --config OGR_ENABLE_PARTIAL_REPROJECTION YES -explodecollections -skipfailures FR_ne_50m_admin_0_countries.shp ne_50m_admin_0_countries.shp
ogr2ogr -t_srs "+proj=ortho +lon_0=3.0 +lat_0=46.0" --config OGR_ENABLE_PARTIAL_REPROJECTION YES -explodecollections -skipfailures -where "ADMIN='France'" FRonly_ne_50m_admin_0_countries.shp ne_50m_admin_0_countries.shp
ogr2ogr -t_srs "+proj=ortho +lon_0=3.0 +lat_0=46.0" --config OGR_ENABLE_PARTIAL_REPROJECTION YES -explodecollections -skipfailures FR_50m-lakes.shp 50m-lakes.shp
ogr2ogr -t_srs "+proj=ortho +lon_0=3.0 +lat_0=46.0" --config OGR_ENABLE_PARTIAL_REPROJECTION YES -explodecollections -skipfailures FR_ne_50m_graticules_30.shp ne_50m_graticules_30.shp


Add to QGIS the personnalized projection "+proj=ortho +lon_0=3.0 +lat_0=46.0" and define it as the projection of the project.

Add the layers with these symbolizations:

  • countries: fill with gray (185 185 185), border in white (255 255 255), width 0.06
  • country layer: fill with green (52 103 51), border in white (255 255 255), width 0.06
  • graticules: black (0 0 0), width 0.03, transparence 53%
  • lakes: fill with white (255 255 255), no border

Print componer (copy this in a text file .qpt):

<Composer title="ExportSVG" visible="1">
 <ComposerMap keepLayerSet="false" id="0" previewMode="Cache" drawCanvasItems="true">
  <Extent ymin="-6378137" xmin="-6378137" ymax="6378137" xmax="6378137"/>
  <LayerSet/>
  <Grid gridStyle="0" crossLength="3" penColorRed="0" penColorBlue="0" intervalX="0" offsetX="0" intervalY="0" offsetY="0" show="0" penWidth="0" penColorGreen="0">
   <Annotation direction="0" precision="3" position="1" frameDistance="1" show="0" font="MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0"/>
  </Grid>
  <ComposerItem width="55" x="0" y="0" rotation="0" height="55" frame="false" outlineWidth="0.3" zValue="1" lastValidViewScaleFactor="4.375" positionLock="false">
   <FrameColor alpha="255" red="0" blue="0" green="0"/>
   <BackgroundColor alpha="255" red="255" blue="255" green="255"/>
  </ComposerItem>
 </ComposerMap>
 <Composition printResolution="254" paperWidth="55" snapGridOffsetX="0" snapGridResolution="0" snapGridOffsetY="0" snapping="0" paperHeight="55" printAsRaster="0"/>
</Composer>

Export in SVG.

Open the SVG with a text editor, change the width and height from "55mm" to "550" or "550px". Save it.

Open the SVG with Inkscape. Import from the template to have the gradient and the globe, and the small locator. Adjust the position.

Save as... Optimized SVG (*.svg) and choose the following:

  • Simplify colors
  • Styles in xml
  • Reduction of groups
  • Delete identifiers
  • Precision : 4
  • Indent : space

Edit svg to delete the 2 opaque white backgrounds and the grey one. Add a circle with white background behind all layers.