Gisgraphy configuration



Import Data

To import data, you must use the admin interface. See the admin interface section for more information

Debug Mode

Each Gisgraphy service is a servlet. Each servlet can be run in debug mode. It enables the error message (exception message) to be output to the end user. To do so, just declare the servlet init parameter "debugMode" to true (in the web.xml) as shown :

<servlet>
		<servlet-name>address parser service</servlet-name>
		<servlet-class>
			com.gisgraphy.servlet.AddressParserServlet
		</servlet-class>
		 <init-param>
		 <!-- if true the output field error will contains the exception message.
			 Default to false -->
			<param-name>debugMode</param-name>
			<param-value>true</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

<servlet>
		<servlet-name>geocoding service</servlet-name>
		<servlet-class>
			com.gisgraphy.servlet.GeocodingServlet
		</servlet-class>
		 <init-param>
		 <!-- if true the output field error will contains the exception message.
			 Default to false -->
			<param-name>debugMode</param-name>
			<param-value>true</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
</servlet>


<servlet>
		<servlet-name>street service</servlet-name>
		<servlet-class>
			com.gisgraphy.servlet.StreetServlet
		</servlet-class>
		 <init-param>
		 <!-- if true the output field error will contains the exception message.
			 Default to false -->
			<param-name>debugMode</param-name>
			<param-value>true</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>


<servlet>
		<servlet-name>geoloc service</servlet-name>
		<servlet-class>
			com.gisgraphy.servlet.GeolocServlet
		</servlet-class>
		 <init-param>
		 <!-- if true the output field error will contains the exception message.
			 Default to false -->
			<param-name>debugMode</param-name>
			<param-value>true</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
</servlet>
	
	
<servlet>
		<servlet-name>fulltext service</servlet-name>
		<servlet-class>
			com.gisgraphy.servlet.FulltextServlet
		</servlet-class>
		<init-param>
		 <!-- if true the output field error will contains the exception message.
			 Default to false -->
			<param-name>debugMode</param-name>
			<param-value>true</param-value>
		</init-param>
		<load-on-startup>2</load-on-startup>
</servlet>

	

Options and environment-specific settings

All the options and environment-specific settings are located in the env.properties file. The env.properties is located in the /webapps/ROOTWEB-INF/classes directory
Take care of white spaces in properties file : MyProperties=bar is not the same as MyProperties= bar (whitespaces after the equals sign are taken into account)

importer.geonames.dir

This option determines the directory where the GeoNames files are located. It must end with / or \ according to the operating system path separator. It is also the directory where the GeoNames files will be downloaded from the importer.geonames.downloadURL URL . On Windows, the '\' character must be escaped as in the example below. The path can be absolute or relative (from the directory where you've launch Gisgraphy). It is not recommended to put space in the path.
. This option is case sensitive if the underlying file system is case sensitive (e.g : Linux / Unix).
Examples on Linux :
importer.geonames.dir=./data/prod/
importer.geonames.dir=/home/user/data/prod/

Example on Windows
importer.geonames.dir=.\\data\\prod\\


importer.openstreetmap.dir

This option determines the directory where the OpenStreetMap files are located. It must end with / or \ according to the operating system path separator. It is also the directory where the OpenStreetMap files will be downloaded from the importer.openstreetmap.downloadURL URL . On Windows The '\' character must be escaped as in the example below. The path can be absolute or relative (from the directory where you've launch Gisgraphy). It is not recommended to put space in the path.
. This option is case sensitive if the underlying file system is case sensitive (e.g : Linux / Unix).
Examples on Linux :
importer.openstreetmap.dir=./data/prod/
importer.openstreetmap.dir=/home/user/data/prod/

Example on Windows
importer.openstreetmap.dir=.\\data\\prod\\


importer.geonames.zipcode.dir

