% Template GRASS newsletter - Article
% Language: Latex
%

% Head

\title{The GRASS user-map}
\author{by Stephan Holl}

\maketitle

% Short description from the GRASS User-map
%
% Stephan Holl <stephan.holl@intevation.de>
% July 2006, October 2006
%
%
%
\section{GRASS User-map}

Like nearly all Open Source GIS projects GRASS now also has an usermap.
From the very beginning of the usermap in March 2006 it now 
has about 736 worldwide users marked on it (and the number of points are constantly growing...).

The idea behind this is creating a map with all spatially distributed GRASS
users in the world in one map.
Furthermore, the GRASS project wants to be collaborative with other
GIS-related OSS projects like QGIS, MapBender, MapServer etc.
Their usermaps are included using OGC services.

You can reach the usermap using this URL and create yourself a point on
the map: \url{http://maps.gdf-hannover.de/grassusers/}

\subsection{Technical details}
Not surprisingly the usermap is consequently set up with Free software. The basis
is built on top of Debian GNU/Linux using PostgreSQL/PostGIS for data storage.

The rendering is done by UMN MapServer while the client is a stripped down
pmapper1-client.

\begin{figure}[H]
\label{fig:usermap}
\caption{Worldwide usermap}
\includegraphics[clip=true, width=\textwidth]{images/usermap}
\end{figure}

Backdrop data is pulled from various OGC services. The following list of data services
is currently implemented.
If your OSS GIS project is not listed below, feel free to contact us.
\begin{itemize}
\item JPL BLue Marble WMS-Worlddata and US Landsat-Satellite data
\item PostGIS-based point layer with the GRASS-users.
\item QGIS-usermap as WFS
\item MapBender-usermap as WMS
\item MapServer-usermap as WFS
\item State Boundaries from \\
 \url{http://mappinghacks.com/data/} imported in our own PostGIS-DB 
\end{itemize}

\subsection{How to enter}
 Marking yourself on the map is very easy. Just use this button \includegraphics[clip=true, width=0.5cm]{images/insertbutton} 
 and fill in the form given in fig. \ref{fig:howtoenter}.

\begin{figure}[H]
\label{fig:howtoenter}
\centering
\caption{Enter yourself to the map}
\includegraphics[clip=true, width=0.25\textwidth]{images/insertyourself}
\end{figure}

\noindent After choosing 'Insert your point' the map will be updated and your point
is shown.\\
At a deeper zoom stage you can see your point labelled with your name.

%
%
%
\subsection{GRASS users as OGC WMS/WFS services}
As the GRASS usermap makes heavy use of OGC services to pull backdrop maps from
other servers, the software offers the GRASS users as WMS/WFS data as well.


\noindent The following URLs grab the \textsf{GetCapabilities} from the GRASS user WMS- and WFS-server:
\begin{verbatim}
# grab WFS GetCapabilities
http://maps.gdf-hannover.de/cgi-bin/
grassuserwfs?REQUEST=GetCapabilities\
&SERVICE=WFS&VERSION=1.0.0

# grab WMS GetCapabilities
http://maps.gdf-hannover.de/cgi-bin/
grassuserwms?REQUEST=GetCapabilities\
&SERVICE=WMS&VERSION=1.0.0
\end{verbatim}

Therefore it is easy to use the GRASS usermap in your WMS/WFS client of your choice
as a separate layer. Additional attribute data is served through a WFS service.

%
% creating other stuff with the datastorage
%
\section{Use the data in GRASS}
GRASS GIS does not have a WFS reader itself (it is not difficult to write a script v.in.wfs though), but with the following tool-chain you can easily
import the GRASS users into your location.

\begin{figure}[H]
\label{fig:kernel1}
\caption{Kernel-density-map of worldwide GRASS-users. The gradient ranges from red over yellow to blue for high to low density. Yellow dots indicate the location of single users.}
\includegraphics[clip=true, width=\textwidth]{images/world_kernel}
\end{figure}

\subsection{Import}
Note that the WFS-server only offers the LatLon-projection (EPSG:4326) as seen in the GetCapabilities document queries earlier.

Assuming the we already have a LatLon-location set up we can import the data very easily.
There are only two steps needed to fetch the actual GRASS users from the WFS and use the resulting points as GRASS-vectors:
\begin{enumerate}
\item query the WFS servers and save the resulting GML file into a temporary file
\item import the temporary file into GRASS (using v.in.ogr)
\end{enumerate}






\begin{verbatim}
# use curl to get GML from the server
curl -o /tmp/grass_users 
"http://maps.gdf-hannover.de/\cgi-bin/
grassuserwfs?REQUEST=GetFeature&
Typname=grass_users\
&SERVICE=WFS&VERSION=1.0.0"
   
# import into GRASS
v.in.ogr --o in=/tmp/grass_users 
out=GRASS_users
\end{verbatim}

Note that we need to apply the --o-switch since the resulting GML file does not provide useful projection information.

\subsection{Generate hot-spots of GRASS-users}
To show where the GRASS user hot-spots are located we can calculate the kernel-density using the GRASS-module \texttt{v.kernel}.

\begin{verbatim}
# use standard deviation of 1
v.kernel -v in=GRASS_users out=kernel_stdd1 
stddeviation=1

# set 0 to NULL
r.null map=kernel_stdd1 setnull=0

\end{verbatim}



This module creates a raster file called kernel\_stdd1, which is shown in figure \ref{fig:kernel1} and for a subset of Europe in figure \ref{fig:kernel2}
For a better visualisation you can add any other dataset you like. Here we have chosen the free world-data available from \url{http://www.mappinghacks.com/data/admin98.zip}.


\begin{figure}[H]
\label{fig:kernel2}
\caption{Kernel-density-map of GRASS-users in Europe. The gradient ranges from red over yellow to blue for high to low density. Dots indicate a single user.}
\includegraphics[clip=true, width=\textwidth]{images/europe_kernel}
\end{figure}


\section{Conclusion}
Having this described in short you can see that GRASS is currently mainly used by Europeans.
Feel free to add yourself and play around with the data of the usermap.

Have fun!

\section{Literature and links}
\begin{itemize}
\item Pmapper \url{http://www.pmapper.sourceforge.net}
\item Debian GNU/Linux \url{http://www.debian.org}
\item PostgreSQL \url{http://www.postgresql.org}
\item PostGIS \url{http://postgis.refractions.net}
\item UMN MapServer \url{http://mapserver.umn.edu}
\item Mapping Hacks \url{http://www.mappinghacks.com}
\end{itemize}



\address{Stephan Holl\\
Intevation GmbH\\
Osnabrück\\
 \url{http://www.intevation.de}\\
  \email{stephan.holl@intevation.de}}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: main_document.tex
%%% End:
