Skip to content

Commit 6fb8f79

Browse files
authored
Merge pull request #869 from geographika/mapserver-updates
MapServer QuickStart Updates
2 parents 62a0be8 + fe1eeca commit 6fb8f79

File tree

3 files changed

+105
-92
lines changed

3 files changed

+105
-92
lines changed

doc/quickstart/mapserver_quickstart.rst

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:Reviewer: Cameron Shorter, Jirotech
77
:Reviewer: Angelos Tzotsos, OSGeo
88
:Reviewer: Felicity Brand (Google Season of Docs 2019)
9+
:Reviewer: Seth Girvin
910
:Version: osgeolive13.0
1011
:License: Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
1112

@@ -22,7 +23,7 @@
2223

2324
MapServer is an `Open Source <https://opensource.org/>`_ server based
2425
application that allows you to publish geographic map images and vector data
25-
through the internet using |OGCS|
26+
through the Internet using |OGCS|
2627
such as |WMS|, |WFS| and |WCS|.
2728

2829
.. contents:: Contents
@@ -52,16 +53,17 @@ Creating my first Mapfile
5253

5354
#. Open any text editor (e.g. :menuselection:`Applications --> Accessories -->
5455
FeatherPad`).
55-
#. Create the file "mapserver_quickstart.map" in your home directory:
56+
#. Create the file "mapserver_quickstart.map" at the following location:
5657
:file:`/home/user/mapserver_quickstart.map`
5758

59+
5860
Put the following content in it::
5961

6062
MAP
6163
NAME "MAPSERVER_QUICKSTART"
6264
EXTENT -137 29 -53 88
6365
UNITS DD
64-
SHAPEPATH "/home/user/data/natural_earth2/"
66+
SHAPEPATH "/usr/local/share/data/natural_earth2/"
6567
SIZE 800 600
6668

6769
IMAGETYPE PNG24
@@ -93,10 +95,10 @@ Creating my first Mapfile
9395

9496
END
9597

96-
.. note::
98+
.. note::
9799

98-
The example uses the natural earth dataset, which is already on OSGeoLive at :file:`~/data/natural_earth2` (a short cut to
99-
:file:`/usr/local/share/data/natural_earth2`).
100+
The example uses the natural earth dataset, which is already on OSGeoLive at :file:`~/data/natural_earth2` (a short cut to
101+
:file:`/usr/local/share/data/natural_earth2`).
100102

101103
Each object in a Mapfile starts with its name (for example **MAP**) and ends
102104
with an **END**. A Mapfile always starts with the **MAP** object and should
@@ -109,7 +111,7 @@ Mapfile:
109111
* EXTENT: sets the default geospatial bounding box for this configuration.
110112
* LAYER: defines access and display properties for a spatial dataset. We'll
111113
add another layer later.
112-
* SHAPEPATH: sets a base path for file-based data (e.g. shapefiles or tiff
114+
* SHAPEPATH: sets a base path for file-based data (e.g. shapefiles or GeoTIFF
113115
images).
114116

115117
If we look closer at the **LAYER** in our Mapfile, we'll see that it
@@ -131,7 +133,6 @@ contains a bunch of properties and objects too. Among them are:
131133
<https://mapserver.org/mapfile/index.html>`_.
132134

133135

134-
135136
Render a map image with MapServer using a WMS **GetMap** request
136137
================================================================
137138

@@ -142,7 +143,7 @@ Render a map image with MapServer using a WMS **GetMap** request
142143

143144
Open a web browser and enter the following URL::
144145

145-
http://localhost/cgi-bin/mapserv?map=/home/user/mapserver_quickstart.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1&LAYERS=Countries&SRS=EPSG:4326&BBOX=-137,29,-53,88&FORMAT=PNG&WIDTH=800&HEIGHT=600
146+
http://localhost/cgi-bin/mapserv?map=/home/user/mapserver_quickstart.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1&LAYERS=Countries&STYLES=&SRS=EPSG:4326&BBOX=-137,29,-53,88&FORMAT=PNG&WIDTH=800&HEIGHT=600
146147

