<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FJohnCox</id>
	<title>GRASS-Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FJohnCox"/>
	<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/wiki/Special:Contributions/%E2%9A%A0%EF%B8%8FJohnCox"/>
	<updated>2026-04-18T07:52:29Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Country_Data_Processing&amp;diff=17621</id>
		<title>Country Data Processing</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Country_Data_Processing&amp;diff=17621"/>
		<updated>2013-02-01T09:33:55Z</updated>

		<summary type="html">&lt;p&gt;⚠️JohnCox: /* GRASS Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This tutorial describes how to&lt;br /&gt;
* find free data of country on Internet&lt;br /&gt;
* create new GRASS location&lt;br /&gt;
* import found data into GRASS&lt;br /&gt;
* create new vector layers from existing data&lt;br /&gt;
* create labels&lt;br /&gt;
* display map of a country&lt;br /&gt;
&lt;br /&gt;
= GRASS Installation =&lt;br /&gt;
Required elements&lt;br /&gt;
* GRASS GIS 6.2.2 system installed&lt;br /&gt;
* download SPEARFISH data http://grass.itc.it/sampledata/spearfish_grass60data-0.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
Create directory structure required for this tutorial&lt;br /&gt;
* dataset directory&lt;br /&gt;
   $ mkdir ~/grass&lt;br /&gt;
* input data directory&lt;br /&gt;
   $ mkdir ~/grass/indata&lt;br /&gt;
&lt;br /&gt;
Create GRASS location using SPEARFISH data to be able create new locations&lt;br /&gt;
   &lt;br /&gt;
   $ cd ~/grass&lt;br /&gt;
   $ tar zxf spearfish_grass60data-0.3.tar.gz&lt;br /&gt;
&lt;br /&gt;
Start GRASS&lt;br /&gt;
&lt;br /&gt;
   $ grass -text spearfish60/PERMANENT&lt;br /&gt;
 $ [http://lux-essay.com/ essay]&lt;br /&gt;
&lt;br /&gt;
= Obtaining Data =&lt;br /&gt;
&lt;br /&gt;
We assume that one wants to create UK map. Following steps can be easily&lt;br /&gt;
applied to other countries' data.&lt;br /&gt;
&lt;br /&gt;
Country related GIS data can be obtained from&lt;br /&gt;
[http://www.maproom.psu.edu/dcw/ Digital Chart of the World].&lt;br /&gt;
&lt;br /&gt;
First create country related input directory&lt;br /&gt;
&lt;br /&gt;
   $ mkdir ~/grass/indata/uk&lt;br /&gt;
&lt;br /&gt;
Let's download UK data&lt;br /&gt;
* go to [http://www.maproom.psu.edu/dcw/ Digital Chart of the World]&lt;br /&gt;
* click Europe link&lt;br /&gt;
* choose United Kingdom in select box on the right and click Continue&lt;br /&gt;
* page _Digital Chart of the World Layer Interface for United Kingdom_ will be displayed&lt;br /&gt;
* click Download Data button&lt;br /&gt;
* another page will be shown, mark checkboxes&lt;br /&gt;
** Populated Places (Polygon)&lt;br /&gt;
** Roads (Line)&lt;br /&gt;
** Rail Roads (Line)&lt;br /&gt;
* click Continue&lt;br /&gt;
* on new page click Compute Data&lt;br /&gt;
* on new page you will be able to obtain set of data (&amp;lt;NUMBER&amp;gt; is part of filename with data exported by DCW)&lt;br /&gt;
   &amp;lt;NUMBER&amp;gt;.tar.Z&lt;br /&gt;
* do not hesistate to download data into ~/grass/indata/uk directory&lt;br /&gt;
&lt;br /&gt;
== Downloading Names of Cities ==&lt;br /&gt;
[http://earth-info.nga.mil/gns/html/ NGA GEOnet Names Server] provides free GIS data&lt;br /&gt;
containing positions of cities and their names.&lt;br /&gt;
&lt;br /&gt;
Data can be downloaded from FTP server&lt;br /&gt;
&lt;br /&gt;
   ftp://ftp.nga.mil/pub/gns_data/&lt;br /&gt;
&lt;br /&gt;
Direct link to UK GNS data&lt;br /&gt;
&lt;br /&gt;
   ftp://ftp.nga.mil/pub/gns_data/uk.zip&lt;br /&gt;
&lt;br /&gt;
Download UK data into ~/grass/indata/uk directory.&lt;br /&gt;
&lt;br /&gt;
= Importing Data =&lt;br /&gt;
Importing data into GRASS is two fold step&lt;br /&gt;
* create new location with one piece of data&lt;br /&gt;
* import remaining data&lt;br /&gt;
&lt;br /&gt;
== Creating New Location ==&lt;br /&gt;
One can create new location using another location. We will use SPEARFISH location&lt;br /&gt;
to create UK location.&lt;br /&gt;
&lt;br /&gt;
Start GRASS&lt;br /&gt;
&lt;br /&gt;
   $ cd ~/grass&lt;br /&gt;
   $ grass62 -text spearfish60/PERMANENT (you need grass 6.2.x for this to work)&lt;br /&gt;
&lt;br /&gt;
Enter UK input data directory and unpack downloaded data from DCW&lt;br /&gt;
&lt;br /&gt;
   $ cd indata/uk&lt;br /&gt;
   $ tar zxf &amp;lt;NUMBER&amp;gt;.tar.Z&lt;br /&gt;
&lt;br /&gt;
You will have several files&lt;br /&gt;
;ponet.e00:  country borders&lt;br /&gt;
;pppoly.e00: populated places&lt;br /&gt;
;rdline.e00: road network&lt;br /&gt;
;rrline.e00: rail road network&lt;br /&gt;
&lt;br /&gt;
We will create UK GRASS location using country borders. In SPEARFISH GRASS session&lt;br /&gt;
use following commands to create location uk and layer borders&lt;br /&gt;
&lt;br /&gt;
   $ cd ~/grass&lt;br /&gt;
   $ v.in.ogr dsn=indata/uk/ponet.e00 layer=ARC output=borders location=uk&lt;br /&gt;
&lt;br /&gt;
New location is created. Exit SPEARFISH GRASS session and start GRASS UK session&lt;br /&gt;
&lt;br /&gt;
   $ cd ~/grass&lt;br /&gt;
   $ grass62 -text uk/PERMANENT&lt;br /&gt;
&lt;br /&gt;
You can display UK borders&lt;br /&gt;
&lt;br /&gt;
   $ g.region vect=borders    # set region to display&lt;br /&gt;
   $ d.mon x0                 # create GRASS monitor&lt;br /&gt;
   $ d.vect map=borders       # display borders&lt;br /&gt;
&lt;br /&gt;
== Importing Rest of the Data ==&lt;br /&gt;
&lt;br /&gt;
Having GRASS UK location we can import rest of the data (population places,&lt;br /&gt;
road and rail networks)&lt;br /&gt;
&lt;br /&gt;
   $ cd ~/grass&lt;br /&gt;
   $ grass -text uk/PERMANENT&lt;br /&gt;
   $ v.in.ogr dsn=indata/uk/pppoly.e00 layer=ARC output=pcities&lt;br /&gt;
   $ v.in.ogr dsn=indata/uk/rdline.e00 layer=ARC output=roads&lt;br /&gt;
   $ v.in.ogr dsn=indata/uk/rrline.e00 layer=ARC output=rails&lt;br /&gt;
&lt;br /&gt;
Display data&lt;br /&gt;
&lt;br /&gt;
   $ d.mon x0&lt;br /&gt;
   $ g.region vect=borders&lt;br /&gt;
   $ d.vect map=borders color=black width=1.2&lt;br /&gt;
   $ d.vect map=roads   color=grey           &lt;br /&gt;
   $ d.vect map=pcities color=brown&lt;br /&gt;
&lt;br /&gt;
or save it to PNG file uk.png&lt;br /&gt;
&lt;br /&gt;
   $ GRASS_WIDTH=1024 GRASS_HEIGHT=1024 GRASS_PNGFILE=uk.png d.mon start=PNG&lt;br /&gt;
   $ d.mon select=PNG&lt;br /&gt;
   $ d.vect map=borders color=black width=1.2                             &lt;br /&gt;
   $ d.vect map=roads   color=grey                                        &lt;br /&gt;
   $ d.vect map=pcities color=brown                                       &lt;br /&gt;
   $ d.mon stop=PNG&lt;br /&gt;
&lt;br /&gt;
== Import Data from GNS ==&lt;br /&gt;
Downloaded GNS data can be imported into GRASS using v.in.gns script.&lt;br /&gt;
&lt;br /&gt;
Uncompress GNS data&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/grass/indata/uk&lt;br /&gt;
    $ unzip uk.zip&lt;br /&gt;
&lt;br /&gt;
Start GRASS UK session&lt;br /&gt;
&lt;br /&gt;
    $ cd ~/grass&lt;br /&gt;
    $ grass62 -text uk/PERMANENT&lt;br /&gt;
&lt;br /&gt;
Import data&lt;br /&gt;
&lt;br /&gt;
    $ v.in.gns file=indata/uk/uk.txt vect=cities&lt;br /&gt;
&lt;br /&gt;
= Processing Data =&lt;br /&gt;
GNS data contains information about large amount of cities. Usually it is&lt;br /&gt;
uncovinient to see all this data on a map. GRASS allows us to create new&lt;br /&gt;
vector layers of cities.&lt;br /&gt;
&lt;br /&gt;
Example below will show how to create new vector layer from GNS data for major&lt;br /&gt;
country cities.&lt;br /&gt;
&lt;br /&gt;
Start GRASS session&lt;br /&gt;
    $ cd ~/grass&lt;br /&gt;
    $ grass62 -text uk/PERMANENT&lt;br /&gt;
&lt;br /&gt;
Extract data from cities vector layer to mcities vector layer&lt;br /&gt;
&lt;br /&gt;
    $ v.extract --o output=mcities input=cities where=&amp;quot;(DSG='PPLA' or DSG='PPLC') and NT='N'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Above selects those names of cities, which&lt;br /&gt;
* name type is 'N'&lt;br /&gt;
* Feature Designation Code (DSG) is PPLA or PPLC&lt;br /&gt;
&lt;br /&gt;
Create labels using FULLNAME column&lt;br /&gt;
&lt;br /&gt;
    $ v.label labels=mcities map=mcities column=FULLNAME size=0.1&lt;br /&gt;
&lt;br /&gt;
Display map&lt;br /&gt;
&lt;br /&gt;
    $ d.mon x0&lt;br /&gt;
    $ d.vect map=borders color=black width=1.2&lt;br /&gt;
    $ d.vect map=mcities icon=basic/circle color=black fcolor=red size=4&lt;br /&gt;
    $ d.labels labels=mcities&lt;br /&gt;
&lt;br /&gt;
Other columns can be used to filter data or create labels. GNS columns are described at&lt;br /&gt;
[http://earth-info.nga.mil/gns/html/help.htm GNS Help page].&lt;br /&gt;
&lt;br /&gt;
[[Category: Documentation]]&lt;/div&gt;</summary>
		<author><name>⚠️JohnCox</name></author>
	</entry>
</feed>