This option determines the directory where the GeoNames zipcode files are located. It must end with / or \ according to the operating system path separator. It is also the directory where the GeoNames zipcode files will be downloaded from the importer.geonames.zip.downloadURL URL . On Windows The '\' character must be escaped as in the example below . The path can be absolute or relative (from the directory where you've launch Gisgraphy). It is not recommended to put space in the path.
. This option is case sensitive if the underlying file system is case sensitive (e.g : Linux / Unix).
Examples on Linux :
mporter.geonames.zipcode.dir=./data/prod/
mporter.geonames.zipcode.dir=/home/user/data/prod/

Example on Windows
mporter.geonames.zipcode.dir=.\\data\\prod\\


importer.geonames.enabled

Whether the importers related to GeoNames will be processed (it enable the zipcode importer too). If 'true' the importers will be executed. This option should be in lower case.
Examples :
importer.geonames.enabled=true
importer.geonames.enabled=false


importer.openstreetmap.enabled

Whether the importers related to OpenStreetMap will be processed. If 'true' the importers will be executed. This option should be in lower case.
Examples :
importer.openstreetmap.enabled=true
importer.openstreetmap.enabled=false


importer.openstreetmap.housenumber.enabled

Whether the importers related to house numbers OpenStreetMap will be processed. If 'true' the importers will be executed. This option should be in lower case.
Examples :
importer.openstreetmap.housenumber.enabled=true
importer.openstreetmap.housenumber.enabled=false


importer.quattroshapes.enabled

Whether the importers related to Quattroshapes will be processed. If 'true' the importers will be executed. This option should be in lower case.
Examples :
importer.quattroshapes.enabled=true
importer.quattroshapes.enabled=false


importerConfig.openstreetmap.fill.isin.field

Whether we search for the nearest city in GeoNames data to fill the is_in field. This will increase the run time of the importer but strongly increases the relevance of the geocoder. Default to true. This option should be in lower case.
Examples :
importerConfig.openstreetmap.fill.isin.field=true
importerConfig.openstreetmap.fill.isin.field=false


DON'T MODIFY this option after importer is done.


importer.geonames.downloadURL

This option determines the URL of the server to download the GeoNames files to be processed (typically, the GeoNames download server). This option is case sensitive.
Example :
importer.geonames.downloadURL=http://download.geonames.org/export/dump/


Don't forget the ending slash !


importer.openstreetmap.downloadURL

This option determines the URL of the server to download the OpenStreetMap files to be processed (typically, the Gisgraphy download server). This option is case sensitive.
Example :
importer.openstreetmap.downloadURL=http://download.gisgraphy.com/openstreetmap/


Don't forget the ending slash !


importer.openstreetmap.housenumbers.downloadURL

This option determines the URL of the server to download the house numbers OpenStreetMap files to be processed (typically, the Gisgraphy download server). This option is case sensitive.
Example :
importer.openstreetmap.downloadURL=http://download.gisgraphy.com/openstreetmap/housenumbers/


Don't forget the ending slash !


importer.openstreetmap.cities.downloadURL

This option determines the URL of the server to download the cities OpenStreetMap files to be processed (typically, the Gisgraphy download server). This option is case sensitive.
Example :
importer.openstreetmap.cities.downloadURL=http://download.gisgraphy.com/openstreetmap/cities/


Don't forget the ending slash !


importer.openstreetmap.pois.downloadURL

This option determines the URL of the server to download the POIs (point of interest) OpenStreetMap files to be processed (typically, the Gisgraphy download server). This option is case sensitive.
Example :
importer.openstreetmap.pois.downloadURL=http://download.gisgraphy.com/openstreetmap/pois/


Don't forget the ending slash !


importer.quattroshapes.downloadURL

This option determines the URL of the server to download the Quattroshapes files to be processed (typically, the Gisgraphy download server). This option is case sensitive.
Example :
importer.quattroshapes.downloadURL=http://download.gisgraphy.com/quattroshapes/


Don't forget the ending slash !


importer.geonames.zipcode.downloadURL

This option determines the URL of the server to download the GeoNames zipcode files to be processed (typically, the GeoNames download server). This option is case sensitive.
Example :
importer.geonames.zipcode.downloadURL=http://download.geonames.org/export/zip/