147148
What does the above mean? If we put it in simple words, it's a |WMS|
148149
**GetMap**
@@ -173,13 +174,12 @@ repetitive mapping, or while debugging.
173174
Open a terminal (:menuselection:`Applications --> System Tools --> Terminal
174175
Emulator`) and type::
175176

176-
shp2img -m mapserver_quickstart.map -o mymap.png
177+
map2img -m /home/user/mapserver_quickstart.map -o /home/user/Documents/mymap.png
177178

178179
If this command runs successfully, you are able to see your rendered map at
179180
file:///home/user/mymap.png.
180181

181182

182-
183183
Add a new layer to the Mapfile to serve a local Shapefile
184184
=========================================================
185185

@@ -211,7 +211,7 @@ Let's take our previous WMS **GetMap** request and add our new "Lakes" layer
211211
to the image rendered. We simply need to add the new layer name to the
212212
"LAYERS" property list::
213213

214-
http://localhost/cgi-bin/mapserv?map=/home/user/mapserver_quickstart.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1&LAYERS=Countries,Lakes&SRS=EPSG:4326&BBOX=-137,29,-53,88&FORMAT=PNG&WIDTH=800&HEIGHT=600
214+
http://localhost/cgi-bin/mapserv?map=/home/user/mapserver_quickstart.map&SERVICE=WMS&REQUEST=Getmap&VERSION=1.1.1&LAYERS=Countries,Lakes&STYLES=&SRS=EPSG:4326&BBOX=-137,29,-53,88&FORMAT=PNG&WIDTH=800&HEIGHT=600
215215

216216
The image rendered by MapServer looks like our previous map, but with the
217217
addition of the lakes from our new layer:
@@ -237,8 +237,8 @@ see the geometry and attribute definitions it contains. These attribute
237237
values can be used as a way to draw the elements inside a dataset
238238
differently using multiple CLASS objects.
239239

240-
In our "ne_10m_lakes" dataset, we have a *ScaleRank* attribute, which seems
241-
to be related to the size of the lakes. We can use this as a way to render
240+
In our "ne_10m_lakes" dataset, we have a *ScaleRank* attribute, which defines
241+
the significance of the lakes. We can use this as a way to render
242242
the lakes differently. In the LAYER object, we'll add another CLASS object
243243
just before our current one::
244244

@@ -318,6 +318,8 @@ few resources to check out next:
318318

319319
* Read the `Introduction to MapServer
320320
<https://mapserver.org/introduction.html#introduction>`_.
321+
* Run through the `Getting Started with MapServer workshop
322+
<https://geographika.github.io/getting-started-with-mapserver/>`_.
321323
* Have a look at the `MapServer Tutorial
322324
<https://www.mapserver.org/tutorial/index.html>`_ which contains more Mapfile
323325
examples.

locale/en/LC_MESSAGES/quickstart/mapserver_quickstart.po

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: OSGeoLive 14.0\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2024-09-26 14:03+0000\n"
11+
"POT-Creation-Date: 2024-10-17 14:10+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,37 +17,37 @@ msgstr ""
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"Generated-By: Babel 2.16.0\n"
1919

20-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:27
20+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:28
2121
msgid "MapServer Quickstart"
2222
msgstr ""
2323

24-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:29
24+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:30
2525
msgid ""
2626
"MapServer is an `Open Source <https://opensource.org/>`_ server based "
2727
"application that allows you to publish geographic map images and vector "
28-
"data through the internet using |OGCS| such as |WMS|, |WFS| and |WCS|."
28+
"data through the Internet using |OGCS| such as |WMS|, |WFS| and |WCS|."
2929
msgstr ""
3030

31-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:37
31+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:38
3232
msgid "Contents"
3333
msgstr ""
3434

35-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:40
35+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:41
3636
msgid "Configure MapServer using the Mapfile configuration file"
3737
msgstr ""
3838

39-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:44
39+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:45
4040
msgid ""
4141
"**What will I learn ?** In this section, you will learn what a Mapfile is"
4242
" and how to configure it to allow MapServer to serve a shapefile as "
4343
"images using WMS requests."
4444
msgstr ""
4545

