MapServer Features by Example
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Number of Parts | 266 | |
Author | ||
License | CC Attribution 3.0 Germany: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/66470 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
FOSS4G Prizren Kosovo 2023129 / 266
10
17
23
44
45
46
47
48
49
50
52
53
80
84
85
91
110
116
129
148
164
167
169
173
174
181
182
183
186
187
199
202
204
206
209
215
241
248
265
00:00
Compass (drafting)Raster graphicsVector spaceLevel (video gaming)Social classAxonometric projectionParsingRevision controlFunction (mathematics)Artistic renderingDuality (mathematics)Demo (music)Computer fileNumberServer (computing)Open sourceGeometryAttribute grammarLevel (video gaming)Text editorOpen setSocial classFunction (mathematics)Block (periodic table)Presentation of a groupGraphical user interfaceStandard deviationRevision control1 (number)Configuration spaceObject (grammar)Right angleFormal languageDifferent (Kate Ryan album)Projective planeDomain nameCodeVideoconferencingLatent heatSlide ruleMathematicsWeb pageData dictionaryProblemorientierte ProgrammierspracheComputer animation
04:49
Raster graphicsDiscrete element methodSource codeActive contour modelConfiguration spaceGamma functionData typeRange (statistics)Function (mathematics)PixelFile formatLevel (video gaming)MappingFunctional (mathematics)CASE <Informatik>SatelliteComputer fileTesselationType theoryActive contour modelDifferent (Kate Ryan album)Source codeShape (magazine)Set (mathematics)Mobile appPixelRaster graphicsServer (computing)MathematicsComputer fontGraph coloringDialectVector spaceConnected spaceBlock (periodic table)Range (statistics)Standard deviationArtistic renderingMetreFunction (mathematics)Configuration spaceMathematical analysisFile formatFlow separationDatei-ServerBitBasis <Mathematik>Video game consoleMaxima and minimaXMLDiagramLecture/Conference
09:49
Source codeVariety (linguistics)Web 2.0Repository (publishing)
10:06
Digital filterConfiguration spaceRange (statistics)Attribute grammarLine (geometry)Axonometric projectionArtistic renderingElectronic mailing listSource codeBitBlock (periodic table)Range (statistics)Server (computing)Computer fileGraph coloringLine (geometry)Different (Kate Ryan album)Client (computing)Level (video gaming)EmailMaxima and minimaFunctional (mathematics)Computer configurationComputer fontSound effectPhysical systemBuffer solutionConfiguration spaceMobile appGeometrySpacetimeSet (mathematics)PixelFile formatData conversionInterface (computing)Reading (process)Uniform resource locatorCASE <Informatik>IdentifiabilityProjective planeWeb 2.0Pie chartAngleFilter <Stochastik>AreaPoint (geometry)Dynamical systemDevice driverRevision controlRemote procedure callCurvatureDistanceSymbol tableMappingDialectMusical ensembleRaster graphicsLecture/Conference
15:15
Discrete element methodData typeSource codeSmoothingVector spaceAlgorithmAverageComputer configurationForm (programming)File formatMean value theoremSocial classRepository (publishing)Function (mathematics)String (computer science)Connected spaceElectronic mailing listServer (computing)Revision controlFile formatStandard deviationVector spaceLevel (video gaming)Computer filePower (physics)Functional (mathematics)Service (economics)TesselationBlock (periodic table)Food energyType theoryPolygonLine (geometry)AlgorithmTransformation (genetics)CodeSet (mathematics)Category of beingQuicksortLibrary (computing)CASE <Informatik>Formal languageSocial classCuboidPoint cloudSmoothingGeometryFunction (mathematics)Range (statistics)Source codeVirtualizationParameter (computer programming)Single-precision floating-point formatDifferent (Kate Ryan album)Computer configurationClient (computing)Pie chartGraph coloringMultiplication signGraphical user interfaceComputer animationXMLLecture/Conference
20:23
Computer animation
Transcript: English(auto-generated)
00:08
Thanks Astrid. Hi, hi everyone. So thanks for the introduction. So yeah, my name's Seth and yeah, I've been working with MapServer for about 15 years and then a contributor for about 9 or 10 now So just to get an idea of who's who's in the room has anyone used MapServer?
00:26
Okay, great. And is there anyone who doesn't know who's never heard of MapServer before? Okay, guess I can I can speed through some of the slides at the beginning then So yeah, the this presentation is is It's gonna be about features that are already in MapServer. There's a lot of stuff in MapServer that people might not know about
00:45
so it's not necessarily new stuff, but it's stuff that yeah, but it's good to show is there and I'm gonna be showing it using examples. So MapServer is driven from from map files. So these are kind of text configuration files
01:00
So I'll be showing lots of examples of what you can do with with map files So yeah, MapServer is is used for serving out data So it's server-side and serves out spatial data to clients. So yeah, very similar to geo server And yeah, it's been around for for a number of years. So the version one was in released in 1997
01:23
It's open source It's a founding OS geo project and it covers a lot of the well covers all the OGC standards the Kind of the traditional ones WMS and WFS and now in version 8 and MapServer It's got the OGC features API and hopefully there's going to be work on More of the OGC and more of the new API is implemented in MapServer
01:46
So yeah map files are the the heart of MapServer so everything is is configured using map files There's been a number of kind of graphical user interfaces that have come and gone over the years, but the the map file remains It moved to XML for a while, but that kind of came and went as well
02:02
So yeah map files are kind of written in a domain specific language, but it's quite human readable It looks like XML without all of all of the tags So yeah, this is kind of an example of a map file. So they start with it's it's in blocks So the top level block is is a map block and then within your your map you have layers
02:25
So these are your layers of data So you can have multiple layers in your map file and then each layer you can class your data So classify the data split it up So based on on attributes and then each class can have a number of styles so you can you can style your data
02:44
So yeah, the the number of objects in a map file is there's not many it's it's kind of a nice simple language or configuration to learn so it kind of is there's the map at the top and then Yeah, there's lots of different blocks, but the layer one is the key one and as I say you can have multiple layers within a map file
03:04
And so yeah map files you can write them by hand in a text editor I guess most people probably copy and paste from an existing one and modify it as needed and Yeah, about seven or eight years ago I started working on a Python project called called map you file
03:20
Which basically you can pass a map file using Python and you can modify it using Python dictionaries, so it's very easy to Create new layers add new styles So you can create hundreds of layers. You can create hundreds of map files quickly, so you don't have to write it all by hand So yeah, that's an open source open source project Written in Python that if you're working with lots of map files
03:44
It's it's quite handy and And more recently I've Kind of made a new a new project called map server studio, and this is kind of map you file online so kind of a hosted version and The idea is to to try and make it easier to learn how to use map server and map files
04:04
So you can you can create your map files online and then there's an open layers viewer on the other side of the page And you can you can render your you can use map server to render your open layers output So yeah, that's that's what it looks like so it's it's free to use
04:21
You have your map file on the left you hit the hit the serve button And you should get the output on on the right so if you're starting out with map server It's hopefully a handy tool to try and learn what the different blocks and the codes do and there's I'm building up a number Examples most of which are going to feature in this in this talk
04:41
So yeah, there's there's a quick video so you can edit your map file on on the left and Then when you hit the the serve button at the top you see it see the changes so you see here You can change the the fonts the background the colors the rendering And obviously with the map file straight away you have all the OGC standards available So this is using WMS, but you can serve out the same data as WFS as vector tiles
05:06
OGC features API just by adding in different configurations to yours your map file Okay, so I'm gonna go the examples are divided into two raster and vector so map server handles handles both
05:20
So I'm gonna start with the the raster examples So the first one so this is a feature that's been around for for a while But I didn't know about it until I was playing her playing around looking for examples but you can take a raster layer and Just in your map file you can you can create contours on the fly so you can have your vector vector contour
05:43
layer generated by map server on the fly from from a geotiff or a DM so that's the the contour and In your map file, so it's it's got its own connection type Underneath it's all g-dial doing doing the work
06:00
But then you can you can drive it all using map files. So you set your connection type to contour You set your your data source, so this this is a TIFF so the tennis Copernicus DM and Then there's there's a couple of blocks and settings you can do so you choose the The item in the in the geotiff that you want to use for your elevation value
06:24
And then you can set the console interval So this would be 10 10 meter intervals so you can you can play around with those and you get different contour outputs So yeah, as I say the map server handles raster data Very well, so this example, it's
06:41
it's pulling down a satellite imagery directly from an s3 bucket and It's displaying the the names of the tiles and it's pulling that down from a shape file host on on github so this example is really to show kind of that you Don't have to to store your own data map servers kind of ready to take data from anywhere
07:04
So in this example and you can set up you can have an s3 bucket and you configure your access to it You can put it in your map file or you can have it in a separate configuration file On your server, which is a bit more bit more secure if it's a public bucket then obviously it's it's less of an issue
07:21
but you configure your access to the to the bucket and the layer is a type raster in this case and Then yeah, this is using the the G Del I'm not quite sure how to pronounce it, but the VSI VSI connection so you point it to your your buckets and the map server will will take that data and
07:42
Once you have yeah, you set your data connection, then you can use maps over to render it so this would all be done done dynamically and It's using a color ramp so it will take It will take a range of colors a starting color in an ending color and apply that to a data range So yeah, you can you can have your data hosted in s3 buckets and then render it all on the fly using using map server
08:08
And then a more advanced example, which I didn't know you could do until recently is to do some raster analysis dynamically in in your map file So in this case, it's taking two rasters and in this example, it's taking maximum temperatures
08:25
In June, I think in 1960 and 2020 And on the fly, it's calculating the difference between the the temperatures to create a new raster So this is all all done dynamically in using map server so again, it's a type the layer type is is raster and
08:45
then there's a big block and then Just in quotes in in the data block and this would be kind of the G Del The GDAL format and basically because GDAL is underneath map server all the functionality of GDAL can be can be driven through map server
09:02
So GDAL has pixel functions. So there's a set of inbuilt functions such as in this case It's the difference between pixel values So it's going to take the difference between the pixels and then it has two different rasters So two different sources and then it'll dynamically calculate the difference between the pixels so fairly standard raster analysis
09:26
But it's all done on the fly. And again, this this data can all be hosted in s3 buckets And then you can render that data data dynamically so you don't have to store your data on the same server You can you can point it at different data sources that might be updated on a regular basis
09:43
so there were the the raster examples and And yeah, I'm gonna go on to some of the the vector examples So this one Again, it's kind of to show that you can you can take data from a variety of sources anywhere on the web so there's a repository that has
10:03
Constellations star constellations are hosted on github So again, it's I'm using busy busy C URL so any It's a bit hidden The URL but in this case, it's a JSON file hosted on github so you can point it directly. It's a geo JSON file
10:21
to get your data source and then you can render that using map server and You can apply filters as well So you can actually filter the data before it gets to map server So the filter or maybe it's done in map server. You can filter the data that you're going to display And then once it's once the data is available to map server. You can you can style it however you want
10:41
So in this case this is a composite block and so you can have Applied different effects to your rendering. So in this case, it's kind of blurring to give the stars a kind of a blurry effect So yeah, and then you can style the rest of the the rest of the features You can have local data mixed in data from other sources
11:03
and recently there was work on flat your buffer support some apps of a you can read it using a native driver or Doge OGR driver So this this file is again coming over the web So it's the counters in the US and it's applying a color range similar to the to the rest for example
11:24
So again, it configured your access to the s3 buckets and then you can connect to a remote flat geo buffers file And the nice thing about map server is it can read all of these formats So any format that GDAL and OGR can can read map server can do the same
11:40
And you can also actually serve outs from map server in any of the formats as well so Was reading on the mailing list someone's actually using map server to serve out flat your buffers so you can use You can kind of use map server as an online kind of converter for GDAL as well all through a nice WFS interface so and so yeah for the for the styling of that that example
12:05
It's taking the an identifier and then setting a range of colors across a range of data Okay, so then yet map server has been around for a while. So there's lots of Cartographic options have have been built up over the years
12:21
so this example Shows hatching. So that's kind of the red the red diagonal effect on some of the areas of conflict and Then leader lines when you don't have space to put all your labels in one place So you have a line pointing to the the feature you want to label so means you can get more labels on your map
12:41
So yet these this functionality is being around for a while, but it's worth pointing out that it exists still So yet the hatch symbols you create a symbol in your map file And then it's a case of configuration in your layer You can have multiple styles so you can configure the the colors the angle how many lines?
13:01
Are used for the for the hatch and then for the lead lines and there's a leader block you can add to a class and And then you can configure that with a couple of settings So it tests where the next space is available for for a label So it tests every 40 pixels and then you can set the maximum distance that you don't get too far away from
13:24
From your feature and then you can style the the leader line as well as well So in this case, it's just a simple black line, but you could have dashed lines or you could have colored lines different thicknesses and This example is showing graticules
13:42
So this is kind of a grid you can put on top on top of your data as a kind of a reference so in this example, it's showing a Showing a polar projection and then the graticules are shown in in web Mercator so each of your layers can be in different projections and then your map can have a single projection a map server can
14:02
Reproject on the fly as much as you need and This data is is coming from a WMS another WMS server so map server is can serve out WMS but it's also a WMS client and for the the graticules you can set your projection and
14:22
Then again, you have a nice simple block So it's a grid block and you can set your your minimum interval and then the labels for your for your graticules And again yet for the for the labels you have you can set any fonts that you have available in your system
14:41
Again, there's lots of different settings for labels. You can have them kind of styled in blocks You can put buffers around them. You can have them following the lines following features Again, yet the the syntax there hopefully is quite self-explanatory But yeah, you probably have to go to the documentation to see what each of these each of these settings do
15:02
This example is showing dynamic pie charts. So this feature has been around I think 2015 So Yeah allows you to create charts spatially, so each of these points would be a spatial location and you can you can then read in your data and You can create pie charts. So in this case, it's showing the
15:23
energy uses energy usage broken down and And again, it's it's relying in this example. It's relying heavily on G Del. So there's a big block of G Del XML And let's see in your your connection and your data strings you can put in all sorts of
15:41
Complicated things to get what you want. So in this case, it's taking two layers so a country's layer and then a CSV file hosted on github and it's dynamically joining them together based on the country code and That's all done on the fly. And then once you have that data set up
16:01
You can use map server to to render the pie charts So yeah, this is a complicated example But it was just to kind of show the the range of things you can do with different data sources in map server and once you set up your data block Then there's a layer type of chart and you can set it to be a pie chart
16:21
And set the size and things and then you can use the classes to style the different colors and things on the pie chart This example is showing that you can smooth geometries on the fly So there's a smoothing algorithm So if you've got kind of jaggedy lake features, you can apply smoothing and at the layer level in map server
16:42
so they're kind of the blue the blue jaggedy line is the original feature and then there's a couple of settings you can do and then the Kind of light pink features are the smoothed version of the geometry So this this is a vector layer, so it's set to type polygon and
17:01
Then there's a Geom transform property and that can you can use if there's a few different functions available in this one It's using a smoothing algorithm so you can pass in a couple of parameters and play around with how smooth you want your your features to be rendered and Then this is the final vector example So map server can serve out vector tiles. So this is what it looks like unstyled in in open layers
17:27
And the following talk is going to be talking about geostyler So it's using that to have the same styling on the on the client side as the server side so yet map server you can set your output formats to anything that's available in gdell and
17:44
In this case, it's a map of extra tile output format You can style your data in the map file And then for your WMS then obviously map server will do the rendering But if you want your vector tiles to have the same styling and you can use geostyler to take your map file and convert it
18:03
Into the the map box styling format and then you can apply that in open layers You can also do dynamically because map server can serve out sld So you can take that and use the geostyler JavaScript library to style your map server vector data
18:20
So basically it means that you can have then the same styling available as a WMS layer and There's vector tile layers layers. So in this example here, it's An open layers map and it's switching between WMS and vector tiles and it has the same same styling for both so it allows you to write your styling once and apply it to both WMS service and and vector tiles. So yeah, that was those are the list of examples
18:49
So really the kind of the aim was to show that map server has lots of powerful functionality available Map files might seem scary at first if you want a nice
19:00
GUI to start start working away, but once you get used to them, they're they're very powerful because you can use libraries You can use your own whatever text templating libraries you have in whichever language to generate them and then they're nice and simple to deploy they can't go too wrong because it's just a text file and Yet fix map service been around for a while There's lots of powerful cartography options of have built up over the years
19:27
And yet as GDAL is is now a required dependency Yet map server takes takes full advantage of GDAL. So the whole virtual file formats all the clouds Cloud native data formats are all available to be read into map server
19:42
So then you can use yeah any data formats and then use map server to render it render them out And Then the nice thing is that all of the OGC standards are built in So if you're creating a WMS layer, it's it's kind of one more line to have WFS one more setting You can have vector tiles a couple more lines
20:01
You can have OGC features API and all that's kind of available in for a single single map file Okay, so that was hopefully gives you an idea some of some ideas to work with map server So yeah, thanks for your time and these are relevant