Don't forget the ending slash !


importer.geonamesfilesToDownload

This option determines the files to be downloaded from the importer.geonames.downloadURL URL. The files must be ';' separated. Add specific country zip files (or allcountries.zip) and alternateNames.zip. This option is case sensitive. If the allCountries.txt file is in the importer.geonames.dir directory, the other country files will be logically ignored.
Examples :
importer.geonamesfilesToDownload=US.zip;MX.zip
importer.geonamesfilesToDownload=allCountries.zip


If you run an import, change the option and re-run an import : you must first delete the old downloaded file before you re-run the import. If you don't : the files you've downloaded for the first import will be processed.

It is not necessary to download CountryInfo.txt, iso-languagecodes.txt, because they are already in the gisgraphy data directory of the Gisgraphy distrib.


importer.openstreetmapfilesToDownload

This option determines the files to be downloaded from the importer.openStreetMap.downloadURL URL. The files must be ';' separated. Add specific country zip files (or allcountries.zip). This option is case sensitive. If the allCountries.txt file is in the importer.geonames.dir directory, the other countries files will be logically ignored.
Examples :
importer.openstreetmapfilesToDownload=AD.gis;CY.gis
importer.openstreetmapfilesToDownload=allCountries.zip



importer.openstreetmapHouseNumberFilesToDownload

This option determines the house numbers files to be downloaded from the importer.openstreetmap.housenumbers.downloadURL URL. The files must be ';' separated. Add specific country zip files (or allcountries.zip). This option is case sensitive. If the allCountries.txt file is in the importer.openstreetmap.housenumbers.dir directory, the other countries files will be logically ignored.
Examples :
importer.openstreetmapHouseNumberFilesToDownload=AD.gis;CY.gis
importer.openstreetmapHouseNumberFilesToDownload=allCountries.zip



importer.openStreetMapCitiesFilesToDownload

This option determines the OpenStreetMap cities files to be downloaded from the importer.openstreetmap.cities.downloadURL URL. The files must be ';' separated. Add specific country zip files (or allcountries.zip). This option is case sensitive. If the allCountries.txt file is in the importer.openStreetMapCitiesFilesToDownload directory, the other countries files will be logically ignored.
Examples :
importer.openStreetMapCitiesFilesToDownload=AD.gis;CY.gis
importer.openStreetMapCitiesFilesToDownload=allCountries.zip



importer.openStreetMapPoisFilesToDownload

This option determines the POIs (point of interest) numbers files to be downloaded from the importer.openstreetmap.pois.downloadURL URL. The files must be ';' separated. Add specific country zip files (or allcountries.zip). This option is case sensitive. If the allCountries.txt file is in the importer.openstreetmap.pois.dir directory, the other countries files will be logically ignored.
Examples :
importer.openStreetMapPoisFilesToDownload=AD.gis;CY.gis
importer.openStreetMapPoisFilesToDownload=allCountries.zip



importer.quattroshapesFilesToDownload

This option determines the Quattroshapes files to be downloaded from the importer.quattroshapes.downloadURL URL. The files must be ';' separated. typically the file is shapes.gis. This option is case sensitive. Files will be downloaded in importer.quattroshapes.dir directory.
Examples :
importer.quattroshapesFilesToDownload=shapes.gis



importer.retrieveFiles

Whether the files defined by the importer.*filesToDownload option should be downloaded. If 'true' the importer will download the files. If 'false', it will use the files already present. This option should be in lower case.
Examples :
importer.retrieveFiles=true
importer.retrieveFiles=false


fulltextSearchUrl