46-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:49
46+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:50
4747
msgid "What is a Mapfile ?"
4848
msgstr ""
4949

50-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:51
50+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:52
5151
msgid ""
5252
"The `Mapfile <https://mapserver.org/mapfile/index.html>`_ is the "
5353
"configuration file that MapServer uses to render geospatial data as "
@@ -56,115 +56,115 @@ msgid ""
5656
"symbol, label, etc...)."
5757
msgstr ""
5858

59-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:57
59+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:58
6060
msgid "Creating my first Mapfile"
6161
msgstr ""
6262

63-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:59
63+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:60
6464
msgid ""
6565
"Open any text editor (e.g. :menuselection:`Applications --> Accessories "
6666
"--> FeatherPad`)."
6767
msgstr ""
6868

69-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:61
69+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:62
7070
msgid ""
71-
"Create the file \"mapserver_quickstart.map\" in your home directory: "
71+
"Create the file \"mapserver_quickstart.map\" at the following location: "
7272
":file:`/home/user/mapserver_quickstart.map`"
7373
msgstr ""
7474

75-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:64
75+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:66
7676
msgid "Put the following content in it::"
7777
msgstr ""
7878

79-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:104
79+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:106
8080
msgid ""
8181
"The example uses the natural earth dataset, which is already on OSGeoLive"
8282
" at :file:`~/data/natural_earth2` (a short cut to "
8383
":file:`/usr/local/share/data/natural_earth2`)."
8484
msgstr ""
8585

86-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:107
86+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:109
8787
msgid ""
8888
"Each object in a Mapfile starts with its name (for example **MAP**) and "
8989
"ends with an **END**. A Mapfile always starts with the **MAP** object "
9090
"and should contain a list of **LAYER** objects the Mapfile can read and "
9191
"draw. In our Mapfile, we currently have only one layer defined."
9292
msgstr ""
9393

94-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:112
94+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:114
9595
msgid ""
9696
"Let's take a look at some of the objects (and properties) defined in our "
9797
"Mapfile:"
9898
msgstr ""
9999

100-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:115
100+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:117
101101
msgid "EXTENT: sets the default geospatial bounding box for this configuration."
102102
msgstr ""
103103

104-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:116
104+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:118
105105
msgid ""
106106
"LAYER: defines access and display properties for a spatial dataset. "
107107
"We'll add another layer later."
108108
msgstr ""
109109

110-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:118
110+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:120
111111
msgid ""
112-
"SHAPEPATH: sets a base path for file-based data (e.g. shapefiles or tiff "
113-
"images)."
112+
"SHAPEPATH: sets a base path for file-based data (e.g. shapefiles or "
113+
"GeoTIFF images)."
114114
msgstr ""
115115

116-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:121
116+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:123
117117
msgid ""
118118
"If we look closer at the **LAYER** in our Mapfile, we'll see that it "
119119
"contains a bunch of properties and objects too. Among them are:"
120120
msgstr ""
121121

122-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:124
122+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:126
123123
msgid ""
124124
"STATUS: defines whether the layer can be drawn (*ON*), can't be drawn "
125125
"(*OFF*) or is always drawn (*DEFAULT*)."
126126
msgstr ""
127127

128-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:126
128+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:128
129129
msgid ""
130130
"TYPE: the geometry type that MapServer should use when rendering the data"
131131
" as an image. In our Mapfile, the data will be drawn as *polygons*."
132132
msgstr ""
133133

134-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:128
134+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:130
135135
msgid ""
136136
"DATA: the name of the spatial data file this layer uses, in this case a "
137137
"shapefile."
138138
msgstr ""
139139

140-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:130
140+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:132
141141
msgid ""
142142
"CLASS: determines how to draw a layer (styling). We'll cover this object "
143143
"in more detail later."
144144
msgstr ""
145145

146-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:135
146+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:137
147147
msgid ""
148148
"A complete list of the available objects and properties a Mapfile can "
149149
"have can be found in the `MapServer documentation page "
150150
"<https://mapserver.org/mapfile/index.html>`_."
151151
msgstr ""
152152

153-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:142
153+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:143
154154
msgid "Render a map image with MapServer using a WMS **GetMap** request"
155155
msgstr ""
156156

157-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:146
157+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:147
158158
msgid ""
159159
"**What will I learn ?** You will learn how to use to render an image with"
160160
" layers from a Mapfile with MapServer using an OGC WMS request."
161161
msgstr ""
162162

163-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:149
163+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:150
164164
msgid "Open a web browser and enter the following URL::"
165165
msgstr ""
166166

167-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:153
167+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:154
168168
msgid ""
169169
"What does the above mean? If we put it in simple words, it's a |WMS| "
170170
"**GetMap** request that tells MapServer to \"*use the following Mapfile "
@@ -175,31 +175,31 @@ msgid ""
175175
"*STATUS DEFAULT*. The result looks like the following:"
176176
msgstr ""
177177

178-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:167
178+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:168
179179
msgid ""
180180
"All parameters of the request are WMS-specific, except "
181181
"\"*?map=/home/user/mapserver_quickstart.map*\", which is MapServer-"
182182
"specific."
183183
msgstr ""
184184

185-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:173
185+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:174
186186
msgid "Render a map image with MapServer using the command line"
187187
msgstr ""
188188

189-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:175
189+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:176
190190
msgid ""
191191
"Although MapServer is geared towards web applications, it can also "
192192
"produce images on the command line. This can be useful if you are looking"
193193
" for repetitive mapping, or while debugging."
194194
msgstr ""
195195

196-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:179
196+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:180
197197
msgid ""
198198
"Open a terminal (:menuselection:`Applications --> System Tools --> "
199199
"Terminal Emulator`) and type::"
200200
msgstr ""
201201

202-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:184
202+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:185
203203
msgid ""
204204
"If this command runs successfully, you are able to see your rendered map "
205205
"at file:///home/user/mymap.png."
@@ -266,9 +266,9 @@ msgstr ""
266266
#: ../../build/doc/quickstart/mapserver_quickstart.rst:246
267267
msgid ""
268268
"In our \"ne_10m_lakes\" dataset, we have a *ScaleRank* attribute, which "
269-
"seems to be related to the size of the lakes. We can use this as a way to"
270-
" render the lakes differently. In the LAYER object, we'll add another "
271-
"CLASS object just before our current one::"
269+
"defines the significance of the lakes. We can use this as a way to render"
270+
" the lakes differently. In the LAYER object, we'll add another CLASS "
271+
"object just before our current one::"
272272
msgstr ""
273273

274274
#: ../../build/doc/quickstart/mapserver_quickstart.rst:271
@@ -362,20 +362,26 @@ msgstr ""
362362

363363
#: ../../build/doc/quickstart/mapserver_quickstart.rst:327
364364
msgid ""
365+
"Run through the `Getting Started with MapServer workshop "
366+
"<https://geographika.github.io/getting-started-with-mapserver/>`_."
367+
msgstr ""
368+
369+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:329
370+
msgid ""
365371
"Have a look at the `MapServer Tutorial "
366372
"<https://www.mapserver.org/tutorial/index.html>`_ which contains more "
367373
"Mapfile examples."
368374
msgstr ""
369375

370-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:330
376+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:332
371377
msgid ""
372378
"Check the `OGC Support and Configuration "
373379
"<https://www.mapserver.org/ogc/index.html>`_ to learn more about OGC "
374380
"standards in MapServer (WMS, WFS, SLD, WFS Filter Encoding, WCS, SOS, "
375381
"etc.)."
376382
msgstr ""
377383

378-
#: ../../build/doc/quickstart/mapserver_quickstart.rst:333
384+
#: ../../build/doc/quickstart/mapserver_quickstart.rst:335
379385
msgid ""
380386
"Ready to use MapServer? Then join the community on the `Mailing Lists "
381387
"<https://www.mapserver.org/community/lists.html>`_ to exchange ideas, "

0 commit comments

Comments
 (0)