The URL of the SolR Server. If you use the SolR server of the Gisgraphy distribution : the URL should be the Gisgraphy URL follow by SolR (name of the war file). If you need better performance, (that's to say, run Gisgraphy and the SolR server in two distinct JVM) see JVM optimisation) : specify the URL of the server you want to use. This option is case sensitive.
Examples :
fulltextSearchUrl=http://localhost:8080/SolR/

Example with the default SolR port
fulltextSearchUrl=http://localhost:8983/SolR/


importerConfig.wrongNumberOfFieldsThrows

Whether the importer should throw an exception and stop the import if a line in an imported CSV file doesn't have the expected number of fields. This option should be in lower case. Recommended to be set to false; set it to true if you use Gisgraphy for error correction.
Examples :
importerConfig.wrongNumberOfFieldsThrows=true
importerConfig.wrongNumberOfFieldsThrows=false


importerConfig.missingRequiredFieldThrows

Whether we should throw an exception and stop the import if a required field is missing. This option should be in lower case. Recommended to be set to false, set it to true if you use Gisgraphy for error correction.
Examples :
importerConfig.missingRequiredFieldThrows=true
importerConfig.missingRequiredFieldThrows=false


importerConfig.acceptRegExString

A regular expression for the place type we want to import. The default value is .* (all the place types) if the value is not specified. Administrative divisions and countries are automatically imported. This option is case insensitive. Place types are the name of the entities class (see package com.gisgraphy.domain.geoloc.entity source code for details) - don't forget to add GISFEATURE for POIs that are not categorized.
Examples :
.* : import all gisfeatures, no matter their feature class / code
RESTAURANT|BAR : import all Restaurants and Bars
RESTAURANT|BAR|GISFEATURE : import all Restaurants and Bars and POI that have no real categories
FOREST : import all the forests


See http://download.geonames.org/export/dump/featureCodes.txt to get a full description of the feature class / code. This page gives you details on what the "feature codes" used in GeoNames are.


importerConfig.tryToDetectAdmIfNotFound

If this option is set to (recommended value) true : The importer will try to detect Adm for features if the AdmXcodes values does not correspond to a known Adm. Set this option to true to activate error correction. If set to false, error correction is disabled and if no Adm is found for the AdmXcode, the feature will be linked to a null Adm.

This option is case sensitive and must be set in lower case. Example : There is an adm with level 2 which have adm1Code = 'A1' and adm2Code = 'B2' in the datastore. Suppose there is a gisFeature which have Adm1code='A3' and Adm2Code='B2', Gisgraphy will detect an error because there is no Adm with those codes. So if this option is set to true, Gisgraphy will correct the error and will link the feature to the Adm with codes adm1Code = 'A1' and adm2Code = 'B2'. If if this option is set to false, Gisgraphy won't try to correct the error, puts a warning message in the logs, and links the feature to a null Adm. This option should be in lower case.
Examples :
importerConfig.tryToDetectAdmIfNotFound=true
importerConfig.tryToDetectAdmIfNotFound=false


importerConfig.syncAdmCodesWithLinkedAdmOnes

This option is a little bit difficult to understand. An example is often simpler than a big speech ;). First, there is a few things you need to know : a feature has the following properties:
FeatureId......Adm...Adm1Code...Adm2Code...Adm3Code...Adm4Code...adm1Name...Adm2Name...adm3Name...Adm4Name...
An Adm is a feature too and has the same properties.
So, a feature is linked to an administrative division (AKA : Adm). For performance reasons, the codes and names of the Adms are stored in the Feature itself.
Now consider the example above : if there is an error the adm will not be the same as the codes in the CSV files. This option allow you to choose between two strategies :
  • If importerConfig.syncAdmCodesWithLinkedAdmOnes is set to 'true', then the admXcodes and admXnames of the features will be the same as the linked Adm One (in our example : if importerConfig.tryToDetectAdmIfNotFoundis set to 'true' the adm1Code will be 'A1' and the Adm2Code will be 'B2' - that's to say the same as the Adm ones)
  • If importerConfig.syncAdmCodesWithLinkedAdmOnes is set to 'false', the admXcodes and admXnames of the features will be the same as the CSV file (in our example : if importerConfig.tryToDetectAdmIfNotFound is set to 'true', the adm1Code will be 'A3' and the Adm2Code will be 'B2' - and the linked Adm will be null)
In other words if you want the importer to set the admXcode and admXnames to the CSV one : set this option to false. if you want those codes to be the same as the linked Adm : set it to true.
If you don't know what to do : set it to the recommended value : true. This option is case sensitive and must be set in lower case.
importerConfig.tryToDetectAdmIfNotFound and importerConfig.syncAdmCodesWithLinkedAdmOnes are orthogonal concepts


importerConfig.admXExtracterStrategyIfAlreadyExists

In order to import the Adm before the other features, Gisgraphy extracts Adm1, Adm2, Adm3 and Adm4 into separate files. This option tells Gisgraphy what to do if an AdmX file (determined with the importerConfig.admXFileName option) already exists in the importer.geonames.dir. This option is case sensitive. 3 options are available :
  • skip : extraction will be skipped, and the existing file will be used;
  • backup : The already existing file will be backed up (with the date and the current time) and a new file will be extracted and used;
  • reprocess : the file will be replaced by the new one
Examples :
importerConfig.adm3ExtracterStrategyIfAlreadyExists=reprocess
importerConfig.adm4ExtracterStrategyIfAlreadyExists=skip


importerConfig.adm1FileName

Specifies the filename of the CSV file with Administrative division with level 1. Should normally be 'admin1Codes.txt'. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.adm2FileName

Specifies the filename of the CSV file with Administrative division with level 2. Should normally be 'admin2Codes.txt'. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.adm3FileName

Specifies the filename of the CSV file with Administrative division with level 3. Should normally be 'admin3Codes.txt'. This file name will be used to extract Adm with level 3. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.adm4FileName

Specifies the filename of the CSV file with Administrative division with level 4. Should normally be 'admin4Codes.txt'. This file name will be used to extract Adm with level 4. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.languageFileName

Specifies the filename of the CSV file with languages. Should normally be 'iso-languagecodes.txt'. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.countriesInfosFileName

Specifies the filename of the CSV file with country information. Should normally be 'countryInfo.txt'. This option is case sensitive if the underlying file system is case sensitive. This option is not the list of countries to import.

To be clearer the option importerConfig.countriesFileName has been renamed to 'importerConfig.countriesInfosFileName' (version >= 2.0)

importerConfig.alternateNamesFileName

Specifies the filename of the CSV file that contains alternate names. Should normally be 'alternateNames.txt'. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.alternateNameFeaturesFileName

Specifies the name of the file where the alternate names of features that are not adm1, adm2, or country are (extracted). Should normally be 'alternateNames-features.txt'. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.alternateNameAdm1FileName

Specifies the the name of the file where the alternate names of adm with level 1 are (extracted). Should normally be 'alternateNames-adm1.txt'. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.alternateNameAdm2FileName

Specifies the the name of the file where the alternate names of adm with level 2 are (extracted). Should normally be 'alternateNames-adm2.txt'. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.alternateNameCountryFileName

Specifies the name of the file where the alternate names of countries are. Should normally be 'alternateNames-country.txt'. This option is case sensitive if the underlying file system is case sensitive.

importerConfig.importGisFeatureEmbededAlternateNames

The alternate names are provided in each country dump file, some additional information (languages, isPrefered name,...) are in a separate file. If you want to import the alternate names of the country files (faster but you miss some informations and the language parameter of the fulltext service won't be taken into account) set this option to true - in that case the importerConfig.alternateNamesFileName will be ignored. If you want a full import with the alternatenames separated file set this option to false. This option is case sensitive and must be set in lowercase.
Examples :
importerConfig.importGisFeatureEmbededAlternateNames=true
importerConfig.importGisFeatureEmbededAlternateNames=false


fulltextsearch.maxConnectionsPerHost

Limits the numbers of connections to the SolR server per host. Recommended : 32.

fulltextsearch.maxTotalConnections

Limits the numbers of connections to the SolR server for all hosts. Recommended : 128.

geolocsearch.defaultGeolocSearchPlaceType

Define the default placetype Class for the geoloc query (not the fulltext one). An empty or wrong value will search for any placetype by default. This option is case sensitive. The placeType must be in the entity package. Searching for all placetypes decreases performance if there are a lot of feature in the database. The name of the class should not ends with '.class' and is case sensitive.
Examples :
geolocsearch.defaultGeolocSearchPlaceType=City
geolocsearch.defaultGeolocSearchPlaceType=


addressParser.url

The url of the address parser server. This option is the one to change when you buy premium webservices. This must be a valid URL
Examples :
addressParser.url=http://services.gisgraphy.com/addressparser/parse?

useAddressParserWhenGeocoding

The option below enables/disables the parsing of the text to geocode. It can improve the response time because no requests are done to Gisgraphy (offline mode) . Case sensitive, should be in lowercase true|false, default to false.
Examples :
useAddressParserWhenGeocoding=true
useAddressParserWhenGeocoding=false

Note that address parser will be enabled if this option is true OR if the postal parameter is true. so you can disable the address parser by default and enable it at query time.

searchForExactMatchWhenGeocoding

Whether we should do a search with all words required AND a search without. It decrease the response time but can be useful if you want to search for common places (hotel, city, adm, monument) AND address. It allow you to do a fulltext search and a geocoding request. Default to true. Set to false if you only want to geocode #address, not place (better performance, less accuracy). Case sensitive, should be in lowercase true|false.
Examples :
searchForExactMatchWhenGeocoding=true
searchForExactMatchWhenGeocoding=false
Two versions are deployed : one on Gisgraphy server and one on Google appengine.


addressParser.class

The (Java) class of the address parser client. This option can be changed to fit your own implementation. This parameter is useful when you buy a license of the parser and use it internally (without the webservices)
Examples :
addressParser.class=com.gisgraphy.addressparser.AddressParserClient


spellchecker.enabled

Enable or disable the spellchecker for the fulltext search engine. 'true' or 'false' are possible values. This option is case sensitive.
Examples :
spellchecker.enabled=true
spellchecker.enabled=false
Spellchecking is available for Gisgraphy 1.1 and greater.


spellchecker.activeByDefault=true

Define the default value if the spellchecking parameter is not set. 'true' or 'false' are possible values. this option is case sensitive.
Examples :
spellchecker.activeByDefault=true
spellchecker.activeByDefault=false
The spellchecker is only enabled if the spellchecking parameter AND the spellchecker.enabled are equal to 'true'


spellchecker.spellcheckerDictionaryName

The name of the SolR spellchecker to use. This option is case sensitive and you must set the same name in the SolRconfig.xml file and in the env.properties in lower case. By default two spellcheckers are defined : 'levenstein' and 'jarowinkler'. In practice jarowinkler seems to give better results.
Examples :
spellchecker.spellcheckerDictionaryName=jarowinkler
spellchecker.spellcheckerDictionaryName=levenstein


spellchecker.collateResults

For a request with several words, return a string with the best suggestion for each word. For instance, for 'pariss frence' => 'Paris France' will be suggested. This option is case sensitive. 'true' and 'false' are possible values.
Examples :
spellchecker.collateResults=true
spellchecker.collateResults=false


googleMapAPIKey (deprecated)

The Google maps API key was required in v 3.0 but not in v 4.0 because we now use OpenStreetMap maps.
Examples :
googleMapAPIKey=ABQIAAAAC0kUg2SfDYBO-AEagcTgvhQ5aXWj7Kef4ih_G0qG0UGxHdmrpFrmSD7sGMwTJIN1g7C45waZ5ybiQ


googleanalytics.uacctcode

The Google analytics code to have statistics
Examples :
googleMapAPIKey=ABQIAAAAC0GGGDYBO-AEagcTgvhQ5aXWj7Kef4ih_G0qG0UGxHdmrpFrmSD7sGMwTJIN1g7C45waZ5ybiQ